├── img
├── Avatar.jpg
├── Avatar.webp
├── MainPic.jpg
├── MainPic.webp
├── favicon.ico
├── Background.jpg
├── sidebarheader.jpg
├── sidebarheader.webp
├── random
│ ├── material-1.png
│ ├── material-1.webp
│ ├── material-10.png
│ ├── material-10.webp
│ ├── material-11.png
│ ├── material-11.webp
│ ├── material-12.png
│ ├── material-12.webp
│ ├── material-13.png
│ ├── material-13.webp
│ ├── material-14.png
│ ├── material-14.webp
│ ├── material-15.png
│ ├── material-15.webp
│ ├── material-16.png
│ ├── material-16.webp
│ ├── material-17.png
│ ├── material-17.webp
│ ├── material-18.png
│ ├── material-18.webp
│ ├── material-19.png
│ ├── material-19.webp
│ ├── material-2.png
│ ├── material-2.webp
│ ├── material-20.png
│ ├── material-20.webp
│ ├── material-21.png
│ ├── material-21.webp
│ ├── material-22.png
│ ├── material-22.webp
│ ├── material-23.png
│ ├── material-23.webp
│ ├── material-24.png
│ ├── material-24.webp
│ ├── material-25.png
│ ├── material-25.webp
│ ├── material-26.png
│ ├── material-26.webp
│ ├── material-27.png
│ ├── material-27.webp
│ ├── material-3.png
│ ├── material-3.webp
│ ├── material-4.png
│ ├── material-4.webp
│ ├── material-5.png
│ ├── material-5.webp
│ ├── material-6.png
│ ├── material-6.webp
│ ├── material-7.png
│ ├── material-7.webp
│ ├── material-8.png
│ ├── material-8.webp
│ ├── material-9.png
│ └── material-9.webp
├── fontcustom
│ ├── fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot
│ ├── fontcustom_64c4c0ae568da9afcb9e1be056ff0854.ttf
│ ├── fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff
│ ├── fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff2
│ ├── fontcustom.css
│ └── fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg
└── svg
│ ├── youtube.svg
│ ├── facebook.svg
│ ├── telegram.svg
│ ├── zhihu_c.svg
│ ├── steam.svg
│ ├── twitter_14.svg
│ ├── twitter_15.svg
│ ├── post_gplus.svg
│ ├── facebook_6.svg
│ ├── facebook_9.svg
│ ├── steam_1.svg
│ ├── linkedin.svg
│ ├── linkedin_4.svg
│ ├── github.svg
│ ├── twitter.svg
│ ├── zhihu_px.svg
│ ├── cn_bilibili_b.svg
│ └── niconico.svg
├── screenshot.png
├── fonts
├── Roboto.ttf
└── Roboto-700.ttf
├── css
├── page.css
├── post.css
├── index.css
└── shared.css
├── .gitignore
├── inc
├── lang
│ ├── en-us.php
│ ├── zh-cn.php
│ └── zh-tw.php
├── functions
│ ├── extra.php
│ ├── thumbNail.php
│ └── themeOptions.php
├── updateChecker.php
├── header.php
├── comments.php
├── footer.php
└── sidebar.php
├── .travis.yml
├── js
├── scrolltop.js
└── search.js
├── update.php
├── package.json
├── gulpfile.js
├── 404.php
├── template-links.php
├── page.php
├── functions.php
├── README.md
├── post.php
└── index.php
/img/Avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/Avatar.jpg
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/screenshot.png
--------------------------------------------------------------------------------
/fonts/Roboto.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/fonts/Roboto.ttf
--------------------------------------------------------------------------------
/img/Avatar.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/Avatar.webp
--------------------------------------------------------------------------------
/img/MainPic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/MainPic.jpg
--------------------------------------------------------------------------------
/img/MainPic.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/MainPic.webp
--------------------------------------------------------------------------------
/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/favicon.ico
--------------------------------------------------------------------------------
/img/Background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/Background.jpg
--------------------------------------------------------------------------------
/fonts/Roboto-700.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/fonts/Roboto-700.ttf
--------------------------------------------------------------------------------
/img/sidebarheader.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/sidebarheader.jpg
--------------------------------------------------------------------------------
/img/sidebarheader.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/sidebarheader.webp
--------------------------------------------------------------------------------
/css/page.css:
--------------------------------------------------------------------------------
1 | .mdui-row > [class*="mdui-col-"] {
2 | padding-top: 0;
3 | padding-bottom: 30px;
4 | }
--------------------------------------------------------------------------------
/img/random/material-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-1.png
--------------------------------------------------------------------------------
/img/random/material-1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-1.webp
--------------------------------------------------------------------------------
/img/random/material-10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-10.png
--------------------------------------------------------------------------------
/img/random/material-10.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-10.webp
--------------------------------------------------------------------------------
/img/random/material-11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-11.png
--------------------------------------------------------------------------------
/img/random/material-11.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-11.webp
--------------------------------------------------------------------------------
/img/random/material-12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-12.png
--------------------------------------------------------------------------------
/img/random/material-12.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-12.webp
--------------------------------------------------------------------------------
/img/random/material-13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-13.png
--------------------------------------------------------------------------------
/img/random/material-13.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-13.webp
--------------------------------------------------------------------------------
/img/random/material-14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-14.png
--------------------------------------------------------------------------------
/img/random/material-14.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-14.webp
--------------------------------------------------------------------------------
/img/random/material-15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-15.png
--------------------------------------------------------------------------------
/img/random/material-15.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-15.webp
--------------------------------------------------------------------------------
/img/random/material-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-16.png
--------------------------------------------------------------------------------
/img/random/material-16.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-16.webp
--------------------------------------------------------------------------------
/img/random/material-17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-17.png
--------------------------------------------------------------------------------
/img/random/material-17.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-17.webp
--------------------------------------------------------------------------------
/img/random/material-18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-18.png
--------------------------------------------------------------------------------
/img/random/material-18.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-18.webp
--------------------------------------------------------------------------------
/img/random/material-19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-19.png
--------------------------------------------------------------------------------
/img/random/material-19.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-19.webp
--------------------------------------------------------------------------------
/img/random/material-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-2.png
--------------------------------------------------------------------------------
/img/random/material-2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-2.webp
--------------------------------------------------------------------------------
/img/random/material-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-20.png
--------------------------------------------------------------------------------
/img/random/material-20.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-20.webp
--------------------------------------------------------------------------------
/img/random/material-21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-21.png
--------------------------------------------------------------------------------
/img/random/material-21.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-21.webp
--------------------------------------------------------------------------------
/img/random/material-22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-22.png
--------------------------------------------------------------------------------
/img/random/material-22.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-22.webp
--------------------------------------------------------------------------------
/img/random/material-23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-23.png
--------------------------------------------------------------------------------
/img/random/material-23.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-23.webp
--------------------------------------------------------------------------------
/img/random/material-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-24.png
--------------------------------------------------------------------------------
/img/random/material-24.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-24.webp
--------------------------------------------------------------------------------
/img/random/material-25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-25.png
--------------------------------------------------------------------------------
/img/random/material-25.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-25.webp
--------------------------------------------------------------------------------
/img/random/material-26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-26.png
--------------------------------------------------------------------------------
/img/random/material-26.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-26.webp
--------------------------------------------------------------------------------
/img/random/material-27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-27.png
--------------------------------------------------------------------------------
/img/random/material-27.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-27.webp
--------------------------------------------------------------------------------
/img/random/material-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-3.png
--------------------------------------------------------------------------------
/img/random/material-3.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-3.webp
--------------------------------------------------------------------------------
/img/random/material-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-4.png
--------------------------------------------------------------------------------
/img/random/material-4.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-4.webp
--------------------------------------------------------------------------------
/img/random/material-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-5.png
--------------------------------------------------------------------------------
/img/random/material-5.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-5.webp
--------------------------------------------------------------------------------
/img/random/material-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-6.png
--------------------------------------------------------------------------------
/img/random/material-6.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-6.webp
--------------------------------------------------------------------------------
/img/random/material-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-7.png
--------------------------------------------------------------------------------
/img/random/material-7.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-7.webp
--------------------------------------------------------------------------------
/img/random/material-8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-8.png
--------------------------------------------------------------------------------
/img/random/material-8.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-8.webp
--------------------------------------------------------------------------------
/img/random/material-9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-9.png
--------------------------------------------------------------------------------
/img/random/material-9.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/random/material-9.webp
--------------------------------------------------------------------------------
/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot
--------------------------------------------------------------------------------
/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.ttf
--------------------------------------------------------------------------------
/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff
--------------------------------------------------------------------------------
/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eastonman/material/HEAD/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff2
--------------------------------------------------------------------------------
/css/post.css:
--------------------------------------------------------------------------------
1 | .mdui-row > [class*="mdui-col-"] {
2 | padding-top: 0;
3 | padding-bottom: 30px;
4 | }
5 |
6 | .post-card-media > img {
7 | height: 280px;
8 | object-fit: cover;
9 | }
10 |
11 | .round-btn {
12 | border-radius: 18px;
13 | }
14 |
15 | .mdui-card-content img {
16 | max-width: 100%;
17 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | js/dsembed.js
2 |
3 | .DS_Store
4 |
5 | # back up files
6 | *.bak
7 |
8 | # website config
9 | manifest.json
10 |
11 | # All develop using bash script
12 | *.sh
13 |
14 | # Sublime text sftp plugin
15 | sftp-config.json
16 |
17 | # npm & gulp
18 | node_modules/
19 | package-lock.json
20 | rev-manifest.json
21 | dist/*
--------------------------------------------------------------------------------
/inc/lang/en-us.php:
--------------------------------------------------------------------------------
1 | dict[$key])) {
11 | return $this->dict[$key];
12 | } else {
13 | return $key;
14 | }
15 | }
16 | }
17 |
18 | //$MultiLang = new LangDict();
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "lts/*"
4 | install:
5 | - npm install
6 | - npm install -g gulp
7 | - npm install -g gulp-cli
8 | script:
9 | - gulp build
10 | - tar zcf material.tar.gz -C ./dist ./ --exclude=material.tar.gz --exclude=node_modules
11 | deploy:
12 | provider: releases
13 | api_key: ${GH_TOKEN}
14 | file: ./material.tar.gz
15 | skip_cleanup: true
16 | on:
17 | tags: true
18 |
--------------------------------------------------------------------------------
/js/scrolltop.js:
--------------------------------------------------------------------------------
1 | window.onload = function() {
2 | var fab = document.getElementById('scrolltop');
3 | var clientHeight = document.documentElement.clientHeight;
4 | var timer = null;
5 | var isTop = true;
6 | window.onscroll = function () {
7 | var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
8 | if ( scrollTop >= clientHeight) {
9 | fab.classList.remove('mdui-fab-hide');
10 | } else {
11 | fab.classList.add('mdui-fab-hide');
12 | }
13 | if (!isTop) {
14 | clearInterval(timer);
15 | }
16 | isTop = false;
17 | }
18 | }
--------------------------------------------------------------------------------
/js/search.js:
--------------------------------------------------------------------------------
1 | function searchJQ () {
2 | $$('#main-search-btn').on('click', function (e) {
3 | $$.showOverlay(5001);
4 | $$('#main-search-container').show();
5 | $$('#main-search-container').addClass('swashIn');
6 | $$('#main-search-text').addClass('expand');
7 | });
8 |
9 | $$('#main-search-close').on('click', function (e) {
10 | $$.hideOverlay();
11 | $$('#main-search-container').hide();
12 | $$('#main-search-container').removeClass('swashIn');
13 | $$('#main-search-text').removeClass('expand');
14 | });
15 |
16 | }
--------------------------------------------------------------------------------
/img/svg/youtube.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/facebook.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/telegram.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/update.php:
--------------------------------------------------------------------------------
1 | Update Checker For Theme New Material
";
11 | echo "Starting Update
";
12 | if (!update()){
13 | echo 'Update Failed!';
14 | } else {
15 | echo "Update Success!";
16 | }
17 | } else {
18 | echo 'Argument Error Or Already Latest Version.
';
19 | }
20 |
21 | } elseif (checkUpdate()) {
22 | echo '';
23 | } else {
24 | echo '您的主题已是最新版本
Already Latest Version.
';
25 | }
26 |
27 | ?>
--------------------------------------------------------------------------------
/inc/lang/zh-cn.php:
--------------------------------------------------------------------------------
1 | '继续阅读',
10 | 'Profile' => '用户概要',
11 | 'Settings' => '设置',
12 | 'Exit' => '退出',
13 | 'Submit' => '提交评论',
14 | 'Join the discussion' => '加入讨论吧',
15 | 'Website' => '网站',
16 | 'Email' => '邮箱',
17 | 'Name' => '昵称',
18 | 'Logged in as' => '登录用户',
19 | 'Login' => '登录',
20 | 'Logout' => '登出',
21 | 'Register' => '注册',
22 | 'Homepage' => '主页',
23 | 'Archive' => '归档',
24 | 'Categories' => '分类',
25 | 'Theme' => '主题',
26 | 'Reply' => '回复',
27 | 'Share' => '分享'
28 | );
29 | function get($key) {
30 | if (isset($this->dict[$key])) {
31 | return $this->dict[$key];
32 | } else {
33 | return $key;
34 | }
35 | }
36 | }
37 |
38 | //$MultiLang = new LangDict();
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/inc/lang/zh-tw.php:
--------------------------------------------------------------------------------
1 | '繼續閱讀',
10 | 'Profile' => '使用者概要',
11 | 'Settings' => '設置',
12 | 'Exit' => '退出',
13 | 'Submit' => '提交評論',
14 | 'Join the discussion' => '加入討論吧',
15 | 'Website' => '網站',
16 | 'Email' => '郵箱',
17 | 'Name' => '稱謂',
18 | 'Logged in as' => '登錄用戶',
19 | 'Login' => '登入',
20 | 'Logout' => '登出',
21 | 'Register' => '註冊',
22 | 'Homepage' => '首頁',
23 | 'Archive' => '過往',
24 | 'Categories' => '分類',
25 | 'Theme' => '主題',
26 | 'Reply' => '回復',
27 | 'Share' => '分享'
28 | );
29 | function get($key) {
30 | if (isset($this->dict[$key])) {
31 | return $this->dict[$key];
32 | } else {
33 | return $key;
34 | }
35 | }
36 | }
37 |
38 | //$MultiLang = new LangDict();
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "material",
3 | "version": "2.10.1",
4 | "description": "New Material Theme",
5 | "main": "gulpfile.js",
6 | "directories": {
7 | "lib": "lib"
8 | },
9 | "dependencies": {
10 | "del": "^3.0.0"
11 | },
12 | "devDependencies": {
13 | "gulp": "^3.9.1",
14 | "gulp-clean-css": "^3.9.4",
15 | "gulp-htmlmin": "^4.0.0",
16 | "gulp-jshint": "^2.1.0",
17 | "gulp-rename": "^1.4.0",
18 | "gulp-replace": "^0.6.1",
19 | "gulp-rev": "^8.1.1",
20 | "gulp-rev-collector": "^1.3.1",
21 | "gulp-uglify": "^3.0.0",
22 | "jshint": "^2.9.5",
23 | "run-sequence": "^2.2.1"
24 | },
25 | "scripts": {
26 | "test": "gulp"
27 | },
28 | "repository": {
29 | "type": "git",
30 | "url": "https://github.com/manyang901/material.git"
31 | },
32 | "keywords": [
33 | "material",
34 | "typecho",
35 | "theme"
36 | ],
37 | "author": "Manyang901",
38 | "license": "GPL-3.0",
39 | "bugs": {
40 | "url": "https://github.com/manyang901/material/issues"
41 | },
42 | "homepage": "https://github.com/manyang901/material#readme"
43 | }
44 |
--------------------------------------------------------------------------------
/img/svg/zhihu_c.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/steam.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/twitter_14.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/twitter_15.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/post_gplus.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/facebook_6.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/facebook_9.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/steam_1.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/linkedin.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/linkedin_4.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/github.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/img/svg/twitter.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var gulp = require('gulp'),
2 | del = require('del'),
3 | minifycss = require('gulp-clean-css'),
4 | uglify = require('gulp-uglify'),
5 | rename = require('gulp-rename'),
6 | jshint = require('gulp-jshint'),
7 | runSequence = require('run-sequence'),
8 | replace = require('gulp-replace'),
9 | rev = require("gulp-rev"),
10 | revColletor = require('gulp-rev-collector'),
11 | htmlmin = require('gulp-htmlmin');
12 |
13 | //check expression
14 | gulp.task('jshint', function() {
15 | return gulp.src('js/*.js')
16 | .pipe(jshint())
17 | .pipe(jshint.reporter('default'));
18 | });
19 |
20 | gulp.task('copy', function() {
21 | return gulp.src(['lib/**/*','fonts/**/*','img/**/*','js/**/*','inc/**/*.php','*.php'],{ base: '.' })
22 | .pipe(gulp.dest('dist'))
23 | });
24 |
25 | gulp.task('buildCSS', function() {
26 | return gulp.src('css/*.css')
27 | .pipe(minifycss())
28 | .pipe(rev())
29 | .pipe(gulp.dest('dist/css'))
30 | .pipe(rev.manifest())
31 | .pipe(gulp.dest('.'));
32 | });
33 |
34 | gulp.task('revReplace',function () {
35 | return gulp.src(['rev-manifest.json','dist/**/*.php'],{base:'dist'})
36 | .pipe(revColletor({
37 | replaceReved:true
38 | }))
39 | .pipe(gulp.dest('dist'));
40 | })
41 |
42 | gulp.task('htmlminify',function () {
43 | return gulp.src(['index.php','page.php', 'post.php', 'template-links.php'])
44 | .pipe(htmlmin({
45 | collapseWhitespace: true,
46 | removeComments: true,
47 | }))
48 | .pipe(gulp.dest('dist'));
49 | })
50 |
51 | gulp.task('htmlminify-inc',function () {
52 | return gulp.src(['inc/header.php', 'inc/footer.php', 'inc/sidebar.php'])
53 | .pipe(htmlmin({
54 | collapseWhitespace: true,
55 | removeComments: true,
56 | ignoreCustomFragments: [//, /<\/main>/, /<\?[\s\S]*?(?:\?>|$)/]
57 | }))
58 | .pipe(gulp.dest('dist/inc'));
59 | })
60 |
61 | gulp.task('clean', function() {
62 | return del('dist/*');
63 | });
64 |
65 | gulp.task('build', function() {
66 | // build into a new folder
67 | return runSequence(
68 | 'clean',
69 | ['copy','buildCSS','htmlminify', 'htmlminify-inc'],
70 | 'revReplace');
71 | });
72 |
--------------------------------------------------------------------------------
/inc/functions/extra.php:
--------------------------------------------------------------------------------
1 | fields as $key => $value) {
30 | if (strpos($key, 'link') !== false) {
31 | $suffix = substr($key, 4);
32 | $avatar = 'avatar'.$suffix;
33 | $name = 'name'.$suffix;
34 | if ($widget->fields->$avatar != NULL) {
35 | $avatarUrl = $widget->fields->$avatar;
36 | $linkUrl = $widget->fields->$key;
37 | $nameText = $widget->fields->$name;
38 | echo "
39 |
40 |
41 |
46 |
47 | ";
48 | }
49 | }
50 | }
51 | }
52 |
53 |
54 | //Maintain a version file when first run
55 | $version_file_dir = dirname(__FILE__).'/../../';
56 |
57 | if (!file_exists($version_file_dir . '.version')) {
58 | if (is_writable($version_file_dir)) {
59 | $file = fopen($version_file_dir . '.version', 'w+');
60 | fwrite($file, date('c'));
61 | fclose($file);
62 | } else {
63 | echo 'ERROR: Version File Not Writable! UpdateChecker Will NOT Work.
';
64 | }
65 | }
66 | unset($version_file_dir);
67 |
--------------------------------------------------------------------------------
/img/svg/zhihu_px.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/404.php:
--------------------------------------------------------------------------------
1 | need('inc/header.php');
4 | if ($this->options->langis == '0') {
5 | require_once(dirname(__FILE__) . '/inc/lang/en-us.php');
6 | } elseif ($this->options->langis == '1') {
7 | require_once(dirname(__FILE__) . '/inc/lang/zh-cn.php');
8 | } elseif ($this->options->langis == '2') {
9 | require_once(dirname(__FILE__) . '/inc/lang/zh-tw.php');
10 | }
11 | $MultiLang = new LangDict();
12 | ?>
13 |
14 |
15 |
16 | options->CDNUrl)): ?>
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
48 |
49 |
50 |
51 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/template-links.php:
--------------------------------------------------------------------------------
1 | need('inc/header.php'); ?>
11 |
12 |
13 | options->CDNUrl)): ?>
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
46 |
47 |
48 |
49 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/page.php:
--------------------------------------------------------------------------------
1 | need('inc/header.php');
4 | if ($this->options->langis == '0') {
5 | require_once(dirname(__FILE__) . '/inc/lang/en-us.php');
6 | } elseif ($this->options->langis == '1') {
7 | require_once(dirname(__FILE__) . '/inc/lang/zh-cn.php');
8 | } elseif ($this->options->langis == '2') {
9 | require_once(dirname(__FILE__) . '/inc/lang/zh-tw.php');
10 | }
11 | $MultiLang = new LangDict();
12 | ?>
13 |
14 |
15 |
16 | options->CDNUrl)): ?>
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
48 |
49 |
50 |
51 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/inc/functions/thumbNail.php:
--------------------------------------------------------------------------------
1 | widget('Widget_Options')->RandomPicAmnt)) {
11 | $RandPicAmnt = 27;
12 | } else {
13 | $RandPicAmnt = $widget->widget('Widget_Options')->RandomPicAmnt;
14 | }
15 | $rand = rand(1,$RandPicAmnt); //Random number
16 |
17 | if (!empty($widget->widget('Widget_Options')->CDNURL)) {
18 | $random = $widget->widget('Widget_Options')->CDNURL. '/MaterialCDN/img/random/material-' . $rand . '.png';
19 | } else {
20 | $random = $widget->widget('Widget_Options')->themeUrl . '/img/random/material-' . $rand . '.png';
21 | }//Random picture path
22 |
23 |
24 | // If only one random default picture, delete the following "//"
25 | //$random = $widget->widget('Widget_Options')->themeUrl . '/img/random.jpg';
26 |
27 | $cai = '';
28 | $attach = $widget->attachments(1)->attachment;
29 | $pattern = '/\]*>/i';
30 | $patternMD = '/\!\[.*?\]\((http(s)?:\/\/.*?(jpg|png))/i';
31 | $patternMDfoot = '/\[.*?\]:\s*(http(s)?:\/\/.*?(jpg|png))/i';
32 |
33 | if ($attach && $attach->isImage) {
34 | $ctu = $attach->url.$cai;
35 | } //调用第一个图片附件
36 | elseif (preg_match_all($pattern, $widget->content, $thumbUrl)) {
37 | //下面是调用文章第一个图片
38 | $ctu = $thumbUrl[1][0].$cai;
39 | }
40 | //如果是内联式markdown格式的图片
41 | elseif (preg_match_all($patternMD, $widget->content, $thumbUrl)) {
42 | $ctu = $thumbUrl[1][0].$cai;
43 | }
44 | //如果是脚注式markdown格式的图片
45 | elseif (preg_match_all($patternMDfoot, $widget->content, $thumbUrl)) {
46 | $ctu = $thumbUrl[1][0].$cai;
47 | }
48 | //以上都不符合,即随机输出图片
49 |
50 | else {
51 | $ctu = $random;
52 | }
53 | echo $ctu;
54 |
55 |
56 | // $attach = $widget->attachments(1)->attachment;
57 | // $pattern = '/\]*>/i';
58 |
59 | // if (preg_match_all($pattern, $widget->content, $thumbUrl)) {
60 | // echo $thumbUrl[1][0];
61 | // } elseif ($attach->isImage) {
62 | // echo $attach->url;
63 | // } else {
64 | // echo $random;
65 | // }
66 | }
67 |
68 | //Random thumbnail
69 | function randomThumbnail($widget)
70 | {
71 | //If article no include picture, display random default picture
72 | $rand = rand(1, $widget->widget('Widget_Options')->RandomPicAmnt); //Random number
73 |
74 | if (!empty($widget->widget('Widget_Options')->CDNURL)) {
75 | $random = $widget->widget('Widget_Options')->CDNURL. '/MaterialCDN/img/random/material-' . $rand . '.png';
76 | } else {
77 | $random = $widget->widget('Widget_Options')->themeUrl . '/img/random/material-' . $rand . '.png';
78 | }//Random picture path
79 |
80 | echo $random;
81 | }
--------------------------------------------------------------------------------
/img/fontcustom/fontcustom.css:
--------------------------------------------------------------------------------
1 | /*
2 | Icon Font: fontcustom
3 | */
4 |
5 | @font-face {
6 | font-family: "fontcustom";
7 | src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot");
8 | src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot?#iefix") format("embedded-opentype"),
9 | url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff2") format("woff2"),
10 | url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff") format("woff"),
11 | url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.ttf") format("truetype"),
12 | url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg#fontcustom") format("svg");
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
17 | @media screen and (-webkit-min-device-pixel-ratio:0) {
18 | @font-face {
19 | font-family: "fontcustom";
20 | src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg#fontcustom") format("svg");
21 | }
22 | }
23 |
24 | [data-icon]:before { content: attr(data-icon); }
25 |
26 | [data-icon]:before,
27 | .icon-cn_bilibili_b:before,
28 | .icon-facebook:before,
29 | .icon-facebook_1:before,
30 | .icon-facebook_4:before,
31 | .icon-facebook_6:before,
32 | .icon-facebook_9:before,
33 | .icon-github:before,
34 | .icon-linkedin:before,
35 | .icon-linkedin_4:before,
36 | .icon-niconico:before,
37 | .icon-post_gplus:before,
38 | .icon-steam:before,
39 | .icon-steam_1:before,
40 | .icon-telegram:before,
41 | .icon-twitter:before,
42 | .icon-twitter_10:before,
43 | .icon-twitter_14:before,
44 | .icon-twitter_15:before,
45 | .icon-youtube:before,
46 | .icon-zhihu_c:before,
47 | .icon-zhihu_px:before {
48 | display: inline-block;
49 | font-family: "fontcustom";
50 | font-style: normal;
51 | font-weight: normal;
52 | font-variant: normal;
53 | line-height: 1;
54 | text-decoration: inherit;
55 | text-rendering: optimizeLegibility;
56 | text-transform: none;
57 | -moz-osx-font-smoothing: grayscale;
58 | -webkit-font-smoothing: antialiased;
59 | font-smoothing: antialiased;
60 | }
61 |
62 | .icon-cn_bilibili_b:before { content: "\f100"; }
63 | .icon-facebook:before { content: "\f101"; }
64 | .icon-facebook_1:before { content: "\f102"; }
65 | .icon-facebook_4:before { content: "\f103"; }
66 | .icon-facebook_6:before { content: "\f10c"; }
67 | .icon-facebook_9:before { content: "\f10d"; }
68 | .icon-github:before { content: "\f104"; }
69 | .icon-linkedin:before { content: "\f10e"; }
70 | .icon-linkedin_4:before { content: "\f10f"; }
71 | .icon-niconico:before { content: "\f114"; }
72 | .icon-post_gplus:before { content: "\f105"; }
73 | .icon-steam:before { content: "\f110"; }
74 | .icon-steam_1:before { content: "\f111"; }
75 | .icon-telegram:before { content: "\f106"; }
76 | .icon-twitter:before { content: "\f107"; }
77 | .icon-twitter_10:before { content: "\f108"; }
78 | .icon-twitter_14:before { content: "\f112"; }
79 | .icon-twitter_15:before { content: "\f113"; }
80 | .icon-youtube:before { content: "\f109"; }
81 | .icon-zhihu_c:before { content: "\f10a"; }
82 | .icon-zhihu_px:before { content: "\f10b"; }
83 |
--------------------------------------------------------------------------------
/img/svg/cn_bilibili_b.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/inc/updateChecker.php:
--------------------------------------------------------------------------------
1 | assets[0]->browser_download_url;
17 | }
18 |
19 | function getFile () {
20 | global $theme_root;
21 | try {
22 | $fileurl = getLatestReleaseUrl();
23 | } catch (Exception $e) {
24 | echo $e->getMessage();
25 | }
26 | $output = fopen($theme_root . '/material.tar.gz', 'w');
27 | $ch = curl_init();
28 | curl_setopt($ch, CURLOPT_URL, $fileurl);
29 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
30 | curl_setopt($ch, CURLOPT_HEADER, 0);
31 | curl_setopt($ch, CURLOPT_USERAGENT, 'Material Update Checker/php-curl extension');
32 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
33 | $result = curl_exec($ch);
34 | fwrite($output, $result);
35 | fclose($output);
36 | }
37 |
38 | //Process Update Entry Point ***************<<<<<<<=====
39 | function update() {
40 | getFile();
41 | global $theme_root;
42 | if (!is_readable('material.tar.gz')) {
43 | return false;
44 | }
45 | $phar = new PharData('material.tar.gz');
46 | $phar->extractTo($theme_root,null,true);
47 | unlink($theme_root . '/material.tar.gz');
48 | updateVersion();
49 | return true;
50 | }
51 |
52 | function getLatestReleaseTime() {
53 | $ch = curl_init();
54 | curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/repos/manyang901/material/releases/latest');
55 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
56 | curl_setopt($ch, CURLOPT_HEADER, 0);
57 | curl_setopt($ch, CURLOPT_USERAGENT, 'Material Update Checker/php-curl extension');
58 | $result = curl_exec($ch);
59 |
60 | curl_close($ch);
61 | $result = json_decode($result);
62 | return $result->published_at;
63 | }
64 |
65 | //Check Update Entry Point ********<<<<<<<=======
66 | function checkUpdate() {
67 | global $version_file_path;
68 | $version_filename = $version_file_path;
69 | if (!is_readable($version_file_path)) {
70 | throw new Exception('Version File Not Readable!');
71 | }
72 | $f = fopen($version_filename, 'r');
73 | $version = fgets($f);
74 | if (strtotime($version) < strtotime(getLatestReleaseTime())) {
75 | return true;
76 | } else {
77 | return false;
78 | }
79 | }
80 |
81 | function updateVersion() {
82 | global $version_file_path;
83 | $version_filename = $version_file_path;
84 | if (!is_readable($version_file_path)) {
85 | throw new Exception('Version File Not Readable!');
86 | }
87 | $f = fopen($version_filename, 'w');
88 | fwrite($f, date('c'));
89 | fclose($f);
90 | }
91 |
92 |
93 | ?>
94 |
--------------------------------------------------------------------------------
/css/index.css:
--------------------------------------------------------------------------------
1 | /*
2 | * CSS only used in index.php
3 | *
4 | * top cards CSS
5 | * Post MD card optimizing CSS
6 | * Search CSS
7 | * |-- Container
8 | * |-- Animation
9 | *
10 | */
11 |
12 |
13 | /********* Top Cards CSS BEGIN *************/
14 | .main-pic {
15 | height: 360px;
16 | object-fit: cover;
17 | }
18 | .top-card {
19 | height: 360px;
20 | }
21 | .top-card > .mdui-card-actions {
22 | height: 64px;
23 | }
24 | .top-card > .mdui-card-actions > .main-logo-title {
25 | margin-left: 8px;
26 | font-size: 16px;
27 | }
28 | .main-logo {
29 | height: 200px !important;
30 | width: 200px !important;
31 | margin: 47.5px auto;
32 | border-radius: 50%;
33 | }
34 |
35 | /*********** Top Cards CSS END *************/
36 |
37 |
38 | .mdui-row > [class*="mdui-col-"] {
39 | padding-top: 4px;
40 | padding-bottom: 4px;
41 |
42 | }
43 |
44 | .index-post-card-media > picture > img {
45 |
46 | max-height: 250px;
47 | height: 250px;
48 | object-fit: cover;
49 | }
50 |
51 | .index-post-card-header-rightinfo {
52 | margin-top: 15px;
53 | padding: 1em;
54 | }
55 |
56 | .bottom > [class*="mdui-col-"] {
57 | padding-top: 0px;
58 | padding-bottom: 30px;
59 | }
60 |
61 |
62 | /********* Search Container CSS BEGIN **********/
63 |
64 | .main-search {
65 | display: none;
66 | z-index: 5002;
67 | position: fixed;
68 | height: 3rem;
69 | width: 100%;
70 | top: calc(50% - 1.5rem);
71 | left: 0;
72 | text-align: center;
73 | font-size: 18px;
74 | }
75 |
76 | .main-search .main-search-form-wrapper > .main-search-form {
77 | display: inline-block;
78 | }
79 |
80 | .main-search .main-search-form-wrapper > .main-search-form > input.text {
81 | height: 48px;
82 | padding: 0 2px;
83 | margin-right: 16px;
84 | border-width: 0;
85 | border-radius: 4px;
86 | text-overflow: hidden;
87 | font-size: 16px;
88 | }
89 |
90 | @media screen and (min-width: 1024px) {
91 | .main-search .main-search-form-wrapper > .main-search-form > input.text {
92 | width: 720px;
93 | }
94 | }
95 | .main-search .main-search-form-wrapper {
96 | display: inline-block;
97 | padding: 8px 12px;
98 | background-color: #424242;
99 | border-radius: 4px;
100 | }
101 |
102 | /************ Search Container CSS END **********/
103 |
104 |
105 | /*********** Animation CSS BEGIN **********/
106 | /*Swash IN*/
107 | .swashIn {
108 | -webkit-animation-name: swashIn;
109 | animation-name: swashIn;
110 | animation-duration: 0.5s;
111 | }
112 |
113 | @-webkit-keyframes swashIn {
114 | 0% {
115 | opacity: 0;
116 | -webkit-transform-origin: 50% 50%;
117 | transform-origin: 50% 50%;
118 | -webkit-transform: scale(0, 0);
119 | transform: scale(0, 0);
120 | }
121 |
122 | 100% {
123 | opacity: 1;
124 | -webkit-transform-origin: 50% 50%;
125 | transform-origin: 50% 50%;
126 | -webkit-transform: scale(1, 1);
127 | transform: scale(1, 1);
128 | }
129 | }
130 |
131 | @keyframes swashIn {
132 | 0% {
133 | opacity: 0;
134 | -webkit-transform-origin: 50% 50%;
135 | transform-origin: 50% 50%;
136 | -webkit-transform: scale(0, 0);
137 | transform: scale(0, 0);
138 | }
139 |
140 | 100% {
141 | opacity: 1;
142 | -webkit-transform-origin: 50% 50%;
143 | transform-origin: 50% 50%;
144 | -webkit-transform: scale(1, 1);
145 | transform: scale(1, 1);
146 | }
147 | }
148 |
149 | /*Expand*/
150 | .expand {
151 | animation-name: expand;
152 | animation-duration: 0.75s;
153 | }
154 |
155 | @keyframes expand {
156 | 0% {
157 | -webkit-transform: scale(0.05, 1);
158 | transform: scale(0.05, 1);
159 | }
160 |
161 | 100% {
162 | -webkit-transform-origin: 50% 50%;
163 | transform-origin: 50% 50%;
164 | -webkit-transform: scale(1, 1);
165 | transform: scale(1, 1);
166 | }
167 | }
--------------------------------------------------------------------------------
/functions.php:
--------------------------------------------------------------------------------
1 | --> for compatiblity
18 | function compressHtml($html_source) {
19 | $chunks = preg_split('/(.*?|.*?<\/nocompress>|||)/msi', $html_source, -1, PREG_SPLIT_DELIM_CAPTURE);
20 | $compress = '';
21 | foreach ($chunks as $c) {
22 | if (strtolower(substr($c, 0, 19)) == '') {
23 | $c = substr($c, 19, strlen($c) - 19 - 20);
24 | $compress .= $c;
25 | continue;
26 | } else if (strtolower(substr($c, 0, 12)) == '') {
27 | $c = substr($c, 12, strlen($c) - 12 - 13);
28 | $compress .= $c;
29 | continue;
30 | } else if (strtolower(substr($c, 0, 4)) == ' $char) {
44 | if ($char == '"' && $chars[$key + 1] != '\\' && !$is_apos) {
45 | $is_quot = !$is_quot;
46 | } else if ($char == '\'' && $chars[$key] != '\\' && !$is_quot) {
47 | $is_apos = !$is_apos;
48 | } else if ($char == '/' && $chars[$key + 1] == '/' && !$is_quot && !$is_apos) {
49 | $tmp = substr($tmp, 0, $key);
50 | break;
51 | }
52 | }
53 | }
54 | $c .= $tmp;
55 | }
56 | }
57 | $c = preg_replace('/[\\n\\r\\t]+/', ' ', $c);
58 | $c = preg_replace('/\\s{2,}/', ' ', $c);
59 | $c = preg_replace('/>\\s', '> <', $c);
60 | $c = preg_replace('/\\/\\*.*?\\*\\//i', '', $c);
61 | $c = preg_replace('//', '', $c);
62 | $compress .= $c;
63 | }
64 | return $compress;
65 | }
66 |
67 |
68 | /*
69 | * Get views amount
70 | */
71 | function getViewsStr($widget, $format = "{views} 次浏览") {
72 | $fields = $widget->fields;
73 | if (!empty($fields->views)) {
74 | $views = $fields->views;
75 | } else {
76 | $views = 0;
77 | $widget->setField('views', 'int', '0', $widget->cid);
78 | }
79 |
80 | //Increase $views counter
81 | if ($widget->is('single')) {
82 | $vieweds = Typecho_Cookie::get('extend_contents_views');
83 | if (empty($vieweds))
84 | $vieweds = array();
85 | else
86 | $vieweds = explode(',', $vieweds);
87 | if (!in_array($widget->cid, $vieweds)) {
88 | //Increase Int Field
89 | $widget->incrIntField('views', '1', $widget->cid);
90 | $vieweds[] = $widget->cid;
91 | $vieweds = implode(',', $vieweds);
92 | Typecho_Cookie::set("extend_contents_views", $vieweds);
93 | }
94 | }
95 | return str_replace("{views}", $views, $format);
96 | }
97 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # New Material
2 |
3 | > Embrace Material Design
4 |
5 | New Material 是一款遵循 Material Design 的 Typecho 主题
6 |
7 | 
8 | 
9 | 
10 | 
11 |
12 |
13 | 
14 |
15 | ## Contents 目录
16 |
17 |
18 |
19 | - [General 概括](#general-概括)
20 | - [Feature 特性](#feature-特性)
21 | - [Compatibility 兼容性](#compatibility-兼容性)
22 | - [Demo 演示](#demo-演示)
23 | - [Install 安装](#install-安装)
24 | - [Configure 配置](#configure-配置)
25 | - [Function Switch 功能开关](#function-switch-功能开关)
26 | - [ViewCount 无插件访客统计](#viewcount-无插件访客统计)
27 | - [IconURL Icon地址](#iconurl-icon地址)
28 | - [Template-Links 友链模板](#template-links-友链模板)
29 | - [Preview 预览](#preview-预览)
30 | - [Contributing 贡献](#contributing-贡献)
31 | - [License 许可证](#license-许可证)
32 |
33 |
34 |
35 | ## General 概括
36 |
37 | - Author 作者:Manyang901
38 | - Original Author 原作者:Viosey
39 | - Version 版本:2.10.1
40 | - [](https://gitter.im/material-theme/typecho?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
41 |
42 | ## Feature 特性
43 |
44 | - 遵循Google Material Design标准
45 | - 响应式设计,根据访问设备分辨率的不同显示不同的样式
46 | - 无JQuery,全部采用MDUI内置方法
47 | - Vanilla-Lazyload 首页缩略图“懒加载”
48 | - 全站 PJAX 无刷新技术
49 | - 压缩HTML,CSS 高速加载
50 | - 非插件实现访客数量统计,使用cookies验证,使用自定义字段储存计数器,不修改数据库,高解耦。
51 | - Update Checker 更新检查(实验性功能,谨慎使用!)
52 | - 友链模板
53 | - 自定义侧栏链接
54 |
55 | ## Compatibility 兼容性
56 | - PHP: 5.3+ ,仅在5.6和7.2上测试,建议使用PHP7.2
57 | - Database 数据库: MySQL, Sqlite3, Postgresql(只要有相应的pdo驱动)
58 | - Typecho: 1.0、1.1、1.1测试版(仅在typecho/master 分支上测试)
59 | - Browser Compatibility 浏览器兼容性: Chrome Desktop 49+ , Firefox 60+ , Safari 11.1+ , Chrome Android 67+ , Internet explorer 11(无lazyload无flexbox), Microsoft Edge 17+(无lazyload)
60 |
61 | ## Demo 演示
62 |
63 | [PolyQY Blog](https://kucloud.win)
64 |
65 | ## Install 安装
66 |
67 | - 在[Github Release](https://github.com/manyang901/material/releases)页面,点击"material.tar.gz"下载,解压后将文件夹改名为 "Material"(或其他) 后上传到 `/usr/themes`,并启用主题。2.1.0版本引入Travis CI自动压缩css后,不建议直接clone项目,推荐在release界面下载。
68 | - 下载最新文件 然后覆盖原文件即可更新主题, 部分新增加的功能需要到后台开启才会生效 (建议更新后先切换为其他主题, 再切换回该主题)。否则会导致新增设置项空白。
69 | - 修改主题目录权限,使PHP-FPM在目录有写权限,若启用Openbase_dir也需配置允许写入主题目录
70 | - 首页文章概览默认最大输出80个字符, 可手动添加截断符 `` 控制输出。
71 | - 若要使用Webp自适应图片,需要将解压出文件中serviceworker.js复制到网站的根目录(这是由于serviceworker作用范围的限制和typecho主题结构的特殊性),不使用则所有设备全部返回png格式的图片,注意,现有策略是全部替换请求中的.png为.webp,这意味着若png图没有对应的webp图像则会返回404
72 | - 若需使用PWA,请自行在网站根目录加入manifest.json文件,也可以在线生成
73 | - 请确保已经安装php-curl扩展,否则可能出错或无法收集错误信息,更新检测功能也不能使用(可能会导致严重问题),通常可以使用apt install php-curl等安装扩展
74 | - 可以在php交互模式下输入curl_init();以查看是否安装php-curl扩展
75 | - 更新检测并未加入任何容错和环境检查,请谨慎使用!
76 | - 友链模板需在管理独立页面中自定义字段设置
77 |
78 |
79 | ## Configure 配置
80 |
81 | ### Function Switch 功能开关
82 |
83 | - Lazyload
84 | - 首页两个欢迎图
85 | - 无插件访客统计
86 |
87 | #### ViewCount 无插件访客统计
88 | 勾选此选项即可开始使用,注意此选项关闭时不统计数据。
89 | 此访客统计不会影响数据库结构,Typecho原生备份可以正常使用。
90 |
91 | ### IconURL Icon地址
92 | 此项用于设置站点的图标,包括favicon、ios和windows桌面图标。
93 | 默认情况下主题会加载位于img/icon下的图标,设置该项后加载所设url内的/img/icon下的图标,例如:
94 | - 此项填入`https://www.google.com`
95 | - 主题将会加载`https://www.google.com/img/icon/`下的图标
96 | 注意!图标文件名必须与默认图标的文件名相同,否则不能加载。
97 |
98 | ### Template-Links 友链模板
99 | 需要在管理->独立页面中设置自定义字段,分为link, avatar和name
100 | 三者可以有任意共同后缀
101 | 比如
102 | - 'link_foo' => 'https://php.net'
103 | - 'avatar_foo' => 'somewhere'
104 | - 'name_foo' => 'PHP'
105 | 必须填写links和avatar, name可以空缺
106 |
107 | ## Preview 预览
108 |
109 | 
110 |
111 | 
112 |
113 | ## Contributing 贡献
114 |
115 | All kinds of contributions (enhancements, new features, documentation & code improvements, issues & bugs reporting) are welcome.Looking forward to you `Pull Request`
116 |
117 | Formatted code is required , code with comments is strongly recommended. Commit Message is required to be formatted as Angular .
118 |
119 | 欢迎各种形式的贡献,包括但不限于优化,添加功能,文档 & 代码的改进,问题和 bugs 的报告。期待您的 `Pull Request`。
120 |
121 | 对代码要求格式化,新增代码块要有注释。commit message要求按照Angular.js项目的格式填写。
122 |
123 |
124 | ## License 许可证
125 |
126 | Open sourced under the GPL-3.0 license.
127 |
128 | 根据 GPL-3.0 许可证开源。
129 |
--------------------------------------------------------------------------------
/inc/header.php:
--------------------------------------------------------------------------------
1 |
2 | options->langis == '0') {
3 | echo "lang=\"en\"";
4 | } elseif ($this->options->langis == '1') {
5 | echo "lang=\"zh-Hans\"";
6 | } elseif ($this->options->langis == '2') {
7 | echo "lang=\"zh-TW\"";
8 | } else {
9 | echo "lang=\"en\"";
10 | } ?> >
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | archiveTitle('', '', ' - '); ?>
21 | options->title(); ?>
22 |
23 |
24 |
25 |
26 | options->IconUrl)): ?>
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | header(); ?>
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
73 |
74 |
75 |
76 | options->switch) && in_array('ShowLoadingLine', $this->options->switch)): ?>
77 |
92 |
93 |
94 |
95 |
96 | options->BackgroundType =='0') : ?>
97 |
106 |
107 | options->BackgroundType == '1'): ?>
108 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/post.php:
--------------------------------------------------------------------------------
1 | need('inc/header.php');
4 | if ($this->options->langis == '0') {
5 | require_once(dirname(__FILE__) . '/inc/lang/en-us.php');
6 | } elseif ($this->options->langis == '1') {
7 | require_once(dirname(__FILE__) . '/inc/lang/zh-cn.php');
8 | } elseif ($this->options->langis == '2') {
9 | require_once(dirname(__FILE__) . '/inc/lang/zh-tw.php');
10 | }
11 | $MultiLang = new LangDict();
12 | ?>
13 |
14 |
15 | options->CDNUrl)): ?>
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
44 |
45 |
46 |
47 |
103 |
104 | need('inc/comments.php'); ?>
105 |
106 |
107 |
108 |
109 |
126 |
127 |
128 |
129 |
130 |
131 | options->FunctionSwitch)): ?>
132 |
133 |
134 |
--------------------------------------------------------------------------------
/inc/comments.php:
--------------------------------------------------------------------------------
1 | options->langis == '0') {
3 | require_once(dirname(__FILE__) . '/lang/en-us.php');
4 | } elseif ($this->options->langis == '1') {
5 | require_once(dirname(__FILE__) . '/lang/zh-cn.php');
6 | } elseif ($this->options->langis == '2') {
7 | require_once(dirname(__FILE__) . '/lang/zh-tw.php');
8 | }
9 | $MultiLang = new LangDict();
10 | ?>
11 |
12 |
13 |
14 | comments()->to($comments); ?>
15 | options->langis); ?>
16 |
17 |
18 | _levels > 0 ? ' comment-child' : ' comment-parent'; //评论层数大于0为子级,否则是父级
24 | ?>
25 |
26 |
90 |
91 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | allow('comment')): ?>
101 |
102 |
103 |
106 |
107 |
108 |
109 |
110 |
111 |
182 |
183 |
184 |
185 |
186 |
187 | pageNav('« 前一页', '后一页 »'); ?>
188 |
189 |
190 |
191 |
192 | comment
193 | 评论已关闭
194 |
195 |
196 |
--------------------------------------------------------------------------------
/inc/footer.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
98 |
99 |
100 | expand_less
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
113 |
114 |
115 |
116 |
120 |
121 |
122 |
123 |
124 |
125 |
128 |
129 |
130 |
131 |
132 | options->FunctionSwitch)): ?>
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
148 |
149 | options->FunctionSwitch)): ?>
150 |
151 |
152 |
156 |
157 |
158 | options->FunctionSwitch)): ?>
159 |
160 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
--------------------------------------------------------------------------------
/css/shared.css:
--------------------------------------------------------------------------------
1 | /*
2 | *Shared css for all pages
3 | *Including
4 | *
5 | * SideBar General
6 | * Footer
7 | *
8 | */
9 |
10 |
11 |
12 | /*Responsive CSS For Appbar*/
13 | /*hide Appbar on devices larger than 1024px*/
14 | @media screen and (min-width:1024px) {
15 |
16 | .header-responsive {
17 | display: none;
18 |
19 | }
20 |
21 | }
22 |
23 | @media screen and (max-width: 1024px) {
24 |
25 | .header-responsive {
26 | display: block;
27 | }
28 |
29 |
30 | }
31 | /*Responsive Appbar END*/
32 |
33 |
34 | /* Appbar Title Align to center*/
35 | .header-center-title {
36 | margin: 0 auto;
37 | }
38 |
39 | /******** Appbar Burger Icon ******/
40 | /*absolute postion*/
41 | .mdui-toolbar > .mdui-btn {
42 | position: absolute;
43 | }
44 |
45 |
46 |
47 |
48 | /*------------------------------------------------------*/
49 | /*------------------------------------------------------*/
50 | /*-------------------- SideBar CSS ---------------------*/
51 | /*------------------------------------------------------*/
52 | /* -----------------------------------------------------*/
53 |
54 |
55 |
56 | /* SideBar Responsive */
57 |
58 |
59 |
60 | @media screen and (max-width: 600px) {
61 |
62 | .drawer-mod {
63 | max-width: 240px !important;
64 | }
65 |
66 | .drawer-mod::-webkit-scrollbar {
67 | width: 0;
68 | height: 0;
69 |
70 | }
71 |
72 | .mdui-drawer .sidebar-header {
73 | position: relative;
74 | height: 140px;
75 | overflow: hidden;
76 | -webkit-transition: all 0.2s ease-in-out;
77 | -o-transition: all 0.2s ease-in-out;
78 | transition: all 0.2s ease-in-out;
79 | }
80 |
81 | }
82 |
83 |
84 |
85 | @media screen and (min-width: 600px) and (max-width: 1024px) {
86 |
87 | .drawer-mod {
88 | max-width: 240px !important;
89 | }
90 |
91 | .mdui-drawer .sidebar-header {
92 | position: relative;
93 | height: 140px;
94 | overflow: hidden;
95 | -webkit-transition: all 0.2s ease-in-out;
96 | -o-transition: all 0.2s ease-in-out;
97 | transition: all 0.2s ease-in-out;
98 | }
99 |
100 | }
101 |
102 | @media screen and (min-width: 1024px) {
103 |
104 | .drawer-mod {
105 | width: 288px !important;
106 | }
107 |
108 | body.mdui-drawer-body-left {
109 |
110 | padding-left: 288px !important;
111 |
112 | }
113 |
114 | .mdui-drawer .sidebar-header {
115 | position: relative;
116 | height: 157.5px;
117 | overflow: hidden;
118 | -webkit-transition: all 0.2s ease-in-out;
119 | -o-transition: all 0.2s ease-in-out;
120 | transition: all 0.2s ease-in-out;
121 | }
122 | }
123 |
124 | /*SideBar Overlay End*/
125 |
126 |
127 | /*Sidebar Header Begin*/
128 | .mdui-drawer .sidebar-header.header-cover {
129 | background-repeat: no-repeat;
130 | background-position: center center;
131 | -webkit-background-size: cover;
132 | -moz-background-size: cover;
133 | -o-background-size: cover;
134 | -ms-background-size:100%;
135 | background-size: cover;
136 | }
137 |
138 | .sidebar .sidebar-image img {
139 | width: 54px;
140 | height: 54px;
141 | margin: 40px 16px 16px 16px;
142 | border-radius: 50%;
143 | background-color: rgba(255, 255, 255, .2);
144 | -webkit-transition: all 0.2s ease-in-out;
145 | -o-transition: all 0.2s ease-in-out;
146 | transition: all 0.2s ease-in-out;
147 | }
148 |
149 | @media screen and (max-width: 1024px) {
150 |
151 | .sidebar .sidebar-title {
152 | max-height: 94px;
153 | }
154 |
155 | }
156 |
157 | .sidebar .sidebar-title {
158 | max-width: 10.8rem;
159 | text-decoration: none;
160 | white-space: normal;
161 | word-break: break-all;
162 | word-wrap: break-word;
163 | display: block;
164 | font-size: 1.6rem;
165 | margin-top: 1.5rem;
166 | }
167 |
168 | /*Sidebar Header End*/
169 |
170 |
171 | /*******SideBar Dropdown Arrow Layout ********/
172 |
173 | /*Sidebar Dropdown Arrow Padding*/
174 | @media screen and (max-width: 600px) {
175 | .sidebar .sidebar-brand {
176 | padding-left: 200px;
177 |
178 | }
179 |
180 | }
181 |
182 | @media screen and (min-width: 600px) and (max-width: 1024px) {
183 |
184 | .sidebar .sidebar-brand {
185 | padding-left: 200px;
186 | }
187 | }
188 |
189 | @media screen and (min-width: 1024px) {
190 | .sidebar .sidebar-brand {
191 | padding-left: 225px;
192 |
193 | }
194 |
195 | }
196 | /*Padding End*/
197 |
198 |
199 | .sidebar .sidebar-brand {
200 | position: absolute;
201 | bottom: 0;
202 | left: 0;
203 | right: 0;
204 | display: block;
205 | height: 48px;
206 | line-height: 48px;
207 | text-decoration: none;
208 | clear: both;
209 | overflow: hidden;
210 | -o-text-overflow: ellipsis;
211 | text-overflow: ellipsis;
212 | white-space: nowrap;
213 | -webkit-transition: all 0.2s ease-in-out;
214 | -o-transition: all 0.2s ease-in-out;
215 | transition: all 0.2s ease-in-out;
216 | }
217 |
218 | .sidebar .sidebar-brand:hover,
219 | .sidebar .sidebar-brand:focus {
220 | -webkit-box-shadow: none;
221 | box-shadow: none;
222 | outline: none;
223 | }
224 |
225 |
226 | .sidebar .sidebar-brand:hover,
227 | .sidebar .sidebar-brand:focus {
228 | text-decoration: none;
229 | }
230 |
231 | /*Sidebar Dropdown Arrow Layout End*/
232 |
233 |
234 | .sidebar .mdui-list .mdui-list-item > a {
235 | display: inline-block;
236 | width: 100%;
237 | }
238 |
239 | /************* Sidebar Font Size & List Height Mod **************/
240 | .mdui-list .mdui-list-item:after {
241 | height: 2.75rem !important;
242 | }
243 |
244 | .mdui-list .mdui-list-item {
245 | font-size: 0.8rem;
246 | }
247 |
248 | /************* Mod END ***************/
249 |
250 |
251 |
252 | /********************************************************************/
253 | /************************* **********************/
254 | /************************* Sidebar CSS END **********************/
255 | /************************* **********************/
256 | /********************************************************************/
257 |
258 |
259 |
260 | /********************************************************************/
261 | /************************* **********************/
262 | /************************* Footer CSS BEGIN **********************/
263 | /************************* **********************/
264 | /********************************************************************/
265 |
266 | /* Round Button*/
267 | .round-btn {
268 | border-radius: 18px !important;
269 | }
270 |
271 |
272 | /* Footer Sticky BEGIN */
273 |
274 | body {
275 | display: box;
276 | display: -webkit-box;
277 | display: -webkit-flex;
278 | display: -moz-flex;
279 | display: -ms-flexbox;
280 | display: flex;
281 |
282 | -webkit-flex-direction: column;
283 | -moz-flex-direction: column;
284 | -ms-flex-direction: column;
285 | -o-flex-direction: column;
286 | flex-direction: column;
287 | min-height: 100vh;
288 | }
289 |
290 | main {
291 | -webkit-box-flex: 1;
292 | -moz-box-flex: 1;
293 | -webkit-flex: 1;
294 | -ms-flex: 1;
295 | flex: 1;
296 | }
297 |
298 |
299 | /*Sticky Footer END */
300 |
301 |
302 |
303 | /*Footer MDUI row Padding*/
304 |
305 | .bottom {
306 | padding-top: 40px;
307 | padding-bottom: 10px;
308 | }
309 |
310 | .copyright {
311 | padding-bottom: 20px;
312 | }
313 |
314 | /***** Inherit Bottom part of page & post *******/
315 |
316 | @media screen and (max-width: 1024px) {
317 | .bottom-mod {
318 | /*Cover mdui default*/
319 | margin-right: unset !important;
320 | margin-left: unset !important;
321 | bottom: 0;
322 | right: 0;
323 | }
324 | }
325 |
326 | @media screen and (min-width: 1024px) {
327 | .bottom-mod {
328 | /*cover mdui default*/
329 | margin-right: unset !important;
330 | margin-left: unset !important;
331 | bottom: 0;
332 | right: 0;
333 | }
334 | }
335 |
336 |
337 | /*Footer SNS herf no underline */
338 | .footer-sns {
339 | margin-top: 1rem;
340 | }
341 |
342 | .footer-sns > a {
343 | text-decoration: none;
344 | margin-left: 5px;
345 | margin-right: 5px;
346 | }
347 |
348 | /********************************************************************/
349 | /************************* **********************/
350 | /************************* Footer CSS END **********************/
351 | /************************* **********************/
352 | /********************************************************************/
353 |
354 |
355 | /*Comment List No Margin*/
356 | .comment .comment-list {
357 | margin: 0;
358 | -webkit-padding-start: 0px;
359 | }
360 |
361 | .comments > .comment-list {
362 | margin: 0;
363 | padding-bottom: 50px;
364 | -webkit-padding-start: 0px;
365 | }
366 |
--------------------------------------------------------------------------------
/inc/functions/themeOptions.php:
--------------------------------------------------------------------------------
1 |
8 |
9 | 感谢您使用 Material 主题
10 |
11 |
12 | 请关注
13 |
14 | Github-Material
15 |
16 | 以获得
17 |
18 | 最新版本支持
19 |
20 |
21 |
22 | 帮助&支持
23 |
24 |
25 |
26 | 建议&反馈
27 |
28 |
';
29 |
30 | //Using poor method to get theme_root url
31 | //Then provide a entrypoint towards update.php
32 | $pageScheme = 'http';
33 | if (isset($_SERVER['HTTPS']) and ($_SERVER['HTTPS'] == 'on')) {
34 | $pageScheme .= 's';
35 | }
36 | $pageScheme .='://';
37 |
38 | $theme_path = strchr(strchr(dirname(__FILE__), 'usr/themes/'), 'inc/functions', true);
39 |
40 | $theme_root = $pageScheme.$_SERVER['HTTP_HOST'].'/'.$theme_path;
41 | //echo $theme_root;
42 | echo '' . '
43 | 检测更新 Check Update (实验性的 Experimental)
44 | ';
45 |
46 |
47 | $FunctionSwitch = new Typecho_Widget_Helper_Form_Element_Checkbox('FunctionSwitch',
48 | array(
49 | 'LazyLoad' => _t('LazyLoad'),
50 | 'ViewCount' => _t('无插件访客统计'),
51 | 'ShowMainPic' => _t('显示主页的欢迎图'),
52 | 'DarkTheme' => _t('暗色主题'),
53 | 'ScrollTop' => _t('回到顶部按钮'),
54 | 'PJAX' => _t('PJAX无刷新加载')
55 | ),
56 |
57 | //Default choose
58 | array('LazyLoad', 'ViewCount'), _t('功能开关')
59 | );
60 | $form->addInput($FunctionSwitch->multiMode());
61 |
62 | $FoundDate = new Typecho_Widget_Helper_Form_Element_Text('FoundDate', null, null, _t('博客建立日期'), _t('格式为yyyy-mm-dd,如1980-06-01'));
63 | $form->addInput($FoundDate);
64 |
65 | $IconUrl = new Typecho_Widget_Helper_Form_Element_Text('IconUrl', null, null, _t('Icon 目录地址'), _t('填入博客所有icon 的地址,必须包含目录img/icon并且有相应的png文件, 默认显示主题目录下img/icon中的图标'));
66 | $form->addInput($IconUrl);
67 |
68 | $CDNUrl = new Typecho_Widget_Helper_Form_Element_Text('CDNUrl', null, null, _t('静态资源 CDN 地址'), _t("
69 | 新建一个'MaterialCDN' 文件夹, 把'css, fonts, img, js' 文件夹放进去, 然后把'MaterialCDN' 上传到到你的 CDN 储存空间根目录下
70 | 填入你的 CDN 地址, 支持OSS存储桶,如 http://bucket.b0.upaiyun.com"));
71 | $form->addInput($CDNUrl);
72 |
73 | $ThemeColor = new Typecho_Widget_Helper_Form_Element_Text('ThemeColor', null, _t('blue-grey'), _t('主题颜色'), _t('填入md颜色类别(如indigo),可选主题色参见https://www.mdui.org/docs/color'));
74 | $form->addInput($ThemeColor);
75 |
76 | $AccentColor = new Typecho_Widget_Helper_Form_Element_Text('AccentColor', null, _t('pink'), _t('主题强调色'), _t('填入md颜色类别(如indigo),可选主题色参见https://www.mdui.org/docs/color'));
77 | $form->addInput($AccentColor);
78 |
79 | $ChromeThemeColor = new Typecho_Widget_Helper_Form_Element_Text('ChromeThemeColor', null, _t('#607D8B'), _t('Android Chrome 地址栏颜色'), null);
80 | $form->addInput($ChromeThemeColor);
81 |
82 | $langis = new Typecho_Widget_Helper_Form_Element_Radio('langis',
83 | array(
84 | '0' => _t('English
'),
85 | '1' => _t('简体中文
'),
86 | '2' => _t('繁体中文
')
87 | ),
88 | '1', _t('界面语言设置'), _t("默认使用简体中文")
89 | );
90 | $form->addInput($langis);
91 |
92 | $CustomFonts = new Typecho_Widget_Helper_Form_Element_Text('CustomFonts', null, _t("Roboto, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif"), _t('自定义字体'), null);
93 | $form->addInput($CustomFonts);
94 |
95 | $BackgroundType = new Typecho_Widget_Helper_Form_Element_Radio('BackgroundType',
96 | array(
97 | '0' => _t('纯色背景 '),
98 | '1' => _t('图片背景 ')
99 | ),
100 |
101 | //Default choose
102 | '0', _t('背景设置'), _t("选择背景方案, 对应填写下方的 '背景颜色 / 图片', 这里默认使用纯色背景.")
103 | );
104 | $form->addInput($BackgroundType);
105 |
106 |
107 | $BgContent = new Typecho_Widget_Helper_Form_Element_Text('BgContent', null, null, _t('背景颜色 / 图片'), _t('背景设置如果选择纯色背景, 这里就填写颜色代码;
背景设置如果选择图片背景, 这里就填写图片地址;
108 | 不填写则默认显示 #F5F5F5 或主题文件夹下的 /img/Background.jpg'));
109 | $form->addInput($BgContent);
110 |
111 | $avatarURL = new Typecho_Widget_Helper_Form_Element_Text('avatarURL', null, null, '个人头像地址', '填入头像的地址, 如不填写则使用默认头像');
112 | $form->addInput($avatarURL);
113 |
114 | $MainPic = new Typecho_Widget_Helper_Form_Element_Text('MainPic', null, null, _t('首页顶部左边的图片地址'), _t('填入主页最大的图片地址, 图片显示在首页顶部左边位置'));
115 | $form->addInput($MainPic);
116 |
117 | $Logo = new Typecho_Widget_Helper_Form_Element_Text('Logo', null, null, _t('首页顶部右边 LOGO 图片地址'), _t('填入 LOGO 地址, 图片将显示于首页右上角板块'));
118 | $form->addInput($Logo);
119 |
120 | $MainPicHref = new Typecho_Widget_Helper_Form_Element_Text('MainPicHref', null, _t('#'), _t('首页顶部左边图片的点击跳转地址'), _t('点击首页大图后, 想要跳转网页的地址'));
121 | $form->addInput($MainPicHref);
122 |
123 | $LogoHref = new Typecho_Widget_Helper_Form_Element_Text('LogoHref', null, _t('#'), _t('首页顶部右边 LOGO 的点击跳转地址'), _t('点击 LOGO 后, 想要跳转网页的地址'));
124 | $form->addInput($LogoHref);
125 |
126 | $slogan = new Typecho_Widget_Helper_Form_Element_Text('slogan', null, _t('Nice to meet you'), _t('首页顶部左边的标语'), _t('填入自定义文字, 显示于首页顶部左边的图片上'));
127 | $form->addInput($slogan);
128 |
129 | $customUrl = new Typecho_Widget_Helper_Form_Element_Text('customUrl', null, _t('{"Status":"/status.php", "Baidu":"https://baidu.com"}'), _t('侧边栏链接列表(JSON)'), _t('填入自定义链接显示在侧边栏'));
130 | $form->addInput($customUrl);
131 |
132 | $ThumbnailOption = new Typecho_Widget_Helper_Form_Element_Radio('ThumbnailOption',
133 | array(
134 | '1' => _t('显示文章内第一张图片 (若无图片则显示随机图片)
'),
135 | '2' => _t('只显示纯色 '),
136 | '3' => _t('只显示随机图片')
137 | ),
138 |
139 | //Default choose
140 | '1', _t('缩略图显示效果')
141 | );
142 | $form->addInput($ThumbnailOption);
143 |
144 | $RandomPicAmnt = new Typecho_Widget_Helper_Form_Element_Text('RandomPicAmnt', null, _t('27'), _t('随机缩略图数量'), _t('img/random 图片的数量'));
145 | $form->addInput($RandomPicAmnt);
146 |
147 | $footersns = new Typecho_Widget_Helper_Form_Element_Checkbox('footersns',
148 | array(
149 | 'ShowTwitter' => _t('Twitter'),
150 | 'ShowFacebook' => _t('Facebook'),
151 | 'ShowGithub' => _t('Github'),
152 | 'ShowTelegram' => _t('Telegram'),
153 | 'ShowLinkedin' => _t('Linkedin'),
154 | 'ShowSteam' => _t('Steam'),
155 | 'ShowNiconico' => _t('Niconico'),
156 | 'ShowYoutube' => _t('Youtube')
157 | ),
158 |
159 | array('ShowTwitter','ShowFacebook','ShowGithub'), _t('页脚 SNS 图标按钮显示设置'), _t('开启后, 按钮显示于博客页脚位置')
160 | );
161 | $form->addInput($footersns);
162 |
163 | $TwitterURL = new Typecho_Widget_Helper_Form_Element_Text('TwitterURL', null, null, _t('Twitter 地址'), null);
164 | $form->addInput($TwitterURL);
165 |
166 | $FacebookURL = new Typecho_Widget_Helper_Form_Element_Text('FacebookURL', null, null, _t('Facebook 地址'), null);
167 | $form->addInput($FacebookURL);
168 |
169 | $GithubURL = new Typecho_Widget_Helper_Form_Element_Text('GithubURL', null, null, _t('Github 地址'), null);
170 | $form->addInput($GithubURL);
171 |
172 | $TelegramURL = new Typecho_Widget_Helper_Form_Element_Text('TelegramURL', null, null, _t('Telegram 地址'), null);
173 | $form->addInput($TelegramURL);
174 |
175 | $LinkedinURL = new Typecho_Widget_Helper_Form_Element_Text('LinkedinURL', null, null, _t('Linkedin 地址'), null);
176 | $form->addInput($LinkedinURL);
177 |
178 | $NiconicoURL = new Typecho_Widget_Helper_Form_Element_Text('NiconicoURL', null, null, _t('Niconico 地址'), null);
179 | $form->addInput($NiconicoURL);
180 |
181 | $SteamURL = new Typecho_Widget_Helper_Form_Element_Text('SteamURL', null, null, _t('Steam 地址'), null);
182 | $form->addInput($SteamURL);
183 |
184 | $YoutubeURL = new Typecho_Widget_Helper_Form_Element_Text('YoutubeURL', null, null, _t('Youtube 地址'), null);
185 | $form->addInput($YoutubeURL);
186 |
187 | $analysis = new Typecho_Widget_Helper_Form_Element_Textarea('analysis', null, null, _t('网站统计代码和自定义页脚'), _t('填入如 Google Analysis 等的第三方统计代码'));
188 | $form->addInput($analysis);
189 |
190 |
191 | }
192 |
--------------------------------------------------------------------------------
/inc/sidebar.php:
--------------------------------------------------------------------------------
1 | options->langis == '0') {
3 | require_once(dirname(__FILE__) . '/lang/en-us.php');
4 | } elseif ($this->options->langis == '1') {
5 | require_once(dirname(__FILE__) . '/lang/zh-cn.php');
6 | } elseif ($this->options->langis == '2') {
7 | require_once(dirname(__FILE__) . '/lang/zh-tw.php');
8 | }
9 | $MultiLang = new LangDict();
10 | ?>
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | need('inc/header.php');
15 | //Include Language Dictionary
16 | if ($this->options->langis == '0') {
17 | require_once(dirname(__FILE__) . '/inc/lang/en-us.php');
18 | } elseif ($this->options->langis == '1') {
19 | require_once(dirname(__FILE__) . '/inc/lang/zh-cn.php');
20 | } elseif ($this->options->langis == '2') {
21 | require_once(dirname(__FILE__) . '/inc/lang/zh-tw.php');
22 | }
23 | $MultiLang = new LangDict();
24 | ?>
25 |
26 |
27 | options->CDNUrl)): ?>
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
63 |
64 |
65 |
66 |
67 |
68 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 | next()): ?>
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 | options->ThumbnailOption == '1'): ?>
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
204 |
205 |
206 |
207 |
208 |
209 | options->ThumbnailOption == '2'): ?>
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
224 |
225 |
226 |
227 |
228 |
229 | options->ThumbnailOption == '3'): ?>
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 | excerpt(80, '...'); ?>
258 |
259 |
260 |
261 |
262 | get('Continue Reading'); ?>
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
296 |
297 |
298 |
299 |
300 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
359 |
360 |
361 |
362 |
363 | need('inc/sidebar.php'); ?>
364 | need('inc/footer.php'); ?>
365 |
366 |
367 |
--------------------------------------------------------------------------------
/img/fontcustom/fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
157 |
--------------------------------------------------------------------------------
/img/svg/niconico.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------