├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ └── main.yml ├── .gitignore ├── .jshintrc ├── .postcssrc.js ├── .prettierrc.js ├── 404.php ├── README.md ├── README_CN.md ├── archive.php ├── build ├── css │ ├── app.min.css │ └── setting.min.css ├── fonts │ ├── OpenSans-Bold.woff │ ├── OpenSans-Bold.woff2 │ ├── OpenSans-Light.woff │ ├── OpenSans-Light.woff2 │ ├── OpenSans-Medium.woff │ ├── OpenSans-Medium.woff2 │ ├── OpenSans-Regular.woff │ └── OpenSans-Regular.woff2 ├── images │ └── favicon.png └── js │ ├── app.min.js │ └── setting.min.js ├── category.php ├── comments.php ├── fonts ├── OpenSans-Bold.woff ├── OpenSans-Bold.woff2 ├── OpenSans-Light.woff ├── OpenSans-Light.woff2 ├── OpenSans-Medium.woff ├── OpenSans-Medium.woff2 ├── OpenSans-Regular.woff └── OpenSans-Regular.woff2 ├── footer.php ├── functions.php ├── gulpfile.js ├── header.php ├── images └── favicon.png ├── inc ├── base.php ├── comment.php ├── setting.php └── setup.php ├── index.php ├── languages ├── berry.pot ├── zh_CN.mo └── zh_CN.po ├── package.json ├── page.php ├── screenshot.png ├── scss ├── app.scss ├── modules │ ├── _basic.scss │ ├── _comment.scss │ ├── _footer.scss │ ├── _grap.scss │ ├── _header.scss │ ├── _normalize.scss │ └── _variable.scss ├── setting.scss └── templates │ ├── _map.scss │ ├── _single.scss │ └── _term.scss ├── single.php ├── style.css ├── template-part ├── post-navigation.php ├── post │ ├── content-card.php │ ├── content-status.php │ └── content.php └── single-related.php ├── tpl ├── page-map.php ├── template-archive.php ├── template-links.php └── template-terms.php └── ts ├── app.ts ├── extensions ├── help.ts └── zoom.ts ├── modules ├── action.ts ├── comment.ts ├── date.ts ├── posts.ts └── scroll.ts └── setting.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue,scss,json}] 2 | indent_style = space 3 | indent_size = 4 4 | end_of_line = lf 5 | trim_trailing_whitespace = true 6 | insert_final_newline = true 7 | max_line_length = 100 8 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [bigfa] -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Bigfa 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | tags: 8 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 9 | 10 | jobs: 11 | build-deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Notify theme updates 15 | run: | 16 | curl --fail --request GET --header "Authorization: Bearer $SIGN" --url "https://farallon.4398929.workers.dev/update?theme=berry&version=${{ github.ref }}" 17 | env: 18 | SIGN: ${{ secrets.SIGN }} 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esversion": 9, 3 | "maxerr": 50, 4 | "camelcase": false, 5 | "latedef": false 6 | } -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | }; -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | semi: true 4 | } -------------------------------------------------------------------------------- /404.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 404 5 |
6 | 7 |
8 | 'post', 11 | 'orderby' => 'rand', 12 | 'ignore_sticky_posts' => true, 13 | 'posts_per_page' => 6, 14 | )); 15 | while ($the_query->have_posts()) : $the_query->the_post(); ?> 16 | 17 | 19 |
20 |
21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Wordpress Theme Berry 2 | 3 | ![](https://static.fatesinger.com/2025/04/mv8cmjgi7mczjkoc.png) 4 | 5 | ## Changelog 6 | 7 | ### 2.0.8 8 | 9 | - style inhancement 10 | 11 | ### 2.0.7 12 | 13 | - style inhancement 14 | 15 | ### 2.0.6 16 | 17 | - fixed social icons link errro 18 | 19 | ### 2.0.5 20 | 21 | - update translation 22 | 23 | ### 2.0.4 24 | 25 | - add settings 26 | - add map template 27 | 28 | ### 2.0.3 29 | 30 | - add search 31 | - add sns icons 32 | 33 | ### 2.0.2 34 | 35 | - add home image post count 36 | - add post tag icon 37 | - add author card 38 | - add post navigation 39 | 40 | ### 2.0.1 41 | 42 | - update translation 43 | - add blogroll template 44 | - add category list template 45 | 46 | ### 2.0.0 47 | 48 | - redesign 49 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # Wordpress 主题 Berry 2 | 3 | ![](https://static.fatesinger.com/2025/04/mv8cmjgi7mczjkoc.png) 4 | 5 | ## 更新日志 6 | 7 | ### 2.0.8 8 | 9 | - 样式改进 10 | 11 | ### 2.0.7 12 | 13 | - 样式改进 14 | 15 | ### 2.0.6 16 | 17 | - 修复图标链接错误 18 | 19 | ### 2.0.5 20 | 21 | - 更新翻译 22 | 23 | ### 2.0.4 24 | 25 | - 增加设置选项 26 | - 增加地图页面 27 | 28 | ### 2.0.3 29 | 30 | - 增加搜索 31 | - 增加社交网络图标 32 | 33 | ### 2.0.2 34 | 35 | - 增加首页文章数量 36 | - 增加文章标签图标 37 | - 增加文章作者信息 38 | - 增加文章导航 39 | 40 | ### 2.0.1 41 | 42 | - 更新翻译 43 | - 增加友情链接页面 44 | - 增加分类列表页面 45 | 46 | ### 2.0.0 47 | 48 | - 重制 49 | -------------------------------------------------------------------------------- /archive.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | ', ''); 6 | the_archive_description('
', '
'); 7 | ?> 8 |
9 | 10 | 11 | 12 |
13 | __('Prev page', 'Berry'), 15 | 'next_text' => __('Next page', 'Berry'), 16 | 'prev_next' => false, 17 | 'before_page_number' => '', 18 | )); ?> 19 |
20 |
21 | -------------------------------------------------------------------------------- /build/css/setting.min.css: -------------------------------------------------------------------------------- 1 | .dashicons-basic:before{content:""}.dashicons-slider:before{content:""}.dashicons-feature:before{content:""}.dashicons-interface:before{content:""}.dashicons-social-contact:before{content:""}.dashicons-save:before{content:""}a:focus{box-shadow:none}.pure-wrap{display:flex;align-items:flex-start}.pure-help-li{font-size:16px;padding:30px;border-bottom:1px dotted #eee}.pure-help-li span{text-decoration:none}.pure-help-title{font-size:24px;font-weight:300;color:#626773}#pure-form{padding:30px;min-height:400px;background:#fff;border-radius:5px;overflow:hidden;flex:1 1 auto}.leftpanel .nav{margin:0;padding:50px 0 0;display:flex;flex-direction:column}.leftpanel .nav li{font-size:16px;margin-bottom:0;position:relative}.leftpanel .nav li>span{color:#626773;border-radius:0;transition:all .2s ease-out 0s;padding:15px 25px;display:block;cursor:pointer}.leftpanel .nav li>span i{width:16px;margin-right:5px;color:#626773;font-size:15px;top:1px;text-align:center}.leftpanel .nav li.active span{background-color:#fff;border-radius:5px 0 0 5px;color:#455473}.pure-setting-radio{display:inline-block;cursor:pointer;margin-right:20px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pure-setting-radio .dashicons-before{width:18px;height:18px;border:1px solid #d3cfc8;border-radius:50%;vertical-align:middle;display:inline-block;margin-right:5px;position:relative}.pure-setting-radio.checked .dashicons-before:before{content:"";background-color:#0074a2;color:#fff;border-radius:50%;top:-1px;left:-1px;text-indent:-1px;position:absolute;animation:a .3s linear 1}.form-table th{width:140px;padding:0}.form-table td{padding:0 0 40px}.form-table tr td label,.form-table tr th label{color:#455473;font-weight:400;font-size:16px}input.large-text,textarea.large-text{width:100%}textarea.code{line-height:1.4;padding:2%}.pure-setting-switch{display:inline-block;height:18px;width:42px;border:1px solid #cfd6e5;border-radius:9px;background:#fff;position:relative}.pure-setting-switch i{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:12px;border:1px solid #cfd6e5;transition:all .3s ease-out;animation:a .4s linear 1}.pure-setting-switch.active i{left:26px}.pure-setting-switch.active i:after{content:"";position:absolute;width:12px;height:12px;border-radius:12px;border:1px solid #0074a2;background-color:#0074a2;left:-1px;top:-1px;animation:a .4s linear 1}@keyframes a{0%{transform:scale(0)}80%{transform:scale(1.2)}to{transform:scale(1)}}.pure-save{padding-top:60px;display:flex;align-items:center}.button--save{color:#fff;background-color:#737f99;padding:10px 20px;text-decoration:none;line-height:1.4;text-align:center;font-size:16px;cursor:pointer;transition:all .3s linear;border-radius:3px}.button--save:hover{background:#455473}.pure-docs{display:flex;padding-bottom:10px;align-items:center} -------------------------------------------------------------------------------- /build/fonts/OpenSans-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Bold.woff -------------------------------------------------------------------------------- /build/fonts/OpenSans-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Bold.woff2 -------------------------------------------------------------------------------- /build/fonts/OpenSans-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Light.woff -------------------------------------------------------------------------------- /build/fonts/OpenSans-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Light.woff2 -------------------------------------------------------------------------------- /build/fonts/OpenSans-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Medium.woff -------------------------------------------------------------------------------- /build/fonts/OpenSans-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Medium.woff2 -------------------------------------------------------------------------------- /build/fonts/OpenSans-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Regular.woff -------------------------------------------------------------------------------- /build/fonts/OpenSans-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/fonts/OpenSans-Regular.woff2 -------------------------------------------------------------------------------- /build/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/build/images/favicon.png -------------------------------------------------------------------------------- /build/js/setting.min.js: -------------------------------------------------------------------------------- 1 | var _a,_b;document.querySelectorAll(".leftpanel li").forEach(function(t,n){t.addEventListener("click",function(e){document.querySelectorAll(".leftpanel li").forEach(function(e){e.classList.remove("active")}),t.classList.add("active"),document.querySelectorAll(".div-tab").forEach(function(e){e.classList.add("hidden")}),document.querySelectorAll(".div-tab")[n].classList.remove("hidden")})}),null!=(_a=document.querySelector("#upload-categoryCover"))&&_a.addEventListener("click",function(e){e.preventDefault();var n=wp.media({title:obvInit.upload_title,multiple:!1,button:{text:obvInit.upload_button}}).open().on("select",function(){var e,t=n.state().get("selection").first().toJSON().url;null!=(e=document.querySelector("#_category_cover"))&&e.setAttribute("value",t)})}),null!=(_b=document.querySelector("#pure-save"))&&_b.addEventListener("click",function(e){e.preventDefault();e=document.querySelector("#pure-form"),e=new FormData(e),e=new URLSearchParams(e);jQuery.ajax({url:obvInit.ajaxurl,data:e+"&action=berry_setting",type:"POST",success:function(){var e='

'.concat(obvInit.success_message,'

');jQuery(".pure-wrap").before(e),window.scrollTo(0,0)}})}),(n=>{n(document).on("click","#berry-settings_updated .notice-dismiss",function(){n("#berry-settings_updated").remove()}),n(".pure-setting-switch").click(function(){var e=n(this),t=n("#"+e.attr("data-id"));e.hasClass("active")?(e.removeClass("active"),t.val(0)):(e.addClass("active"),t.val(1)),t.change()})})(jQuery); -------------------------------------------------------------------------------- /category.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | <?php single_term_title('', true); ?> 6 | 7 |
8 |

9 | ', '
'); ?> 10 | 11 |
12 | 13 | 14 | 15 |
16 | __('Prev page', 'Berry'), 18 | 'next_text' => __('Next page', 'Berry'), 19 | 'prev_next' => false, 20 | 'before_page_number' => '', 21 | )); ?> 22 |
23 |
24 | -------------------------------------------------------------------------------- /comments.php: -------------------------------------------------------------------------------- 1 | 5 |
6 | 7 |

8 | 9 |

10 | 11 |
    12 | 'ol', 15 | 'short_ping' => true, 16 | 'reply_text' => __('Reply', 'Berry'), 17 | 'avatar_size' => 42, 18 | 'format' => 'html5' 19 | )); 20 | ?> 21 |
22 | __('Prev', 'Berry'), 24 | 'next_text' => __('Next', 'Berry'), 25 | 'prev_next' => false, 26 | )); ?> 27 | 28 |
    29 |
  1. 30 |
31 | 32 | 33 |
-------------------------------------------------------------------------------- /fonts/OpenSans-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Bold.woff -------------------------------------------------------------------------------- /fonts/OpenSans-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Bold.woff2 -------------------------------------------------------------------------------- /fonts/OpenSans-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Light.woff -------------------------------------------------------------------------------- /fonts/OpenSans-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Light.woff2 -------------------------------------------------------------------------------- /fonts/OpenSans-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Medium.woff -------------------------------------------------------------------------------- /fonts/OpenSans-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Medium.woff2 -------------------------------------------------------------------------------- /fonts/OpenSans-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Regular.woff -------------------------------------------------------------------------------- /fonts/OpenSans-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/fonts/OpenSans-Regular.woff2 -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | get_setting('back2top')) : ?> 14 |
15 | 18 |
19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | get('Version')); 3 | define('BERRY_DEBUG', false); 4 | define('BERRY_SETTING_KEY', 'berry_setting'); 5 | define('BERRY_ARCHIVE_VIEW_KEY', 'berry_archive_view'); 6 | define('BERRY_POST_LIKE_KEY', 'berry_post_like'); 7 | define('BERRY_POST_VIEW_KEY', 'berry_post_view'); 8 | 9 | add_action('after_setup_theme', 'berry_setup'); 10 | function berry_setup() 11 | { 12 | load_theme_textdomain('Berry', get_template_directory() . '/languages'); 13 | } 14 | 15 | require('inc/setting.php'); 16 | require('inc/setup.php'); 17 | require('inc/comment.php'); 18 | require('inc/base.php'); 19 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const gulp = require('gulp'); 4 | const babel = require('gulp-babel'); 5 | const uglify = require('gulp-uglify'); 6 | const concat = require('gulp-concat'); 7 | const plumber = require('gulp-plumber'); 8 | const postcss = require('gulp-postcss'); 9 | const autoprefixer = require('autoprefixer'); 10 | const cssnano = require('cssnano'); 11 | const sass = require('gulp-sass')(require('sass')); 12 | const rename = require('gulp-rename'); 13 | const ts = require('gulp-typescript'); 14 | 15 | function settingCss() { 16 | return gulp 17 | .src('./scss/setting.scss') 18 | .pipe(plumber()) 19 | .pipe(sass({ outputStyle: 'compressed' })) 20 | .pipe(rename({ suffix: '.min' })) 21 | .pipe(postcss([autoprefixer(), cssnano()])) 22 | .pipe(gulp.dest('./build/css/')); 23 | } 24 | 25 | function css() { 26 | return gulp 27 | .src('./scss/app.scss') 28 | .pipe(plumber()) 29 | .pipe(sass({ outputStyle: 'compressed' })) 30 | .pipe(rename('app.css')) 31 | .pipe(postcss([autoprefixer(), cssnano()])) 32 | .pipe(rename({ suffix: '.min' })) 33 | .pipe(gulp.dest('./build/css/')); 34 | } 35 | 36 | function images() { 37 | return gulp.src('./images/*.{png,jpg,gif,svg,jpeg}').pipe(gulp.dest('./build/images/')); 38 | } 39 | 40 | function fonts() { 41 | return gulp.src('./fonts/*').pipe(gulp.dest('./build/fonts/')); 42 | } 43 | 44 | // Transpile, concatenate and minify scripts 45 | function typescripts() { 46 | return gulp 47 | .src(['./ts/extensions/*', './ts/app.ts', './ts/modules/*']) 48 | .pipe( 49 | ts({ 50 | noImplicitAny: true, 51 | outFile: 'app.js', 52 | target: 'es5', 53 | }) 54 | ) 55 | .pipe(uglify()) 56 | .pipe(rename({ suffix: '.min' })) 57 | .pipe(gulp.dest('./build/js/')); 58 | } 59 | 60 | function setting() { 61 | return gulp 62 | .src(['./ts/setting.ts']) 63 | .pipe(plumber()) 64 | .pipe( 65 | ts({ 66 | noImplicitAny: true, 67 | outFile: 'setting.js', 68 | target: 'es5', 69 | }) 70 | ) 71 | .pipe(uglify()) 72 | .pipe(rename({ suffix: '.min' })) 73 | .pipe(gulp.dest('./build/js/')); 74 | } 75 | 76 | // Watch files 77 | function watchFiles() { 78 | gulp.watch(['./ts/ts.js'], gulp.series(typescripts)); 79 | gulp.watch(['./scss/app.scss', './scss/modules/*', './scss/templates/*'], gulp.series(css)); 80 | gulp.watch(['./scss/setting.scss'], gulp.series(settingCss)); 81 | gulp.watch(['./js/setting.ts'], gulp.series(setting)); 82 | } 83 | 84 | // define complex tasks 85 | const js = gulp.series(typescripts); 86 | const watch = gulp.parallel(watchFiles); 87 | const build = gulp.parallel(watch, gulp.parallel(css, js, images, settingCss, setting, fonts)); 88 | 89 | exports.css = css; 90 | exports.js = js; 91 | exports.build = build; 92 | exports.watch = watch; 93 | exports.default = build; 94 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | > 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | > 13 | get_setting('darkmode')) : ?> 16 | 28 | 29 |
30 | -------------------------------------------------------------------------------- /images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/images/favicon.png -------------------------------------------------------------------------------- /inc/base.php: -------------------------------------------------------------------------------- 1 | /sim', $content, $strResult, PREG_PATTERN_ORDER); 14 | $n = count($strResult[1]); 15 | if ($n > 0) { 16 | $output = $strResult[1][0]; 17 | } else { 18 | $output = $defaltthubmnail; 19 | } 20 | } 21 | return $output; 22 | } 23 | 24 | function berry_is_has_image($post_id) 25 | { 26 | static $has_image; 27 | global $post; 28 | if (has_post_thumbnail($post_id)) { 29 | $has_image = true; 30 | } elseif (get_post_meta($post_id, '_banner', true)) { 31 | $has_image = true; 32 | } else { 33 | $content = get_post_field('post_content', $post_id); 34 | preg_match_all('//sim', $content, $strResult, PREG_PATTERN_ORDER); 35 | $n = count($strResult[1]); 36 | if ($n > 0) { 37 | $has_image = true; 38 | } else { 39 | $has_image = false; 40 | } 41 | } 42 | 43 | return $has_image; 44 | } 45 | 46 | 47 | function berry_get_post_image_count($post_id) 48 | { 49 | $content = get_post_field('post_content', $post_id); 50 | $content = apply_filters('the_content', $content); 51 | preg_match_all('//sim', $content, $strResult, PREG_PATTERN_ORDER); 52 | return count($strResult[1]); 53 | } 54 | 55 | /** 56 | * Get post images 57 | * 58 | * @since Hera 0.2.0 59 | * 60 | */ 61 | 62 | 63 | function berry_get_post_images($post_id, $count = 3) 64 | { 65 | if (! $post_id) { 66 | $post_id = get_the_ID(); 67 | } 68 | 69 | $post = get_post($post_id); 70 | $content = apply_filters('the_content', $post->post_content); 71 | preg_match_all('//sim', $content, $strResult, PREG_PATTERN_ORDER); 72 | $n = count($strResult[1]); 73 | $output = array(); 74 | if ($n > 0) { 75 | $output = array_slice($strResult[1], 0, $count); 76 | } 77 | return $output; 78 | } 79 | 80 | 81 | /** 82 | * Get link items by categroy id 83 | * 84 | * @since Berry 2.0.1 85 | * 86 | * @param term id 87 | * @return link item list 88 | */ 89 | 90 | function get_the_link_items($id = null) 91 | { 92 | $bookmarks = get_bookmarks('orderby=date&category=' . $id); 93 | $output = ''; 94 | if (!empty($bookmarks)) { 95 | $output .= ''; 103 | } else { 104 | $output = __('No links yet', 'Hera'); 105 | } 106 | return $output; 107 | } 108 | 109 | /** 110 | * Get link items 111 | * 112 | * @since Berry 2.0.1 113 | * 114 | * @return link iterms 115 | */ 116 | 117 | function get_link_items() 118 | { 119 | $linkcats = get_terms('link_category'); 120 | $result = ''; 121 | if (!empty($linkcats)) { 122 | foreach ($linkcats as $linkcat) { 123 | $result .= ''; 124 | if ($linkcat->description) $result .= ''; 125 | $result .= get_the_link_items($linkcat->term_id); 126 | } 127 | } else { 128 | $result = get_the_link_items(); 129 | } 130 | return $result; 131 | } 132 | -------------------------------------------------------------------------------- /inc/comment.php: -------------------------------------------------------------------------------- 1 | get_setting('show_author') && !is_admin()) 11 | add_filter('get_comment_author', array($this, 'get_comment_author_hack'), 10, 3); 12 | if ($berrySetting->get_setting('show_parent')) 13 | add_filter('get_comment_text', array($this, 'hack_get_comment_text'), 0, 2); 14 | if ($berrySetting->get_setting('disable_comment_link')) 15 | add_filter('get_comment_author_link', array($this, 'get_comment_author_link_hack'), 10, 3); 16 | if ($berrySetting->get_setting('friend_icon') && !is_admin()) 17 | add_filter('get_comment_author', array($this, 'show_friend_icon'), 10, 3); 18 | } 19 | 20 | function is_friend($url = '') 21 | { 22 | if (empty($url)) { 23 | return false; 24 | } 25 | $urls = get_bookmarks(); 26 | foreach ($urls as $bookmark) { 27 | // check if the url is contained in the bookmark 28 | if (strpos($bookmark->link_url, $url) !== false) { 29 | return true; 30 | } 31 | } 32 | } 33 | 34 | function show_friend_icon($comment_author, $comment_id, $comment) 35 | { 36 | $comment_author_url = $comment->comment_author_url; 37 | // get domain name 38 | $comment_author_url = parse_url($comment_author_url, PHP_URL_HOST); 39 | 40 | return $this->is_friend($comment_author_url) ? $comment_author . '' : $comment_author; 41 | } 42 | 43 | function get_comment_author_link_hack($comment_author_link, $comment_author, $comment_id) 44 | { 45 | return $comment_author; 46 | } 47 | 48 | function register_routes() 49 | { 50 | register_rest_route('berry/v1', '/comment', array( 51 | 'methods' => 'POST', 52 | 'callback' => array($this, 'handle_coment_post'), 53 | 'permission_callback' => '__return_true', 54 | )); 55 | 56 | register_rest_route('berry/v1', '/view', array( 57 | 'methods' => 'get', 58 | 'callback' => array($this, 'handle_post_view'), 59 | 'permission_callback' => '__return_true', 60 | )); 61 | 62 | register_rest_route('berry/v1', '/like', array( 63 | 'methods' => 'POST', 64 | 'callback' => array($this, 'handle_post_like'), 65 | 'permission_callback' => '__return_true', 66 | )); 67 | 68 | register_rest_route('berry/v1', '/archive/(?P\d+)', array( 69 | 'methods' => 'POST', 70 | 'callback' => array($this, 'handle_archive_view'), 71 | 'permission_callback' => '__return_true', 72 | )); 73 | 74 | register_rest_route('berry/v1', '/posts', array( 75 | 'methods' => 'get', 76 | 'callback' => array($this, 'handle_posts_request'), 77 | 'permission_callback' => '__return_true', 78 | )); 79 | } 80 | 81 | function get_comment_author_hack($comment_author, $comment_id, $comment) 82 | { 83 | $post = get_post($comment->comment_post_ID); 84 | if ($comment->user_id == $post->post_author) { 85 | $comment_author = $comment_author . '' . __('Author', 'Berry') . ''; 86 | } 87 | return $comment_author; 88 | } 89 | 90 | function handle_posts_request($request) 91 | { 92 | $page = $request['page']; 93 | $query_args = array( 94 | 'post_type' => 'post', 95 | 'post_status' => 'publish', 96 | 'orderby' => 'date', 97 | 'order' => 'DESC', 98 | 'paged' => $page, 99 | 'posts_per_page' => get_option('posts_per_page'), 100 | ); 101 | 102 | if ($request['category']) { 103 | $query_args['category__in'] = $request['category']; 104 | } 105 | 106 | if ($request['tag']) { 107 | $query_args['tag__in'] = $request['tag']; 108 | } 109 | 110 | if ($request['author']) { 111 | $query_args['author'] = $request['author']; 112 | } 113 | 114 | $the_query = new WP_Query($query_args); 115 | $data = []; 116 | while ($the_query->have_posts()) { 117 | $the_query->the_post(); 118 | global $post; 119 | $data[] = [ 120 | 'id' => get_the_ID(), 121 | 'post_title' => get_the_title(), 122 | 'date' => get_the_date(), 123 | 'excerpt' => mb_strimwidth(strip_shortcodes(strip_tags(apply_filters('the_content', $post->post_content))), 0, 150, "..."), 124 | 'author' => get_the_author(), 125 | 'author_avatar_urls' => get_avatar_url(get_the_author_meta('ID'), array('size' => 64)), 126 | 'author_posts_url' => get_author_posts_url(get_the_author_meta('ID')), 127 | 'comment_count' => get_comments_number(), 128 | 'view_count' => (int)get_post_meta(get_the_ID(), BERRY_POST_VIEW_KEY, true), 129 | 'like_count' => (int)get_post_meta(get_the_ID(), BERRY_POST_LIKE_KEY, true), 130 | // 'thumbnail' => berry_get_background_image(get_the_ID(), 300, 200), 131 | 'permalink' => get_permalink(), 132 | 'categories' => get_the_category(), 133 | 'tags' => get_the_tags(), 134 | // 'has_image' => berry_is_has_image(get_the_ID()), 135 | 'day' => get_the_date('d'), 136 | 'post_format' => get_post_format(), 137 | ]; 138 | } 139 | 140 | 141 | return [ 142 | 'code' => 200, 143 | 'message' => __('Success', 'Berry'), 144 | 'data' => $data 145 | ]; 146 | } 147 | 148 | function handle_archive_view($request) 149 | { 150 | $term = get_term($request['id']); 151 | if (is_wp_error($term)) { 152 | return [ 153 | 'code' => 500, 154 | 'message' => $term->get_error_message() 155 | ]; 156 | } 157 | $views = (int)get_term_meta($request['id'], BERRY_ARCHIVE_VIEW_KEY, true); 158 | $views++; 159 | update_term_meta($request['id'], BERRY_ARCHIVE_VIEW_KEY, $views); 160 | return [ 161 | 'code' => 200, 162 | 'message' => __('Success', 'Berry'), 163 | 'data' => $views 164 | ]; 165 | } 166 | 167 | 168 | function hack_get_comment_text($comment_text, $comment) 169 | { 170 | if (!is_comment_feed() && $comment->comment_parent) { 171 | $parent = get_comment($comment->comment_parent); 172 | if ($parent) { 173 | $parent_link = esc_url(get_comment_link($parent)); 174 | $name = $parent->comment_author; 175 | 176 | $comment_text = 177 | '@' . $name . '' 178 | . $comment_text; 179 | } 180 | } 181 | return $comment_text; 182 | } 183 | 184 | function handle_post_view($data) 185 | { 186 | $post_id = $data['id']; 187 | $post_views = (int)get_post_meta($post_id, BERRY_POST_VIEW_KEY, true); 188 | $post_views++; 189 | update_post_meta($post_id, BERRY_POST_VIEW_KEY, $post_views); 190 | return [ 191 | 'code' => 200, 192 | 'message' => __('Success', 'Berry'), 193 | 'data' => $post_views 194 | ]; 195 | } 196 | 197 | function handle_post_like($request) 198 | { 199 | $post_id = $request['id']; 200 | $post_views = (int)get_post_meta($post_id, BERRY_POST_LIKE_KEY, true); 201 | $post_views++; 202 | update_post_meta($post_id, BERRY_POST_LIKE_KEY, $post_views); 203 | return [ 204 | 'code' => 200, 205 | 'message' => __('Success', 'Berry'), 206 | 'data' => $post_views 207 | ]; 208 | } 209 | 210 | function handle_coment_post($request) 211 | { 212 | $comment = wp_handle_comment_submission(wp_unslash($request)); 213 | if (is_wp_error($comment)) { 214 | $data = $comment->get_error_data(); 215 | if (!empty($data)) { 216 | return [ 217 | 'code' => 500, 218 | 'message' => $data 219 | ]; 220 | } else { 221 | return [ 222 | 'code' => 500 223 | ]; 224 | } 225 | } 226 | $user = wp_get_current_user(); 227 | do_action('set_comment_cookies', $comment, $user); 228 | $GLOBALS['comment'] = $comment; 229 | return [ 230 | 'code' => 200, 231 | 'message' => __('Success', 'Berry'), 232 | 'data' => [ 233 | 'author_avatar_urls' => get_avatar_url($comment->comment_author_email, array('size' => 64)), 234 | 'comment_author' => $comment->comment_author, 235 | 'comment_author_email' => $comment->comment_author_email, 236 | 'comment_author_url' => $comment->comment_author_url, 237 | 'comment_content' => get_comment_text($comment->comment_ID), 238 | 'comment_date' => date('Y-m-d', strtotime($comment->comment_date)), 239 | 'comment_date_gmt' => $comment->comment_date_gmt, 240 | 'comment_ID' => $comment->comment_ID, 241 | ] 242 | ]; 243 | } 244 | } 245 | 246 | new berryComment(); 247 | 248 | // comment template 249 | function berry_comment($comment, $args, $depth) 250 | 251 | { 252 | $GLOBALS['comment'] = $comment; 253 | switch ($comment->comment_type): 254 | case 'pingback': 255 | case 'trackback': 256 | ?> 257 |
  • id="comment-"> 258 |
    259 | 264 |
  • 265 |
    266 |
    267 |
    268 | 269 |
    270 |
    271 | 275 | 276 |
    277 |
    278 |
    279 | 280 |
    281 |
    282 | get_setting('toc')) 29 | add_filter('the_content', array($this, 'berry_toc')); 30 | if ($berrySetting->get_setting('gravatar_proxy')) 31 | add_filter('get_avatar_url', array($this, 'gravatar_proxy'), 10, 3); 32 | 33 | add_action('admin_enqueue_scripts', array($this, 'admin_enquenue_scripts')); 34 | 35 | if ($berrySetting->get_setting('exclude_status')) 36 | add_filter('pre_get_posts', array($this, 'exclude_post_format')); 37 | if ($berrySetting->get_setting('image_zoom')) 38 | add_filter('the_content', array($this, 'image_zoom')); 39 | 40 | if ($berrySetting->get_setting('rss_tag')) 41 | add_action('rss2_head', array($this, 'add_rss_tag')); 42 | } 43 | 44 | function add_rss_tag() 45 | { 46 | global $berrySetting; 47 | echo $berrySetting->get_setting('rss_tag'); 48 | } 49 | 50 | 51 | function image_zoom($content) 52 | { 53 | $pattern = "/]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>(.*?)<\/a>/i"; 54 | $replacement = '$7'; 55 | $content = preg_replace($pattern, $replacement, $content); 56 | return $content; 57 | } 58 | 59 | function exclude_post_format($query) 60 | { 61 | if ($query->is_home() && $query->is_main_query()) { 62 | $query->set('tax_query', array( 63 | array( 64 | 'taxonomy' => 'post_format', 65 | 'field' => 'slug', 66 | 'terms' => array('post-format-status'), 67 | 'operator' => 'NOT IN' 68 | ) 69 | )); 70 | } 71 | } 72 | 73 | function update_my_category_fields($term_id) 74 | { 75 | if (isset($_POST['taxonomy']) && $_POST['taxonomy'] == 'category') : 76 | if ($_POST['_category_cover']) { 77 | update_term_meta($term_id, '_thumb', $_POST['_category_cover']); 78 | } else { 79 | delete_term_meta($term_id, '_thumb'); 80 | } 81 | 82 | endif; 83 | } 84 | 85 | //Adds the custom title box to the category editor 86 | function add_category_cover_form_item($category) 87 | { 88 | $cover = get_term_meta($category->term_id, '_thumb', true); ?> 89 | 90 | 91 | 92 | 96 | 97 |
    93 |

    94 |

    95 |
    98 | get_setting('gravatar_proxy'), $url); 104 | return $url; 105 | } 106 | 107 | function berry_toc($content) 108 | { 109 | global $berrySetting; 110 | $toc_start = $berrySetting->get_setting('toc_start') ? $berrySetting->get_setting('toc_start') : 3; 111 | preg_match_all('/(.*?)<\/h[' . $toc_start . '-6]>/i', $content, $matches, PREG_SET_ORDER); 112 | 113 | if ($matches && is_singular()) { 114 | $toc = '
      '; 115 | $previous_level = 3; 116 | $count = 1; 117 | 118 | foreach ($matches as $match) { 119 | $level = $match[1]; 120 | $title = $match[2]; 121 | if ($level > $previous_level) { 122 | $toc .= '
        '; 123 | } elseif ($level < $previous_level) { 124 | $toc .= str_repeat('
      ', $previous_level - $level); 125 | } else { 126 | $toc .= ''; 127 | } 128 | 129 | $toc .= sprintf('
    • %s', $count, $title); 130 | $content = str_replace($match[0], sprintf('%s', $level, $count, $title, $level), $content); 131 | 132 | $previous_level = $level; 133 | $count++; 134 | } 135 | 136 | $toc .= str_repeat('
    ', $previous_level - 2); 137 | $toc .= ''; 138 | 139 | $content = '
    ' . __('Table of content', 'Berry') . '' . $toc . '
    ' . $content; 140 | } 141 | 142 | return $content; 143 | } 144 | 145 | function head_output() 146 | { 147 | global $wp, $post, $berrySetting; 148 | $current_url = home_url(add_query_arg(array(), $wp->request)); 149 | 150 | //echo ''; 151 | 152 | $description = ''; 153 | $blog_name = get_bloginfo('name'); 154 | $ogmeta = ''; 155 | $ogmeta .= ''; 156 | if (is_singular()) { 157 | $ID = $post->ID; 158 | $author = $post->post_author; 159 | if (get_post_meta($ID, "_desription", true)) { 160 | $description = get_post_meta($ID, "_desription", true); 161 | } else { 162 | $description = $post->post_title . ',' . __('author', 'Berry') . ':' . get_the_author_meta('nickname', $author) . ',' . __('published on', 'Berry') . get_the_date('Y-m-d'); 163 | } 164 | echo ''; 165 | $ogmeta .= ''; 166 | $ogmeta .= ''; 167 | $ogmeta .= ''; 168 | $twitter_meta = ''; 169 | $twitter_meta .= ''; 170 | $twitter_meta .= ''; 171 | $twitter_meta .= ''; 172 | $twitter_meta .= ''; 173 | echo $twitter_meta; 174 | } else { 175 | if (is_home()) { 176 | $description = $berrySetting->get_setting('description'); 177 | } elseif (is_category()) { 178 | $description = single_cat_title('', false) . " - " . trim(strip_tags(category_description())); 179 | } elseif (is_tag()) { 180 | $description = trim(strip_tags(tag_description())); 181 | } else { 182 | $description = $berrySetting->get_setting('description'); 183 | } 184 | $description = mb_substr($description, 0, 220, 'utf-8'); 185 | if ($berrySetting->get_setting('og_default_thumb')) { 186 | $ogmeta .= ''; 187 | } 188 | if ($description) $ogmeta .= ''; 189 | $ogmeta .= ''; 190 | if ($description) echo ''; 191 | } 192 | echo $ogmeta; 193 | } 194 | 195 | function custom_excerpt_length($excerpt) 196 | { 197 | if (has_excerpt()) { 198 | $excerpt = wp_trim_words(get_the_excerpt(), apply_filters("excerpt_length", 80)); 199 | } 200 | return $excerpt; 201 | } 202 | 203 | function excerpt_more($more) 204 | { 205 | return '...'; 206 | } 207 | 208 | function excerpt_length($length) 209 | { 210 | return 80; 211 | } 212 | 213 | function admin_enquenue_scripts() 214 | { 215 | // check if is category edit page and enquenue wp media 216 | if (isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'category') { 217 | wp_enqueue_media(); 218 | wp_enqueue_script('berry-setting', get_template_directory_uri() . '/build/js/setting.min.js', ['jquery'], BERRY_VERSION, true); 219 | wp_localize_script( 220 | 'berry-setting', 221 | 'obvInit', 222 | [ 223 | 'is_single' => is_singular(), 224 | 'post_id' => get_the_ID(), 225 | 'restfulBase' => esc_url_raw(rest_url()), 226 | 'nonce' => wp_create_nonce('wp_rest'), 227 | 'ajaxurl' => admin_url('admin-ajax.php'), 228 | 'success_message' => __('Setting saved success!', 'Berry'), 229 | 'upload_title' => __('Upload Image', 'Berry'), 230 | 'upload_button' => __('Set Category Image', 'Berry'), 231 | ] 232 | ); 233 | } 234 | } 235 | 236 | function enqueue_styles() 237 | { 238 | global $berrySetting; 239 | wp_dequeue_style('global-styles'); 240 | wp_enqueue_style('berry-style', get_template_directory_uri() . '/build/css/app.min.css', array(), BERRY_VERSION, 'all'); 241 | if ($berrySetting->get_setting('css')) { 242 | wp_add_inline_style('berry-style', $berrySetting->get_setting('css')); 243 | } 244 | 245 | if ($berrySetting->get_setting('disable_block_css')) { 246 | wp_dequeue_style('wp-block-library'); 247 | wp_dequeue_style('wp-block-library-theme'); 248 | wp_dequeue_style('wc-blocks-style'); 249 | } 250 | } 251 | 252 | function enqueue_scripts() 253 | { 254 | global $berrySetting; 255 | wp_enqueue_script('berry-script', get_template_directory_uri() . '/build/js/app.min.js', [], BERRY_VERSION, true); 256 | wp_localize_script( 257 | 'berry-script', 258 | 'obvInit', 259 | [ 260 | 'is_single' => is_singular(), 261 | 'post_id' => get_the_ID(), 262 | 'restfulBase' => esc_url_raw(rest_url()), 263 | 'nonce' => wp_create_nonce('wp_rest'), 264 | 'darkmode' => !!$berrySetting->get_setting('darkmode'), 265 | 'version' => BERRY_VERSION, 266 | 'is_archive' => is_archive(), 267 | 'archive_id' => get_queried_object_id(), 268 | 'hide_home_cover' => !!$berrySetting->get_setting('hide_home_cover'), 269 | 'timeFormat' => [ 270 | 'second' => __('second ago', 'Berry'), 271 | 'seconds' => __('seconds ago', 'Berry'), 272 | 'minute' => __('minute ago', 'Berry'), 273 | 'minutes' => __('minutes ago', 'Berry'), 274 | 'hour' => __('hour ago', 'Berry'), 275 | 'hours' => __('hours ago', 'Berry'), 276 | 'day' => __('day ago', 'Berry'), 277 | 'days' => __('days ago', 'Berry'), 278 | 'week' => __('week ago', 'Berry'), 279 | 'weeks' => __('weeks ago', 'Berry'), 280 | 'month' => __('month ago', 'Berry'), 281 | 'months' => __('months ago', 'Berry'), 282 | 'year' => __('year ago', 'Berry'), 283 | 'years' => __('years ago', 'Berry'), 284 | ] 285 | ] 286 | ); 287 | if ($berrySetting->get_setting('javascript')) { 288 | wp_add_inline_script('berry-script', $berrySetting->get_setting('javascript')); 289 | } 290 | if (is_singular()) wp_enqueue_script("comment-reply"); 291 | } 292 | } 293 | global $berryBase; 294 | $berryBase = new berryBase(); 295 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 4 | 5 | 6 |
    7 | __('Prev page', 'Berry'), 9 | 'next_text' => __('Next page', 'Berry'), 10 | 'prev_next' => false, 11 | 'before_page_number' => '', 12 | )); ?> 13 |
    14 |
    15 | -------------------------------------------------------------------------------- /languages/berry.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 bigfa 2 | # This file is distributed under the GNU General Public License v2 or later. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Berry 2.0.5\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/theme/Berry\n" 7 | "Last-Translator: FULL NAME \n" 8 | "Language-Team: LANGUAGE \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "POT-Creation-Date: 2025-05-20T09:49:35+00:00\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "X-Generator: WP-CLI 2.11.0\n" 15 | "X-Domain: Berry\n" 16 | 17 | #. Theme Name of the theme 18 | #: style.css 19 | msgid "Berry" 20 | msgstr "" 21 | 22 | #. Theme URI of the theme 23 | #: style.css 24 | msgid "https://fatesinger.com/100095" 25 | msgstr "" 26 | 27 | #. Description of the theme 28 | #: style.css 29 | msgid "theme 2018" 30 | msgstr "" 31 | 32 | #. Author of the theme 33 | #: style.css 34 | msgid "bigfa" 35 | msgstr "" 36 | 37 | #. Author URI of the theme 38 | #: style.css 39 | msgid "https://github.com/bigfa" 40 | msgstr "" 41 | 42 | #: archive.php:14 43 | #: category.php:17 44 | #: index.php:8 45 | msgid "Prev page" 46 | msgstr "" 47 | 48 | #: archive.php:15 49 | #: category.php:18 50 | #: index.php:9 51 | msgid "Next page" 52 | msgstr "" 53 | 54 | #: comments.php:8 55 | msgctxt "comments title" 56 | msgid "One comment" 57 | msgid_plural "%1$s comments" 58 | msgstr[0] "" 59 | msgstr[1] "" 60 | 61 | #: comments.php:16 62 | msgid "Reply" 63 | msgstr "" 64 | 65 | #: comments.php:23 66 | msgid "Prev" 67 | msgstr "" 68 | 69 | #: comments.php:24 70 | #: template-part/post-navigation.php:28 71 | msgid "Next" 72 | msgstr "" 73 | 74 | #: comments.php:29 75 | msgid "No comment." 76 | msgstr "" 77 | 78 | #: inc/comment.php:85 79 | msgid "Author" 80 | msgstr "" 81 | 82 | #: inc/comment.php:143 83 | #: inc/comment.php:162 84 | #: inc/comment.php:192 85 | #: inc/comment.php:205 86 | #: inc/comment.php:231 87 | #: inc/setting.php:28 88 | msgid "Success" 89 | msgstr "" 90 | 91 | #: inc/setting.php:47 92 | #: inc/setup.php:263 93 | msgid "Setting saved success!" 94 | msgstr "" 95 | 96 | #: inc/setting.php:48 97 | #: inc/setup.php:264 98 | msgid "Upload Image" 99 | msgstr "" 100 | 101 | #: inc/setting.php:56 102 | #: inc/setting.php:62 103 | msgid "Theme Setting" 104 | msgstr "" 105 | 106 | #: inc/setting.php:63 107 | #: inc/setting.php:86 108 | msgid "Documentation" 109 | msgstr "" 110 | 111 | #: inc/setting.php:113 112 | msgid "Save" 113 | msgstr "" 114 | 115 | #: inc/setting.php:202 116 | msgid "Basic Setting" 117 | msgstr "" 118 | 119 | #: inc/setting.php:207 120 | msgid "Feature Setting" 121 | msgstr "" 122 | 123 | #: inc/setting.php:213 124 | msgid "Singluar Setting" 125 | msgstr "" 126 | 127 | #: inc/setting.php:218 128 | msgid "SNS Setting" 129 | msgstr "" 130 | 131 | #: inc/setting.php:223 132 | msgid "Custom Setting" 133 | msgstr "" 134 | 135 | #: inc/setting.php:234 136 | msgid "Description" 137 | msgstr "" 138 | 139 | #: inc/setting.php:235 140 | msgid "Site description" 141 | msgstr "" 142 | 143 | #: inc/setting.php:240 144 | msgid "Headcode" 145 | msgstr "" 146 | 147 | #: inc/setting.php:241 148 | msgid "You can add content to the head tag, such as site verification tags, and so on." 149 | msgstr "" 150 | 151 | #: inc/setting.php:246 152 | msgid "Og default thumb" 153 | msgstr "" 154 | 155 | #: inc/setting.php:247 156 | msgid "Og meta default thumb address." 157 | msgstr "" 158 | 159 | #: inc/setting.php:252 160 | msgid "Favicon" 161 | msgstr "" 162 | 163 | #: inc/setting.php:253 164 | msgid "Favicon address" 165 | msgstr "" 166 | 167 | #: inc/setting.php:258 168 | msgid "Title sep" 169 | msgstr "" 170 | 171 | #: inc/setting.php:259 172 | msgid "Default is" 173 | msgstr "" 174 | 175 | #: inc/setting.php:264 176 | msgid "Disable block css" 177 | msgstr "" 178 | 179 | #: inc/setting.php:265 180 | msgid "Do not load block-style files." 181 | msgstr "" 182 | 183 | #: inc/setting.php:270 184 | msgid "Gravatar proxy" 185 | msgstr "" 186 | 187 | #: inc/setting.php:271 188 | msgid "Gravatar proxy domain,like cravatar.cn" 189 | msgstr "" 190 | 191 | #: inc/setting.php:276 192 | msgid "RSS Tag" 193 | msgstr "" 194 | 195 | #: inc/setting.php:277 196 | msgid "You can add tag in rss to verify follow." 197 | msgstr "" 198 | 199 | #: inc/setting.php:288 200 | msgid "Update notice" 201 | msgstr "" 202 | 203 | #: inc/setting.php:289 204 | msgid "Get theme update notice." 205 | msgstr "" 206 | 207 | #: inc/setting.php:294 208 | msgid "Upyun CDN" 209 | msgstr "" 210 | 211 | #: inc/setting.php:295 212 | msgid "Make sure all images are uploaded to Upyun, otherwise thumbnails may not display properly." 213 | msgstr "" 214 | 215 | #: inc/setting.php:300 216 | msgid "Aliyun OSS CDN" 217 | msgstr "" 218 | 219 | #: inc/setting.php:301 220 | msgid "Make sure all images are uploaded to Aliyun OSS, otherwise thumbnails may not display properly." 221 | msgstr "" 222 | 223 | #: inc/setting.php:306 224 | msgid "Qiniu OSS CDN" 225 | msgstr "" 226 | 227 | #: inc/setting.php:307 228 | msgid "Make sure all images are uploaded to Qiniu OSS, otherwise thumbnails may not display properly." 229 | msgstr "" 230 | 231 | #: inc/setting.php:312 232 | msgid "Dark Mode" 233 | msgstr "" 234 | 235 | #: inc/setting.php:313 236 | msgid "Enable dark mode" 237 | msgstr "" 238 | 239 | #: inc/setting.php:318 240 | msgid "Default thumbnail" 241 | msgstr "" 242 | 243 | #: inc/setting.php:319 244 | msgid "Default thumbnail address" 245 | msgstr "" 246 | 247 | #: inc/setting.php:324 248 | msgid "Back to top" 249 | msgstr "" 250 | 251 | #: inc/setting.php:325 252 | msgid "Enable back to top" 253 | msgstr "" 254 | 255 | #: inc/setting.php:354 256 | msgid "Image count" 257 | msgstr "" 258 | 259 | #: inc/setting.php:355 260 | msgid "Show image count of the post" 261 | msgstr "" 262 | 263 | #: inc/setting.php:360 264 | #: inc/setting.php:361 265 | msgid "Hide home cover" 266 | msgstr "" 267 | 268 | #: inc/setting.php:378 269 | msgid "Author bio" 270 | msgstr "" 271 | 272 | #: inc/setting.php:379 273 | msgid "Enable author bio" 274 | msgstr "" 275 | 276 | #: inc/setting.php:390 277 | msgid "Related posts" 278 | msgstr "" 279 | 280 | #: inc/setting.php:391 281 | msgid "Enable related posts" 282 | msgstr "" 283 | 284 | #: inc/setting.php:396 285 | msgid "Post like" 286 | msgstr "" 287 | 288 | #: inc/setting.php:397 289 | msgid "Enable post like" 290 | msgstr "" 291 | 292 | #: inc/setting.php:402 293 | msgid "Post navigation" 294 | msgstr "" 295 | 296 | #: inc/setting.php:403 297 | msgid "Enable post navigation" 298 | msgstr "" 299 | 300 | #: inc/setting.php:408 301 | msgid "Copy link" 302 | msgstr "" 303 | 304 | #: inc/setting.php:409 305 | msgid "Enable copy link" 306 | msgstr "" 307 | 308 | #: inc/setting.php:414 309 | msgid "Category card" 310 | msgstr "" 311 | 312 | #: inc/setting.php:415 313 | msgid "Show post category info after post." 314 | msgstr "" 315 | 316 | #: inc/setting.php:420 317 | msgid "Show parent comment" 318 | msgstr "" 319 | 320 | #: inc/setting.php:421 321 | msgid "Enable show parent comment" 322 | msgstr "" 323 | 324 | #: inc/setting.php:426 325 | #: inc/setup.php:140 326 | msgid "Table of content" 327 | msgstr "" 328 | 329 | #: inc/setting.php:427 330 | msgid "Enable table of content" 331 | msgstr "" 332 | 333 | #: inc/setting.php:432 334 | msgid "Start heading" 335 | msgstr "" 336 | 337 | #: inc/setting.php:433 338 | msgid "Start heading,default h3" 339 | msgstr "" 340 | 341 | #: inc/setting.php:444 342 | msgid "Disable comment link" 343 | msgstr "" 344 | 345 | #: inc/setting.php:445 346 | msgid "Disable comment author url" 347 | msgstr "" 348 | 349 | #: inc/setting.php:450 350 | msgid "No reply text" 351 | msgstr "" 352 | 353 | #: inc/setting.php:451 354 | msgid "Text display when no comment in current post." 355 | msgstr "" 356 | 357 | #: inc/setting.php:456 358 | msgid "Friend icon" 359 | msgstr "" 360 | 361 | #: inc/setting.php:457 362 | msgid "Show icon when comment author url is in blogroll." 363 | msgstr "" 364 | 365 | #: inc/setting.php:486 366 | msgid "Telegram" 367 | msgstr "" 368 | 369 | #: inc/setting.php:487 370 | msgid "Telegram link" 371 | msgstr "" 372 | 373 | #: inc/setting.php:504 374 | msgid "Twitter" 375 | msgstr "" 376 | 377 | #: inc/setting.php:505 378 | msgid "Twitter link" 379 | msgstr "" 380 | 381 | #: inc/setting.php:510 382 | msgid "RSS" 383 | msgstr "" 384 | 385 | #: inc/setting.php:511 386 | msgid "RSS link" 387 | msgstr "" 388 | 389 | #: inc/setting.php:534 390 | msgid "Custom" 391 | msgstr "" 392 | 393 | #: inc/setting.php:535 394 | msgid "Custom sns link,use html." 395 | msgstr "" 396 | 397 | #: inc/setting.php:545 398 | msgid "CSS" 399 | msgstr "" 400 | 401 | #: inc/setting.php:546 402 | msgid "Custom CSS" 403 | msgstr "" 404 | 405 | #: inc/setting.php:551 406 | msgid "Javascript" 407 | msgstr "" 408 | 409 | #: inc/setting.php:552 410 | msgid "Custom Javascript" 411 | msgstr "" 412 | 413 | #: inc/setting.php:557 414 | msgid "Copyright" 415 | msgstr "" 416 | 417 | #: inc/setting.php:558 418 | msgid "Custom footer content" 419 | msgstr "" 420 | 421 | #: inc/setup.php:21 422 | msgid "Primary Menu" 423 | msgstr "" 424 | 425 | #: inc/setup.php:92 426 | msgid "Cover" 427 | msgstr "" 428 | 429 | #: inc/setup.php:94 430 | msgid "Upload" 431 | msgstr "" 432 | 433 | #: inc/setup.php:95 434 | msgid "Category cover url." 435 | msgstr "" 436 | 437 | #: inc/setup.php:163 438 | msgid "author" 439 | msgstr "" 440 | 441 | #: inc/setup.php:163 442 | msgid "published on" 443 | msgstr "" 444 | 445 | #: inc/setup.php:200 446 | #: inc/setup.php:202 447 | msgid "Homepage Top" 448 | msgstr "" 449 | 450 | #: inc/setup.php:210 451 | #: inc/setup.php:212 452 | msgid "Homepage Bottom" 453 | msgstr "" 454 | 455 | #: inc/setup.php:220 456 | #: inc/setup.php:222 457 | msgid "Single Pgae Bottom" 458 | msgstr "" 459 | 460 | #: inc/setup.php:265 461 | msgid "Set Category Image" 462 | msgstr "" 463 | 464 | #: inc/setup.php:309 465 | msgid "second ago" 466 | msgstr "" 467 | 468 | #: inc/setup.php:310 469 | msgid "seconds ago" 470 | msgstr "" 471 | 472 | #: inc/setup.php:311 473 | msgid "minute ago" 474 | msgstr "" 475 | 476 | #: inc/setup.php:312 477 | msgid "minutes ago" 478 | msgstr "" 479 | 480 | #: inc/setup.php:313 481 | msgid "hour ago" 482 | msgstr "" 483 | 484 | #: inc/setup.php:314 485 | msgid "hours ago" 486 | msgstr "" 487 | 488 | #: inc/setup.php:315 489 | msgid "day ago" 490 | msgstr "" 491 | 492 | #: inc/setup.php:316 493 | msgid "days ago" 494 | msgstr "" 495 | 496 | #: inc/setup.php:317 497 | msgid "week ago" 498 | msgstr "" 499 | 500 | #: inc/setup.php:318 501 | msgid "weeks ago" 502 | msgstr "" 503 | 504 | #: inc/setup.php:319 505 | msgid "month ago" 506 | msgstr "" 507 | 508 | #: inc/setup.php:320 509 | msgid "months ago" 510 | msgstr "" 511 | 512 | #: inc/setup.php:321 513 | msgid "year ago" 514 | msgstr "" 515 | 516 | #: inc/setup.php:322 517 | msgid "years ago" 518 | msgstr "" 519 | 520 | #: template-part/post-navigation.php:14 521 | msgid "Post" 522 | msgstr "" 523 | 524 | #: template-part/post-navigation.php:18 525 | msgid "Previous" 526 | msgstr "" 527 | 528 | #: template-part/post/content.php:9 529 | msgid "Sticky" 530 | msgstr "" 531 | 532 | #: template-part/single-related.php:1 533 | msgid "Related Posts" 534 | msgstr "" 535 | 536 | #. Template Name of the theme 537 | msgid "Map" 538 | msgstr "" 539 | 540 | #. Template Name of the theme 541 | msgid "文章归档模版" 542 | msgstr "" 543 | 544 | #. Template Name of the theme 545 | msgid "Links" 546 | msgstr "" 547 | 548 | #. Template Name of the theme 549 | msgid "Terms" 550 | msgstr "" 551 | -------------------------------------------------------------------------------- /languages/zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/languages/zh_CN.mo -------------------------------------------------------------------------------- /languages/zh_CN.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 bigfa 2 | # This file is distributed under the GNU General Public License v2 or later. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Berry 2.0.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/theme/Berry\n" 7 | "POT-Creation-Date: 2025-03-19T15:41:49+00:00\n" 8 | "PO-Revision-Date: 2025-05-20 17:55+0800\n" 9 | "Last-Translator: \n" 10 | "Language-Team: \n" 11 | "Language: zh_CN\n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "Plural-Forms: nplurals=1; plural=0;\n" 16 | "X-Generator: Poedit 3.6\n" 17 | "X-Domain: Berry\n" 18 | 19 | #. Theme Name of the theme 20 | #: style.css 21 | msgid "Berry" 22 | msgstr "" 23 | 24 | #. Theme URI of the theme 25 | #: style.css 26 | msgid "https://fatesinger.com/100095" 27 | msgstr "" 28 | 29 | #. Description of the theme 30 | #: style.css 31 | msgid "bigfa free theme 2018" 32 | msgstr "" 33 | 34 | #. Author of the theme 35 | #: style.css 36 | msgid "bigfa" 37 | msgstr "" 38 | 39 | #. Author URI of the theme 40 | #: style.css 41 | msgid "https://github.com/bigfa" 42 | msgstr "" 43 | 44 | #: comments.php:8 45 | msgctxt "comments title" 46 | msgid "One comment" 47 | msgid_plural "%1$s comments" 48 | msgstr[0] "" 49 | 50 | #: comments.php:15 51 | msgid "Reply" 52 | msgstr "回复" 53 | 54 | #: comments.php:22 55 | msgid "Prev" 56 | msgstr "前一页" 57 | 58 | #: comments.php:23 59 | msgid "Next" 60 | msgstr "后一页" 61 | 62 | #: inc/comment.php:85 63 | msgid "Author" 64 | msgstr "" 65 | 66 | #: inc/comment.php:143 inc/comment.php:162 inc/comment.php:192 67 | #: inc/comment.php:205 inc/comment.php:231 inc/setting.php:28 68 | msgid "Success" 69 | msgstr "成功" 70 | 71 | #: inc/setting.php:47 inc/setup.php:295 72 | msgid "Setting saved success!" 73 | msgstr "设置保存成功" 74 | 75 | #: inc/setting.php:48 inc/setup.php:296 76 | msgid "Upload Image" 77 | msgstr "上传图片" 78 | 79 | #: inc/setting.php:56 inc/setting.php:62 80 | msgid "Theme Setting" 81 | msgstr "主题设置" 82 | 83 | #: inc/setting.php:63 inc/setting.php:86 84 | msgid "Documentation" 85 | msgstr "文档" 86 | 87 | #: inc/setting.php:113 88 | msgid "Save" 89 | msgstr "保存" 90 | 91 | #: inc/setting.php:202 92 | msgid "Basic Setting" 93 | msgstr "基础设置" 94 | 95 | #: inc/setting.php:207 96 | msgid "Feature Setting" 97 | msgstr "功能设置" 98 | 99 | #: inc/setting.php:213 100 | msgid "Singluar Setting" 101 | msgstr "文章设置" 102 | 103 | #: inc/setting.php:218 104 | msgid "SNS Setting" 105 | msgstr "社会化设置" 106 | 107 | #: inc/setting.php:223 108 | msgid "Custom Setting" 109 | msgstr "自定义设置" 110 | 111 | #: inc/setting.php:234 112 | msgid "Description" 113 | msgstr "" 114 | 115 | #: inc/setting.php:235 116 | msgid "Site description" 117 | msgstr "" 118 | 119 | #: inc/setting.php:240 120 | msgid "Headcode" 121 | msgstr "" 122 | 123 | #: inc/setting.php:241 124 | msgid "" 125 | "You can add content to the head tag, such as site verification tags, and so " 126 | "on." 127 | msgstr "" 128 | 129 | #: inc/setting.php:246 130 | msgid "Banner" 131 | msgstr "" 132 | 133 | #: inc/setting.php:247 134 | msgid "Header banner address." 135 | msgstr "" 136 | 137 | #: inc/setting.php:252 138 | msgid "Og default thumb" 139 | msgstr "" 140 | 141 | #: inc/setting.php:253 142 | msgid "Og meta default thumb address." 143 | msgstr "" 144 | 145 | #: inc/setting.php:258 146 | msgid "Favicon" 147 | msgstr "" 148 | 149 | #: inc/setting.php:259 150 | msgid "Favicon address" 151 | msgstr "" 152 | 153 | #: inc/setting.php:264 154 | msgid "Title sep" 155 | msgstr "标题分隔符" 156 | 157 | #: inc/setting.php:265 158 | msgid "Default is" 159 | msgstr "" 160 | 161 | #: inc/setting.php:270 162 | msgid "Disable block css" 163 | msgstr "" 164 | 165 | #: inc/setting.php:271 166 | msgid "Do not load block-style files." 167 | msgstr "" 168 | 169 | #: inc/setting.php:276 170 | msgid "Gravatar proxy" 171 | msgstr "" 172 | 173 | #: inc/setting.php:277 174 | msgid "Gravatar proxy domain,like cravatar.cn" 175 | msgstr "" 176 | 177 | #: inc/setting.php:282 178 | msgid "RSS Tag" 179 | msgstr "" 180 | 181 | #: inc/setting.php:283 182 | msgid "You can add tag in rss to verify follow." 183 | msgstr "" 184 | 185 | #: inc/setting.php:294 186 | msgid "Update notice" 187 | msgstr "更新提示" 188 | 189 | #: inc/setting.php:295 190 | msgid "Get theme update notice." 191 | msgstr "" 192 | 193 | #: inc/setting.php:300 194 | msgid "Upyun CDN" 195 | msgstr "" 196 | 197 | #: inc/setting.php:301 198 | msgid "" 199 | "Make sure all images are uploaded to Upyun, otherwise thumbnails may not " 200 | "display properly." 201 | msgstr "" 202 | 203 | #: inc/setting.php:306 204 | msgid "Aliyun OSS CDN" 205 | msgstr "" 206 | 207 | #: inc/setting.php:307 208 | msgid "" 209 | "Make sure all images are uploaded to Aliyun OSS, otherwise thumbnails may " 210 | "not display properly." 211 | msgstr "" 212 | 213 | #: inc/setting.php:312 214 | msgid "Qiniu OSS CDN" 215 | msgstr "" 216 | 217 | #: inc/setting.php:313 218 | msgid "" 219 | "Make sure all images are uploaded to Qiniu OSS, otherwise thumbnails may not " 220 | "display properly." 221 | msgstr "" 222 | 223 | #: inc/setting.php:318 224 | msgid "Dark Mode" 225 | msgstr "暗黑模式" 226 | 227 | #: inc/setting.php:319 228 | msgid "Enable dark mode" 229 | msgstr "" 230 | 231 | #: inc/setting.php:324 232 | msgid "Default thumbnail" 233 | msgstr "" 234 | 235 | #: inc/setting.php:325 236 | msgid "Default thumbnail address" 237 | msgstr "" 238 | 239 | #: inc/setting.php:330 240 | msgid "Back to top" 241 | msgstr "返回顶部" 242 | 243 | #: inc/setting.php:331 244 | msgid "Enable back to top" 245 | msgstr "" 246 | 247 | #: inc/setting.php:366 inc/setting.php:367 248 | msgid "Hide home cover" 249 | msgstr "隐藏首页图片" 250 | 251 | #: inc/setting.php:372 252 | msgid "Exclude status" 253 | msgstr "排除状态" 254 | 255 | #: inc/setting.php:373 256 | msgid "Exclude post type status in homepage" 257 | msgstr "" 258 | 259 | #: inc/setting.php:396 260 | msgid "Related posts" 261 | msgstr "相关文章" 262 | 263 | #: inc/setting.php:397 264 | msgid "Enable related posts" 265 | msgstr "" 266 | 267 | #: inc/setting.php:402 268 | msgid "Post like" 269 | msgstr "文章点赞" 270 | 271 | #: inc/setting.php:403 272 | msgid "Enable post like" 273 | msgstr "" 274 | 275 | #: inc/setting.php:408 276 | msgid "Post navigation" 277 | msgstr "文章导航" 278 | 279 | #: inc/setting.php:409 280 | msgid "Enable post navigation" 281 | msgstr "" 282 | 283 | #: inc/setting.php:414 284 | msgid "Copy link" 285 | msgstr "复制链接" 286 | 287 | #: inc/setting.php:415 288 | msgid "Enable copy link" 289 | msgstr "" 290 | 291 | #: inc/setting.php:426 292 | msgid "Show parent comment" 293 | msgstr "显示父评论" 294 | 295 | #: inc/setting.php:427 296 | msgid "Enable show parent comment" 297 | msgstr "" 298 | 299 | #: inc/setting.php:444 300 | msgid "RSS Button" 301 | msgstr "RSS 按钮" 302 | 303 | #: inc/setting.php:445 304 | msgid "Show RSS Button in meta" 305 | msgstr "" 306 | 307 | #: inc/setting.php:450 308 | msgid "Disable comment link" 309 | msgstr "" 310 | 311 | #: inc/setting.php:451 312 | msgid "Disable comment author url" 313 | msgstr "" 314 | 315 | #: inc/setting.php:456 316 | msgid "No reply text" 317 | msgstr "无评论文案" 318 | 319 | #: inc/setting.php:457 320 | msgid "Text display when no comment in current post." 321 | msgstr "" 322 | 323 | #: inc/setting.php:462 324 | msgid "Friend icon" 325 | msgstr "友情链接图标" 326 | 327 | #: inc/setting.php:463 328 | msgid "Show icon when comment author url is in blogroll." 329 | msgstr "" 330 | 331 | #: inc/setting.php:486 332 | msgid "Footer SNS Icons" 333 | msgstr "SNS 图标" 334 | 335 | #: inc/setting.php:487 336 | msgid "" 337 | "Show sns icons in footer, if this setting is on, the footer menu won',t be " 338 | "displayed." 339 | msgstr "" 340 | 341 | #: inc/setting.php:492 342 | msgid "Telegram" 343 | msgstr "" 344 | 345 | #: inc/setting.php:493 346 | msgid "Telegram link" 347 | msgstr "" 348 | 349 | #: inc/setting.php:498 350 | msgid "Email" 351 | msgstr "" 352 | 353 | #: inc/setting.php:499 354 | msgid "Your email address" 355 | msgstr "" 356 | 357 | #: inc/setting.php:504 358 | msgid "Instagram" 359 | msgstr "" 360 | 361 | #: inc/setting.php:505 362 | msgid "Instagram link" 363 | msgstr "" 364 | 365 | #: inc/setting.php:510 366 | msgid "Twitter" 367 | msgstr "" 368 | 369 | #: inc/setting.php:511 370 | msgid "Twitter link" 371 | msgstr "" 372 | 373 | #: inc/setting.php:516 374 | msgid "RSS" 375 | msgstr "" 376 | 377 | #: inc/setting.php:517 378 | msgid "RSS link" 379 | msgstr "" 380 | 381 | #: inc/setting.php:522 382 | msgid "Github" 383 | msgstr "" 384 | 385 | #: inc/setting.php:523 386 | msgid "Github link" 387 | msgstr "" 388 | 389 | #: inc/setting.php:528 390 | msgid "Discord" 391 | msgstr "" 392 | 393 | #: inc/setting.php:529 394 | msgid "Discord link" 395 | msgstr "" 396 | 397 | #: inc/setting.php:534 398 | msgid "Mastodon" 399 | msgstr "" 400 | 401 | #: inc/setting.php:535 402 | msgid "Mastodon link" 403 | msgstr "" 404 | 405 | #: inc/setting.php:540 406 | msgid "Custom" 407 | msgstr "" 408 | 409 | #: inc/setting.php:541 410 | msgid "Custom sns link,use html." 411 | msgstr "" 412 | 413 | #: inc/setting.php:551 414 | msgid "CSS" 415 | msgstr "" 416 | 417 | #: inc/setting.php:552 418 | msgid "Custom CSS" 419 | msgstr "" 420 | 421 | #: inc/setting.php:557 422 | msgid "Javascript" 423 | msgstr "" 424 | 425 | #: inc/setting.php:558 426 | msgid "Custom Javascript" 427 | msgstr "" 428 | 429 | #: inc/setting.php:563 430 | msgid "Copyright" 431 | msgstr "版权信息" 432 | 433 | #: inc/setting.php:564 434 | msgid "Custom footer content" 435 | msgstr "自定义页脚信息" 436 | 437 | #: inc/setup.php:21 438 | msgid "Primary Menu" 439 | msgstr "主菜单" 440 | 441 | #: inc/setup.php:113 442 | msgid "Cover" 443 | msgstr "封面" 444 | 445 | #: inc/setup.php:115 446 | msgid "Upload" 447 | msgstr "上传" 448 | 449 | #: inc/setup.php:116 450 | msgid "Category cover url." 451 | msgstr "分类封面地址" 452 | 453 | #: inc/setup.php:120 inc/setup.php:124 454 | msgid "Card Template" 455 | msgstr "" 456 | 457 | #: inc/setup.php:126 458 | msgid "Use Card Template" 459 | msgstr "" 460 | 461 | #: inc/setup.php:172 462 | msgid "Table of content" 463 | msgstr "文章目录" 464 | 465 | #: inc/setup.php:195 466 | msgid "author" 467 | msgstr "作者" 468 | 469 | #: inc/setup.php:195 470 | msgid "published on" 471 | msgstr "发布于" 472 | 473 | #: inc/setup.php:232 inc/setup.php:234 474 | msgid "Homepage Top" 475 | msgstr "" 476 | 477 | #: inc/setup.php:242 inc/setup.php:244 478 | msgid "Homepage Bottom" 479 | msgstr "" 480 | 481 | #: inc/setup.php:252 inc/setup.php:254 482 | msgid "Single Pgae Bottom" 483 | msgstr "" 484 | 485 | #: inc/setup.php:297 486 | msgid "Set Category Image" 487 | msgstr "" 488 | 489 | #: modules/base.php:191 490 | msgid "second ago" 491 | msgstr "秒前" 492 | 493 | #: modules/base.php:192 494 | msgid "seconds ago" 495 | msgstr "秒前" 496 | 497 | #: modules/base.php:193 498 | msgid "minute ago" 499 | msgstr "分钟前" 500 | 501 | #: modules/base.php:194 502 | msgid "minutes ago" 503 | msgstr "分钟前" 504 | 505 | #: modules/base.php:195 506 | msgid "hour ago" 507 | msgstr "小时前" 508 | 509 | #: modules/base.php:196 510 | msgid "hours ago" 511 | msgstr "小时前" 512 | 513 | #: modules/base.php:197 514 | msgid "day ago" 515 | msgstr "天前" 516 | 517 | #: modules/base.php:198 518 | msgid "days ago" 519 | msgstr "天前" 520 | 521 | #: modules/base.php:199 522 | msgid "week ago" 523 | msgstr "周前" 524 | 525 | #: modules/base.php:200 526 | msgid "weeks ago" 527 | msgstr "周天" 528 | 529 | #: modules/base.php:201 530 | msgid "month ago" 531 | msgstr "个月前" 532 | 533 | #: modules/base.php:202 534 | msgid "months ago" 535 | msgstr "个月前" 536 | 537 | #: modules/base.php:203 538 | msgid "year ago" 539 | msgstr "年前" 540 | 541 | #: template-part/post-navigation.php:14 542 | msgid "Post" 543 | msgstr "文章" 544 | 545 | #: template-part/post-navigation.php:18 546 | msgid "Previous" 547 | msgstr "下一页" 548 | 549 | #: template-part/post/content.php:9 550 | msgid "Sticky" 551 | msgstr "置顶" 552 | 553 | #: template-part/single-related.php:1 554 | msgid "Related Posts" 555 | msgstr "相关文章" 556 | 557 | #. Template Name of the theme 558 | msgid "Map" 559 | msgstr "地图模版" 560 | 561 | #. Template Name of the theme 562 | msgid "Archives" 563 | msgstr "文章归档模版" 564 | 565 | #. Template Name of the theme 566 | msgid "Links" 567 | msgstr "链接模版" 568 | 569 | #. Template Name of the theme 570 | msgid "Terms" 571 | msgstr "分类模版" 572 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "berry", 3 | "version": "2.0.8", 4 | "description": "", 5 | "main": "gulpfile.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "@babel/core": "^7.5.5", 13 | "@babel/preset-env": "^7.5.5", 14 | "autoprefixer": "^9.6.1", 15 | "del": "^5.1.0", 16 | "gulp": "^4.0.2", 17 | "gulp-babel": "^8.0.0", 18 | "gulp-browserify": "^0.5.1", 19 | "gulp-concat": "^2.6.1", 20 | "gulp-cssnano": "^2.1.3", 21 | "gulp-eslint": "^6.0.0", 22 | "gulp-plumber": "^1.2.1", 23 | "gulp-postcss": "^8.0.0", 24 | "gulp-rename": "^1.4.0", 25 | "gulp-typescript": "^6.0.0-alpha.1", 26 | "gulp-uglify": "^3.0.2", 27 | "normalize.scss": "^0.1.0", 28 | "sass": "^1.49.9" 29 | }, 30 | "dependencies": { 31 | "gulp-sass": "^5.1.0" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /page.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 |

    6 | 7 |

    8 |
    9 | 10 |
    11 | '', 14 | 'pagelink' => '%', 15 | 'separator' => ', ', 16 | )); ?> 17 | 22 |
    23 |
    24 | 25 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigfa/Berry/3c126d18468f6efb2cb4192664453b0d909d505e/screenshot.png -------------------------------------------------------------------------------- /scss/app.scss: -------------------------------------------------------------------------------- 1 | @use 'modules/normalize'; 2 | @use 'modules/variable'; 3 | @use 'modules/basic'; 4 | @use 'modules/comment'; 5 | @use 'modules/grap'; 6 | @use 'templates/map'; 7 | @use 'modules/header'; 8 | @use 'modules/footer'; 9 | @use 'templates/single'; 10 | @use 'templates/term'; 11 | 12 | .u-textAlignCenter { 13 | text-align: center; 14 | } 15 | 16 | .postsFooterNav { 17 | font-size: 18px; 18 | color: var(--berry-text-gray); 19 | .page-numbers { 20 | margin-right: 8px; 21 | &.current, 22 | &:hover { 23 | color: #fff; 24 | } 25 | } 26 | } 27 | 28 | .container { 29 | max-width: 760px; 30 | margin-left: auto; 31 | margin-right: auto; 32 | position: relative; 33 | width: 90%; 34 | } 35 | 36 | .main-content { 37 | padding-top: 30px; 38 | padding-bottom: 30px; 39 | } 40 | .single .main-content { 41 | padding-top: 50px; 42 | } 43 | 44 | .more-link { 45 | font-size: 14px; 46 | color: var(--berry-main-color); 47 | &:hover { 48 | color: var(--berry-hover-color); 49 | } 50 | } 51 | 52 | .block--list { 53 | padding-top: 20px; 54 | padding-bottom: 20px; 55 | } 56 | 57 | .block-title { 58 | font-size: 26px; 59 | line-height: 1.4; 60 | margin-bottom: 5px; 61 | margin-top: 5px; 62 | font-weight: 700; 63 | 64 | a { 65 | &:hover { 66 | color: var(--berry-hover-color); 67 | text-decoration: underline; 68 | } 69 | } 70 | } 71 | 72 | .article-content { 73 | padding-top: 15px; 74 | } 75 | 76 | .block-snippet { 77 | font-size: 16px; 78 | color: var(--berry-text-light); 79 | } 80 | 81 | .block-postMetaWrap { 82 | color: var(--berry-text-gray-lightest); 83 | font-size: 14px; 84 | display: flex; 85 | align-items: center; 86 | 87 | .flag { 88 | width: 20px; 89 | height: 20px; 90 | margin-right: 8px; 91 | } 92 | 93 | .post--meta { 94 | margin-left: auto; 95 | text-transform: uppercase; 96 | } 97 | 98 | a { 99 | transition: 0.5s; 100 | &:hover { 101 | color: var(--berry-text-color); 102 | text-decoration: underline; 103 | } 104 | } 105 | } 106 | 107 | .tag-list { 108 | display: flex; 109 | align-items: center; 110 | flex-wrap: wrap; 111 | padding: 25px 0; 112 | 113 | a { 114 | color: var(--berry-text-color); 115 | background-color: var(--berry-background-gray); 116 | display: flex; 117 | align-items: center; 118 | flex: 0 0 auto; 119 | padding: 3px 16px 3px 10px; 120 | border-radius: 999rem; 121 | margin-right: 15px; 122 | font-size: 14px; 123 | 124 | svg { 125 | stroke: var(--berry-text-color); 126 | 127 | width: 166x; 128 | height: 16px; 129 | margin-right: 0px; 130 | } 131 | 132 | &:hover { 133 | color: var(--berry-text-color); 134 | background-color: var(--berry-background-gray-light); 135 | 136 | svg { 137 | stroke: var(--berry-text-color); 138 | } 139 | } 140 | } 141 | } 142 | 143 | .year-title { 144 | margin-top: 30px; 145 | color: var(--berry-text-gray); 146 | font-size: 24px; 147 | } 148 | 149 | .month-title { 150 | font-size: 20px; 151 | font-weight: 700; 152 | margin-top: 10px; 153 | margin-bottom: 10px; 154 | } 155 | 156 | .archive-item { 157 | padding-left: 10px; 158 | } 159 | 160 | .error-404 { 161 | padding-top: 20px; 162 | font-size: 60px; 163 | text-align: center; 164 | } 165 | 166 | .cute { 167 | color: var(--berry-main-color); 168 | } 169 | 170 | .block { 171 | &--images { 172 | display: grid; 173 | grid-template-columns: repeat(3, 1fr); 174 | grid-gap: 15px; 175 | margin-bottom: 15px; 176 | position: relative; 177 | 178 | &__withcount { 179 | &::before { 180 | content: '+' attr(data-count); 181 | color: rgba(255, 255, 255, 0.95); 182 | position: absolute; 183 | top: 50%; 184 | right: 50%; 185 | width: 50px; 186 | height: 50px; 187 | background-color: rgba(0, 0, 0, 0.5); 188 | text-align: center; 189 | line-height: 50px; 190 | border-radius: 100%; 191 | transform: translate3d(50%, -50%, 0); 192 | font-size: 20px; 193 | } 194 | } 195 | } 196 | 197 | &--image { 198 | border-radius: 5px; 199 | width: 100%; 200 | // height: 80%; 201 | object-fit: cover; 202 | aspect-ratio: 1 / 0.67; 203 | } 204 | } 205 | 206 | @media (max-width: 768px) { 207 | .block--images { 208 | &::before { 209 | font-size: 12px; 210 | width: 32px; 211 | height: 32px; 212 | line-height: 32px; 213 | } 214 | } 215 | } 216 | 217 | .post--item__status { 218 | padding: 25px 0; 219 | 220 | header { 221 | font-size: 14px; 222 | display: flex; 223 | align-items: center; 224 | color: var(--berry-text-gray-lightest); 225 | .avatar { 226 | width: 24px; 227 | height: 24px; 228 | margin-right: 12px; 229 | border-radius: 3px; 230 | } 231 | 232 | a { 233 | &:hover { 234 | color: var(--berry-text-color); 235 | text-decoration: underline; 236 | } 237 | } 238 | } 239 | 240 | .description { 241 | font-size: 16px; 242 | border-left: 3px solid var(--berry-border-color); 243 | padding-left: 10px; 244 | margin-top: 15px; 245 | line-height: 1.6; 246 | color: var(--berry-text-gray); 247 | } 248 | } 249 | 250 | .notice--wrapper { 251 | background-color: rgba(0, 0, 0, 0.9); 252 | color: #fff; 253 | font-size: var(--berry-text-size-smallest); 254 | max-width: 800px; 255 | padding: 10px 15px; 256 | border-radius: 8px; 257 | position: fixed; 258 | z-index: 1000; 259 | top: 15px; 260 | left: 50%; 261 | transform: translateX(-50%); 262 | transition: 0.5s transform; 263 | } 264 | 265 | @media (max-width: 768px) { 266 | .notice--wrapper { 267 | width: 80%; 268 | } 269 | } 270 | 271 | .sticky--post { 272 | display: flex; 273 | align-items: center; 274 | margin-right: 10px; 275 | 276 | svg { 277 | fill: var(--berry-text-gray-lightest); 278 | margin-right: 5px; 279 | } 280 | } 281 | 282 | .u-relative { 283 | position: relative; 284 | } 285 | -------------------------------------------------------------------------------- /scss/modules/_basic.scss: -------------------------------------------------------------------------------- 1 | html { 2 | scroll-behavior: smooth; 3 | } 4 | 5 | body { 6 | letter-spacing: 0; 7 | font: { 8 | weight: 400; 9 | style: normal; 10 | family: 'Open Sans', PingFang SC, Hiragino Sans GB, Microsoft YaHei, STHeiti, 11 | WenQuanYi Micro Hei, Helvetica, Arial, sans-serif; 12 | size: 16px; 13 | } 14 | text-rendering: optimizeLegibility; 15 | -webkit-font-smoothing: antialiased; 16 | -moz-osx-font-smoothing: grayscale; 17 | -moz-font-feature-settings: 'liga' on; 18 | color: var(--berry-text-color); 19 | line-height: 1.8; 20 | background-color: var(--berry-background-white); 21 | } 22 | 23 | h1, 24 | h2, 25 | h3, 26 | h4, 27 | h5 { 28 | margin-top: 0; 29 | margin-bottom: 0; 30 | font-weight: 400; 31 | } 32 | 33 | ol, 34 | ul { 35 | margin: 0; 36 | padding: 0; 37 | list-style: none; 38 | } 39 | 40 | a { 41 | color: inherit; 42 | text-decoration: none; 43 | } 44 | 45 | img { 46 | max-width: 100%; 47 | height: auto; 48 | } 49 | 50 | p { 51 | margin-top: 0; 52 | margin-bottom: 0; 53 | } 54 | 55 | button, 56 | input, 57 | textarea { 58 | -webkit-appearance: none; 59 | outline: none; 60 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 61 | font-size: 16px; 62 | color: rgba(0, 0, 0, 0.86); 63 | } 64 | 65 | button::-moz-focus-inner, 66 | input::-moz-focus-inner { 67 | border: 0; 68 | padding: 0; 69 | } 70 | 71 | a, 72 | button, 73 | input { 74 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 75 | } 76 | 77 | figcaption { 78 | -webkit-nbsp-mode: normal; 79 | } 80 | 81 | input[disabled] { 82 | cursor: default; 83 | color: rgba(0, 0, 0, 0.8); 84 | background-color: var(--berry-border-color-light); 85 | } 86 | 87 | audio:not([controls]) { 88 | display: none; 89 | height: 0; 90 | } 91 | 92 | [hidden], 93 | template { 94 | display: none; 95 | } 96 | 97 | svg:not(:root) { 98 | overflow: hidden; 99 | } 100 | 101 | .screen-reader-text { 102 | left: -9999px; 103 | position: absolute; 104 | top: -9999px; 105 | } 106 | 107 | .layoutSingleColumn { 108 | max-width: var(--berry-content-width); 109 | margin-right: auto; 110 | margin-left: auto; 111 | width: 90%; 112 | &--page { 113 | max-width: var(--berry-content-width); 114 | } 115 | 116 | &--wide { 117 | max-width: 1180px; 118 | margin-left: auto; 119 | margin-right: auto; 120 | width: 90%; 121 | } 122 | } 123 | 124 | .middotDivider:after { 125 | content: '/'; 126 | margin-left: 8px; 127 | margin-right: 8px; 128 | } 129 | 130 | .u-paddingTop50 { 131 | padding-top: 50px; 132 | } 133 | 134 | @media (max-width: 600px) { 135 | .pagination { 136 | text-align: center; 137 | } 138 | } 139 | 140 | .u-textAlignCenter { 141 | text-align: center; 142 | } 143 | 144 | .error-404 { 145 | font-size: 260px; 146 | padding-top: 50px; 147 | text-align: center; 148 | padding-bottom: 50px; 149 | } 150 | 151 | .page-wrapper { 152 | background-color: #fff; 153 | padding: 30px; 154 | margin-bottom: 50px; 155 | margin-top: 50px; 156 | } 157 | 158 | .post-actions { 159 | padding-bottom: 10px; 160 | } 161 | 162 | .page { 163 | .comments-area { 164 | background-color: #fff; 165 | border-top: 0; 166 | padding-top: 20px; 167 | padding-bottom: 20px; 168 | .layoutSingleColumn { 169 | width: auto; 170 | max-width: none; 171 | } 172 | } 173 | } 174 | 175 | .nav-links { 176 | display: flex; 177 | justify-content: center; 178 | background-color: var(--berry-background-white); 179 | padding: 20px 0; 180 | } 181 | 182 | .pagination { 183 | padding-top: 30px; 184 | padding-bottom: 30px; 185 | .page-numbers { 186 | background-color: var(--berry-background-gray); 187 | color: var(--berry-text-gray); 188 | padding: 3px 12px; 189 | border-radius: 3px; 190 | margin-left: 8px; 191 | margin-right: 8px; 192 | font-size: 14px; 193 | &.current, 194 | &:hover { 195 | background-color: var(--berry-hover-color); 196 | color: var(--berry-background-white); 197 | } 198 | 199 | &.dots { 200 | &:hover { 201 | background-color: var(--berry-background-gray); 202 | color: var(--berry-text-gray); 203 | } 204 | } 205 | 206 | &.current, 207 | &.dots { 208 | cursor: not-allowed; 209 | } 210 | } 211 | } 212 | 213 | @media (max-width: 600px) { 214 | .pagination { 215 | padding-top: 15px; 216 | padding-bottom: 15px; 217 | } 218 | } 219 | 220 | .u-flex { 221 | display: flex; 222 | align-items: center; 223 | align-items: center; 224 | } 225 | 226 | .min-height-100 { 227 | min-height: 75vh; 228 | } 229 | -------------------------------------------------------------------------------- /scss/modules/_comment.scss: -------------------------------------------------------------------------------- 1 | .author-date { 2 | font-size: 12px; 3 | color: var(--berry-text-gray); 4 | } 5 | 6 | .comments-area { 7 | padding-top: 40px; 8 | } 9 | 10 | .comment-reply-title, 11 | .comments-title { 12 | font-weight: 700; 13 | margin-bottom: 10px; 14 | font-size: 16px; 15 | } 16 | 17 | .comment-reply-title { 18 | display: flex; 19 | align-items: center; 20 | small { 21 | margin-left: auto; 22 | font-weight: normal; 23 | color: var(--berry-text-gray); 24 | } 25 | } 26 | 27 | .required { 28 | color: #c00; 29 | } 30 | 31 | .comment-notes { 32 | font-size: 12px; 33 | color: var(--berry-text-gray); 34 | } 35 | 36 | .comment-body { 37 | padding-bottom: 25px; 38 | padding-top: 25px; 39 | position: relative; 40 | } 41 | 42 | .comment { 43 | .avatar { 44 | border-radius: 100%; 45 | float: left; 46 | margin-right: 8px; 47 | } 48 | 49 | .says { 50 | display: none; 51 | } 52 | 53 | .fn { 54 | line-height: 1.2; 55 | display: inline-block; 56 | font-weight: normal; 57 | padding-top: 3px; 58 | font-size: 14px; 59 | color: var(--berry-main-color); 60 | } 61 | 62 | .reply { 63 | } 64 | } 65 | 66 | .comment-metadata { 67 | font-size: 12px; 68 | color: var(--berry-text-gray-lightest); 69 | } 70 | 71 | .comment-content { 72 | font-size: 14px; 73 | color: var(--berry-text-light); 74 | } 75 | 76 | .comment-reply-link { 77 | color: var(--berry-main-color); 78 | border-radius: 3px; 79 | line-height: 1.2; 80 | font-size: 12px; 81 | } 82 | 83 | .comment-meta { 84 | overflow: hidden; 85 | margin-bottom: 5px; 86 | } 87 | 88 | .depth-1 { 89 | & > .children { 90 | margin-left: 50px; 91 | border-left: 3px solid var(--berry-border-color-light); 92 | padding-left: 20px; 93 | margin-bottom: 15px; 94 | .avatar { 95 | width: 32px; 96 | height: 32px; 97 | } 98 | 99 | .comment { 100 | &:first-child { 101 | .comment-body { 102 | padding-top: 10px; 103 | } 104 | } 105 | 106 | &:last-child { 107 | .comment-body { 108 | padding-bottom: 10px; 109 | } 110 | } 111 | } 112 | } 113 | } 114 | 115 | .children { 116 | .comment-body { 117 | padding-top: 15px; 118 | padding-bottom: 15px; 119 | } 120 | } 121 | 122 | .comment-author { 123 | line-height: 1.4; 124 | } 125 | 126 | .comment-form { 127 | label { 128 | display: block; 129 | font-size: 12px; 130 | font-weight: 700; 131 | } 132 | 133 | p { 134 | margin-bottom: 15px; 135 | } 136 | 137 | textarea { 138 | box-sizing: border-box; 139 | padding: 15px; 140 | width: 100%; 141 | resize: none; 142 | background-color: var(--berry-background-white); 143 | border: 1px solid var(--berry-border-color-light); 144 | border-radius: 3px; 145 | color: var(--berry-text-gray); 146 | font-size: 14px; 147 | } 148 | 149 | .submit { 150 | display: inline-block; 151 | background-color: var(--berry-main-color); 152 | color: var(--berry-background-white); 153 | font-size: 14px; 154 | padding: 8px 25px; 155 | border: 0; 156 | border-radius: 3px; 157 | cursor: pointer; 158 | } 159 | 160 | input[type='email'], 161 | input[type='text'], 162 | input[type='url'] { 163 | width: 300px; 164 | border-radius: 3px; 165 | border: 1px solid var(--berry-border-color-light); 166 | line-height: 28px; 167 | padding-left: 10px; 168 | padding-right: 10px; 169 | color: var(--berry-text-gray); 170 | font-size: 14px; 171 | } 172 | } 173 | 174 | .screen-reader-text { 175 | position: absolute; 176 | left: -9999px; 177 | top: -9999px; 178 | } 179 | 180 | .comments-pagination { 181 | padding-top: 25px; 182 | padding-bottom: 25px; 183 | 184 | .page-numbers { 185 | background: var(--berry-background-gray); 186 | border-radius: 3px; 187 | color: var(--berry-text-gray); 188 | font-size: 12px; 189 | line-height: 1; 190 | padding: 5px 8px; 191 | margin: 0 5px; 192 | &:hover, 193 | &.current { 194 | background: var(--berry-hover-color); 195 | color: var(--berry-background-white); 196 | } 197 | } 198 | } 199 | 200 | .logged-in-as { 201 | font-size: 12px; 202 | color: var(--berry-text-gray); 203 | } 204 | 205 | .comment-respond { 206 | padding-top: 30px; 207 | padding-bottom: 30px; 208 | } 209 | 210 | .comment--parent__link { 211 | margin-right: 5px; 212 | color: var(--berry-main-color); 213 | } 214 | 215 | .comment-form-cookies-consent { 216 | #wp-comment-cookies-consent { 217 | display: none; 218 | } 219 | 220 | label { 221 | font-size: 14px; 222 | color: var(--berry-text-gray); 223 | display: flex; 224 | align-items: center; 225 | position: relative; 226 | cursor: pointer; 227 | font-weight: 400; 228 | 229 | &::before { 230 | background-color: var(--berry-background-white); 231 | border: 1px solid var(--berry-border-color); 232 | border-radius: 100%; 233 | height: 16px; 234 | margin-right: 6px; 235 | vertical-align: middle; 236 | width: 16px; 237 | content: ''; 238 | flex: 0 0 auto; 239 | } 240 | } 241 | 242 | input:checked + label { 243 | &::after { 244 | background-color: var(--berry-hover-color); 245 | border-radius: 100%; 246 | content: ''; 247 | position: absolute; 248 | left: 1px; 249 | height: 12px; 250 | margin: 2px; 251 | width: 12px; 252 | flex: 0 0 auto; 253 | } 254 | } 255 | } 256 | 257 | .no-comments { 258 | text-align: center; 259 | padding: 30px 0; 260 | font-size: 14px; 261 | color: var(--berry-text-gray); 262 | } 263 | 264 | .friend--icon { 265 | margin-left: 5px; 266 | 267 | // fill: var(--farallon-main-color); 268 | width: 16px; 269 | height: 16px; 270 | } 271 | -------------------------------------------------------------------------------- /scss/modules/_footer.scss: -------------------------------------------------------------------------------- 1 | .site-footer { 2 | padding-top: 20px; 3 | padding-bottom: 20px; 4 | color: var(--berry-text-gray); 5 | font-size: 14px; 6 | } 7 | 8 | .backToTop { 9 | position: fixed; 10 | right: 60px; 11 | bottom: 50px; 12 | cursor: pointer; 13 | transform: translate3d(200px, 0, 0); 14 | transition: 0.5s; 15 | 16 | .icon { 17 | fill: var(--berry-text-gray); 18 | width: 18px; 19 | height: 18px; 20 | } 21 | 22 | &.is-active { 23 | transform: translate3d(0, 0, 0); 24 | } 25 | 26 | &:hover { 27 | .icon { 28 | fill: var(--berry-main-color); 29 | } 30 | } 31 | } 32 | 33 | .fixed--theme { 34 | position: fixed; 35 | right: 20px; 36 | bottom: 40%; 37 | display: flex; 38 | height: max-content; 39 | background-color: var(--berry-background-white); 40 | border-radius: 0 10px 0 10px; 41 | width: max-content; 42 | padding: 3px; 43 | display: flex; 44 | flex-direction: column; 45 | box-shadow: 0 0 0 1px var(--berry-border-color); 46 | border-radius: 999rem; 47 | 48 | span { 49 | width: 28px; 50 | height: 28px; 51 | cursor: pointer; 52 | border-radius: 100%; 53 | display: flex; 54 | align-items: center; 55 | justify-content: center; 56 | color: var(--berry-text-gray-lightest); 57 | margin-bottom: 5px; 58 | 59 | &:hover { 60 | color: var(--berry-text-color); 61 | } 62 | 63 | &.is-active { 64 | color: var(--berry-text-color); 65 | background-color: var(--berry-background-gray); 66 | } 67 | 68 | &:last-child { 69 | margin-bottom: 0; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /scss/modules/_grap.scss: -------------------------------------------------------------------------------- 1 | .grap { 2 | ol, 3 | ul { 4 | margin-bottom: 15px; 5 | padding-left: 20px; 6 | } 7 | 8 | p { 9 | margin-bottom: 15px; 10 | } 11 | 12 | blockquote { 13 | margin: 0px 0 15px; 14 | padding: 20px; 15 | background-color: var(--berry-background-gray-light); 16 | color: var(--berry-text-gray); 17 | border-radius: 5px; 18 | 19 | p { 20 | &:last-child { 21 | margin-bottom: 0; 22 | } 23 | } 24 | } 25 | 26 | strong { 27 | font-weight: 700; 28 | } 29 | 30 | em { 31 | font-style: italic; 32 | } 33 | 34 | a { 35 | text-decoration: underline; 36 | .svgIcon { 37 | margin-right: 4px; 38 | } 39 | } 40 | 41 | li { 42 | margin-left: 30px; 43 | margin-bottom: 8px; 44 | padding-top: 2px; 45 | &:before { 46 | content: '•'; 47 | box-sizing: border-box; 48 | font-size: 14px; 49 | margin-left: -58px; 50 | padding-right: 15px; 51 | display: inline-block; 52 | text-align: right; 53 | width: 58px; 54 | } 55 | } 56 | 57 | h3 { 58 | color: var(--berry-text-gray-lightest); 59 | font-size: 20px; 60 | } 61 | 62 | h3, 63 | h4 { 64 | margin-top: 30px; 65 | margin-bottom: 10px; 66 | } 67 | 68 | h4 { 69 | color: var(--berry-text-gray); 70 | font-size: 18px; 71 | } 72 | 73 | hr { 74 | margin-top: 52px; 75 | margin-bottom: 42px; 76 | display: block; 77 | border: 0; 78 | text-align: center; 79 | &:before { 80 | content: '...'; 81 | display: inline-block; 82 | margin-left: 0.6em; 83 | color: var(--berry-text-gray); 84 | position: relative; 85 | top: -30px; 86 | font-size: 28px; 87 | letter-spacing: 0.6em; 88 | } 89 | } 90 | 91 | ol { 92 | counter-reset: order; 93 | & > li { 94 | &::before { 95 | content: counter(order, decimal) '.'; 96 | counter-increment: order; 97 | padding-right: 12px; 98 | } 99 | } 100 | } 101 | 102 | code { 103 | font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; 104 | font-size: 14px; 105 | background-color: var(--berry-background-gray-light); 106 | padding: 2px 6px; 107 | border-radius: 3px; 108 | } 109 | 110 | pre { 111 | font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; 112 | font-size: 14px; 113 | background-color: var(--berry-background-gray-light); 114 | padding: 20px; 115 | border-radius: 3px; 116 | overflow-x: auto; 117 | } 118 | 119 | table { 120 | border: 1px solid var(--berry-border-color); 121 | border-collapse: collapse; 122 | margin-bottom: 20px; 123 | margin-left: auto; 124 | margin-right: auto; 125 | font-size: 12px; 126 | color: var(--berry-text-light); 127 | 128 | thead { 129 | tr { 130 | background-color: #f5f5f5; 131 | } 132 | } 133 | 134 | tr { 135 | background-color: #fff; 136 | 137 | &:hover { 138 | & > td { 139 | background-color: #f5f5f5; 140 | background-clip: padding-box; 141 | } 142 | } 143 | } 144 | 145 | td, 146 | th { 147 | border-bottom: 1px solid var(--berry-border-color); 148 | border-right: 1px solid var(--berry-border-color); 149 | transition: background-color 0.25s ease; 150 | height: 40px; 151 | min-width: 0; 152 | box-sizing: border-box; 153 | text-overflow: ellipsis; 154 | vertical-align: middle; 155 | position: relative; 156 | margin: 0; 157 | padding: 0 10px; 158 | } 159 | } 160 | 161 | &--figure { 162 | margin-bottom: 15px; 163 | display: flex; 164 | flex-direction: column; 165 | align-items: center; 166 | 167 | .imageCaption { 168 | font-size: 14px; 169 | color: var(--berry-text-gray-lightest); 170 | text-align: center; 171 | padding-top: 5px; 172 | } 173 | } 174 | 175 | img { 176 | border-radius: 5px; 177 | } 178 | 179 | figure { 180 | max-width: 100%; 181 | margin-bottom: 15px; 182 | display: flex; 183 | flex-direction: column; 184 | align-items: center; 185 | 186 | .wp-caption { 187 | font-size: 14px; 188 | color: var(--berry-text-gray-lightest); 189 | text-align: center; 190 | padding-top: 5px; 191 | } 192 | } 193 | } 194 | 195 | .aligncenter { 196 | display: block; 197 | margin-left: auto; 198 | margin-right: auto; 199 | } 200 | 201 | .alignleft { 202 | float: left; 203 | margin-right: 20px; 204 | } 205 | 206 | .alignright { 207 | float: right; 208 | margin-left: 20px; 209 | } 210 | -------------------------------------------------------------------------------- /scss/modules/_header.scss: -------------------------------------------------------------------------------- 1 | .site-header { 2 | padding-bottom: 20px; 3 | position: relative; 4 | 5 | .bar { 6 | display: flex; 7 | align-items: center; 8 | margin-top: 0px; 9 | } 10 | } 11 | 12 | @media (max-width: 600px) { 13 | .site-header { 14 | padding-bottom: 30px; 15 | } 16 | } 17 | 18 | .subnav-ul { 19 | display: flex; 20 | justify-content: center; 21 | padding: 20px 0; 22 | background-color: var(--berry-background-gray-light); 23 | margin-bottom: 50px; 24 | overflow-x: auto; 25 | 26 | li { 27 | margin-left: 15px; 28 | margin-right: 15px; 29 | font-size: 14px; 30 | flex: 0 0 auto; 31 | 32 | a { 33 | &:hover { 34 | color: var(--berry-hover-gray); 35 | text-decoration: underline; 36 | } 37 | } 38 | } 39 | } 40 | 41 | .sub-menu { 42 | display: none; 43 | } 44 | 45 | .site-title { 46 | font-size: 32px; 47 | line-height: 1.4; 48 | font-weight: bold; 49 | &:hover { 50 | color: var(--berry-hover-color); 51 | } 52 | } 53 | 54 | .site-description { 55 | font-size: 18px; 56 | color: var(--berry-text-gray); 57 | } 58 | 59 | .inputGroup { 60 | position: relative; 61 | display: flex; 62 | align-items: center; 63 | cursor: pointer; 64 | 65 | svg { 66 | fill: rgba(0, 0, 0, 0.54); 67 | } 68 | 69 | .textInput { 70 | display: inline-block; 71 | vertical-align: middle; 72 | width: 1px; 73 | height: 37px; 74 | border: none; 75 | font-size: 14px; 76 | transition: width 0.2s, padding 0.2s; 77 | cursor: pointer; 78 | padding-left: 1px; 79 | padding-right: 0; 80 | 81 | &:focus { 82 | padding-left: 10px; 83 | width: 200px; 84 | cursor: text; 85 | } 86 | } 87 | } 88 | 89 | .socialIcon { 90 | display: flex; 91 | align-items: center; 92 | } 93 | -------------------------------------------------------------------------------- /scss/modules/_normalize.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in iOS. 9 | */ 10 | 11 | html { 12 | line-height: 1.15; /* 1 */ 13 | -webkit-text-size-adjust: 100%; /* 2 */ 14 | } 15 | 16 | /* Sections 17 | ========================================================================== */ 18 | 19 | /** 20 | * Remove the margin in all browsers. 21 | */ 22 | 23 | body { 24 | margin: 0; 25 | } 26 | 27 | /** 28 | * Render the `main` element consistently in IE. 29 | */ 30 | 31 | main { 32 | display: block; 33 | } 34 | 35 | /** 36 | * Correct the font size and margin on `h1` elements within `section` and 37 | * `article` contexts in Chrome, Firefox, and Safari. 38 | */ 39 | 40 | h1 { 41 | font-size: 2em; 42 | margin: 0.67em 0; 43 | } 44 | 45 | /* Grouping content 46 | ========================================================================== */ 47 | 48 | /** 49 | * 1. Add the correct box sizing in Firefox. 50 | * 2. Show the overflow in Edge and IE. 51 | */ 52 | 53 | hr { 54 | box-sizing: content-box; /* 1 */ 55 | height: 0; /* 1 */ 56 | overflow: visible; /* 2 */ 57 | } 58 | 59 | /** 60 | * 1. Correct the inheritance and scaling of font size in all browsers. 61 | * 2. Correct the odd `em` font sizing in all browsers. 62 | */ 63 | 64 | pre { 65 | font-family: monospace, monospace; /* 1 */ 66 | font-size: 1em; /* 2 */ 67 | } 68 | 69 | /* Text-level semantics 70 | ========================================================================== */ 71 | 72 | /** 73 | * Remove the gray background on active links in IE 10. 74 | */ 75 | 76 | a { 77 | background-color: transparent; 78 | } 79 | 80 | /** 81 | * 1. Remove the bottom border in Chrome 57- 82 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 83 | */ 84 | 85 | abbr[title] { 86 | border-bottom: none; /* 1 */ 87 | text-decoration: underline; /* 2 */ 88 | text-decoration: underline dotted; /* 2 */ 89 | } 90 | 91 | /** 92 | * Add the correct font weight in Chrome, Edge, and Safari. 93 | */ 94 | 95 | b, 96 | strong { 97 | font-weight: bolder; 98 | } 99 | 100 | /** 101 | * 1. Correct the inheritance and scaling of font size in all browsers. 102 | * 2. Correct the odd `em` font sizing in all browsers. 103 | */ 104 | 105 | code, 106 | kbd, 107 | samp { 108 | font-family: monospace, monospace; /* 1 */ 109 | font-size: 1em; /* 2 */ 110 | } 111 | 112 | /** 113 | * Add the correct font size in all browsers. 114 | */ 115 | 116 | small { 117 | font-size: 80%; 118 | } 119 | 120 | /** 121 | * Prevent `sub` and `sup` elements from affecting the line height in 122 | * all browsers. 123 | */ 124 | 125 | sub, 126 | sup { 127 | font-size: 75%; 128 | line-height: 0; 129 | position: relative; 130 | vertical-align: baseline; 131 | } 132 | 133 | sub { 134 | bottom: -0.25em; 135 | } 136 | 137 | sup { 138 | top: -0.5em; 139 | } 140 | 141 | /* Embedded content 142 | ========================================================================== */ 143 | 144 | /** 145 | * Remove the border on images inside links in IE 10. 146 | */ 147 | 148 | img { 149 | border-style: none; 150 | } 151 | 152 | /* Forms 153 | ========================================================================== */ 154 | 155 | /** 156 | * 1. Change the font styles in all browsers. 157 | * 2. Remove the margin in Firefox and Safari. 158 | */ 159 | 160 | button, 161 | input, 162 | optgroup, 163 | select, 164 | textarea { 165 | font-family: inherit; /* 1 */ 166 | font-size: 100%; /* 1 */ 167 | line-height: 1.15; /* 1 */ 168 | margin: 0; /* 2 */ 169 | } 170 | 171 | /** 172 | * Show the overflow in IE. 173 | * 1. Show the overflow in Edge. 174 | */ 175 | 176 | button, 177 | input { 178 | /* 1 */ 179 | overflow: visible; 180 | } 181 | 182 | /** 183 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 184 | * 1. Remove the inheritance of text transform in Firefox. 185 | */ 186 | 187 | button, 188 | select { 189 | /* 1 */ 190 | text-transform: none; 191 | } 192 | 193 | /** 194 | * Correct the inability to style clickable types in iOS and Safari. 195 | */ 196 | 197 | button, 198 | [type='button'], 199 | [type='reset'], 200 | [type='submit'] { 201 | -webkit-appearance: button; 202 | } 203 | 204 | /** 205 | * Remove the inner border and padding in Firefox. 206 | */ 207 | 208 | button::-moz-focus-inner, 209 | [type='button']::-moz-focus-inner, 210 | [type='reset']::-moz-focus-inner, 211 | [type='submit']::-moz-focus-inner { 212 | border-style: none; 213 | padding: 0; 214 | } 215 | 216 | /** 217 | * Restore the focus styles unset by the previous rule. 218 | */ 219 | 220 | button:-moz-focusring, 221 | [type='button']:-moz-focusring, 222 | [type='reset']:-moz-focusring, 223 | [type='submit']:-moz-focusring { 224 | outline: 1px dotted ButtonText; 225 | } 226 | 227 | /** 228 | * Correct the padding in Firefox. 229 | */ 230 | 231 | fieldset { 232 | padding: 0.35em 0.75em 0.625em; 233 | } 234 | 235 | /** 236 | * 1. Correct the text wrapping in Edge and IE. 237 | * 2. Correct the color inheritance from `fieldset` elements in IE. 238 | * 3. Remove the padding so developers are not caught out when they zero out 239 | * `fieldset` elements in all browsers. 240 | */ 241 | 242 | legend { 243 | box-sizing: border-box; /* 1 */ 244 | color: inherit; /* 2 */ 245 | display: table; /* 1 */ 246 | max-width: 100%; /* 1 */ 247 | padding: 0; /* 3 */ 248 | white-space: normal; /* 1 */ 249 | } 250 | 251 | /** 252 | * Add the correct vertical alignment in Chrome, Firefox, and Opera. 253 | */ 254 | 255 | progress { 256 | vertical-align: baseline; 257 | } 258 | 259 | /** 260 | * Remove the default vertical scrollbar in IE 10+. 261 | */ 262 | 263 | textarea { 264 | overflow: auto; 265 | } 266 | 267 | /** 268 | * 1. Add the correct box sizing in IE 10. 269 | * 2. Remove the padding in IE 10. 270 | */ 271 | 272 | [type='checkbox'], 273 | [type='radio'] { 274 | box-sizing: border-box; /* 1 */ 275 | padding: 0; /* 2 */ 276 | } 277 | 278 | /** 279 | * Correct the cursor style of increment and decrement buttons in Chrome. 280 | */ 281 | 282 | [type='number']::-webkit-inner-spin-button, 283 | [type='number']::-webkit-outer-spin-button { 284 | height: auto; 285 | } 286 | 287 | /** 288 | * 1. Correct the odd appearance in Chrome and Safari. 289 | * 2. Correct the outline style in Safari. 290 | */ 291 | 292 | [type='search'] { 293 | -webkit-appearance: textfield; /* 1 */ 294 | outline-offset: -2px; /* 2 */ 295 | } 296 | 297 | /** 298 | * Remove the inner padding in Chrome and Safari on macOS. 299 | */ 300 | 301 | [type='search']::-webkit-search-decoration { 302 | -webkit-appearance: none; 303 | } 304 | 305 | /** 306 | * 1. Correct the inability to style clickable types in iOS and Safari. 307 | * 2. Change font properties to `inherit` in Safari. 308 | */ 309 | 310 | ::-webkit-file-upload-button { 311 | -webkit-appearance: button; /* 1 */ 312 | font: inherit; /* 2 */ 313 | } 314 | 315 | /* Interactive 316 | ========================================================================== */ 317 | 318 | /* 319 | * Add the correct display in Edge, IE 10+, and Firefox. 320 | */ 321 | 322 | details { 323 | display: block; 324 | } 325 | 326 | /* 327 | * Add the correct display in all browsers. 328 | */ 329 | 330 | summary { 331 | display: list-item; 332 | } 333 | 334 | /* Misc 335 | ========================================================================== */ 336 | 337 | /** 338 | * Add the correct display in IE 10+. 339 | */ 340 | 341 | template { 342 | display: none; 343 | } 344 | 345 | /** 346 | * Add the correct display in IE 10. 347 | */ 348 | 349 | [hidden] { 350 | display: none; 351 | } 352 | -------------------------------------------------------------------------------- /scss/modules/_variable.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | // --berry-main-color: #27ae60; 3 | --berry-main-color: #5f4b8b; //#4370f5; 4 | --berry-hover-color: #654ea3; // #3a5f9a; 5 | --berry-text-color: rgba(0, 0, 0, 0.84); 6 | --berry-text-light: rgba(0, 0, 0, 0.68); 7 | --berry-text-gray: rgba(0, 0, 0, 0.6); 8 | --berry-text-gray-lightest: rgba(0, 0, 0, 0.5); 9 | 10 | --berry-background-white: rgba(255, 255, 255, 1); 11 | --berry-background-gray: #f0f0f0; 12 | --berry-background-gray-light: #f9f9f9; 13 | --berry-background-opacity: 0.9; 14 | --berry-background-white-opacity: rgba(255, 255, 255, var(--berry-background-opacity)); 15 | 16 | --berry-border-color: rgba(0, 0, 0, 0.1); 17 | --berry-border-color-light: rgba(0, 0, 0, 0.05); 18 | 19 | --berry-text-size-small: 14px; 20 | --berry-text-size-normal: 16px; 21 | --berry-text-size-smallest: 12px; 22 | 23 | --berry-content-width: 836px; 24 | 25 | --db-main-color: var(--berry-main-color); 26 | --db-hover-color: var(--berry-hover-color); 27 | --db--text-color: var(--berry-text-color); 28 | --db--text-color-light: var(--berry-text-light); 29 | --db--background-gray: var(--berry-background-gray); 30 | --db-border-color: var(--berry-border-color); 31 | 32 | .db--genreItem { 33 | &:hover { 34 | color: var(--berry-backgroud-white); 35 | } 36 | } 37 | } 38 | 39 | @media (prefers-color-scheme: dark) { 40 | .auto { 41 | // --berry-main-color: rgba(253, 186, 116, 1); 42 | // --berry-hover-color: rgba(255, 237, 213, 1); 43 | --berry-text-color: #a1a1aa; 44 | --berry-text-light: rgba(161, 161, 170, 1); 45 | --berry-text-gray: rgba(113, 113, 122, 1); 46 | --berry-text-gray-lightest: rgba(113, 113, 122, 0.95); 47 | 48 | --berry-background-white: #1e1e1e; 49 | --berry-background-gray: #000; 50 | --berry-background-gray-light: #121212; 51 | --berry-background-white-opacity: rgba(30, 30, 30, var(--berry-background-opacity)); 52 | 53 | --berry-border-color: rgba(63, 63, 70, 0.6); 54 | --berry-border-color-light: rgba(63, 63, 70, 0.4); 55 | 56 | --db-main-color: var(--berry-main-color); 57 | --db-hover-color: var(--berry-hover-color); 58 | --db--text-color: var(--berry-text-color); 59 | --db--text-color-light: var(--berry-text-light); 60 | --db--background-gray: var(--berry-background-gray); 61 | --db-border-color: var(--berry-border-color); 62 | 63 | .db--genreItem { 64 | &:hover { 65 | color: var(--berry-backgroud-white); 66 | } 67 | } 68 | 69 | .doulist-item { 70 | border-color: var(--db-border-color); 71 | } 72 | 73 | .comment-form { 74 | // input, 75 | // textarea { 76 | // background-color: rgba(63, 63, 70, 0.15); 77 | // border-color: rgba(63, 63, 70, 1); 78 | // } 79 | } 80 | } 81 | } 82 | 83 | .dark { 84 | // --berry-main-color: rgba(253, 186, 116, 1); 85 | // --berry-hover-color: rgba(255, 237, 213, 1); 86 | --berry-text-color: #a1a1aa; 87 | --berry-text-light: rgba(161, 161, 170, 1); 88 | --berry-text-gray: rgba(113, 113, 122, 1); 89 | --berry-text-gray-lightest: rgba(113, 113, 122, 0.95); 90 | 91 | --berry-background-white: #1e1e1e; 92 | --berry-background-gray: #000; 93 | --berry-background-gray-light: #121212; 94 | --berry-background-white-opacity: rgba(30, 30, 30, var(--berry-background-opacity)); 95 | 96 | --berry-border-color: rgba(63, 63, 70, 0.6); 97 | --berry-border-color-light: rgba(63, 63, 70, 0.4); 98 | 99 | --db-main-color: var(--berry-main-color); 100 | --db-hover-color: var(--berry-hover-color); 101 | --db--text-color: var(--berry-text-color); 102 | --db--text-color-light: var(--berry-text-light); 103 | --db--background-gray: var(--berry-background-gray); 104 | --db-border-color: var(--berry-border-color); 105 | 106 | .db--genreItem { 107 | &:hover { 108 | color: var(--berry-backgroud-white); 109 | } 110 | } 111 | 112 | .doulist-item { 113 | border-color: var(--db-border-color); 114 | } 115 | 116 | .comment-form { 117 | // input, 118 | // textarea { 119 | // background-color: rgba(63, 63, 70, 0.15); 120 | // border-color: rgba(63, 63, 70, 1); 121 | // } 122 | } 123 | } 124 | 125 | @font-face { 126 | font-family: 'Open Sans'; 127 | src: url('../fonts/OpenSans-Regular.woff2') format('woff2'), 128 | url('../fonts/OpenSans-Regular.woff') format('woff'); 129 | font-weight: 400; 130 | font-style: normal; 131 | font-display: swap; 132 | } 133 | 134 | @font-face { 135 | font-family: 'Open Sans'; 136 | src: url('../fonts/OpenSans-Bold.woff2') format('woff2'), 137 | url('../fonts/OpenSans-Bold.woff') format('woff'); 138 | font-weight: 700; 139 | font-style: normal; 140 | font-display: swap; 141 | } 142 | 143 | @font-face { 144 | font-family: 'Open Sans'; 145 | src: url('../fonts/OpenSans-Light.woff2') format('woff2'), 146 | url('../fonts/OpenSans-Light.woff') format('woff'); 147 | font-weight: 200; 148 | font-style: normal; 149 | font-display: swap; 150 | } 151 | 152 | @font-face { 153 | font-family: 'Open Sans'; 154 | src: url('../fonts/OpenSans-Medium.woff2') format('woff2'), 155 | url('../fonts/OpenSans-Medium.woff') format('woff'); 156 | font-weight: 500; 157 | font-style: normal; 158 | font-display: swap; 159 | } 160 | -------------------------------------------------------------------------------- /scss/setting.scss: -------------------------------------------------------------------------------- 1 | .dashicons-basic:before { 2 | content: '\f108'; 3 | } 4 | 5 | .dashicons-slider:before { 6 | content: '\f232'; 7 | } 8 | 9 | .dashicons-feature:before { 10 | content: '\f475'; 11 | } 12 | 13 | .dashicons-interface:before { 14 | content: '\f100'; 15 | } 16 | 17 | .dashicons-social-contact:before { 18 | content: '\f304'; 19 | } 20 | 21 | .dashicons-save:before { 22 | content: '\f480'; 23 | } 24 | 25 | a:focus { 26 | box-shadow: none; 27 | } 28 | 29 | .pure-wrap { 30 | display: flex; 31 | align-items: flex-start; 32 | } 33 | .pure-help-li { 34 | font-size: 16px; 35 | padding: 30px; 36 | border-bottom: 1px #eee dotted; 37 | 38 | span { 39 | text-decoration: none; 40 | } 41 | } 42 | 43 | .pure-help-title { 44 | font-size: 24px; 45 | font-weight: 300; 46 | color: #626773; 47 | } 48 | 49 | #pure-form { 50 | padding: 30px; 51 | min-height: 400px; 52 | background: #fff; 53 | border-radius: 5px; 54 | overflow: hidden; 55 | flex: 1 1 auto; 56 | } 57 | 58 | .leftpanel .nav { 59 | margin: 0; 60 | padding: 50px 0 0; 61 | display: flex; 62 | flex-direction: column; 63 | 64 | li { 65 | font-size: 16px; 66 | margin-bottom: 0; 67 | position: relative; 68 | & > span { 69 | color: #626773; 70 | border-radius: 0; 71 | transition: all 0.2s ease-out 0s; 72 | padding: 15px 25px; 73 | display: block; 74 | cursor: pointer; 75 | 76 | i { 77 | width: 16px; 78 | margin-right: 5px; 79 | color: #626773; 80 | font-size: 15px; 81 | top: 1px; 82 | text-align: center; 83 | } 84 | } 85 | 86 | &.active { 87 | span { 88 | background-color: #fff; 89 | border-radius: 5px 0 0 5px; 90 | color: #455473; 91 | } 92 | } 93 | } 94 | } 95 | 96 | .pure-setting-radio { 97 | display: inline-block; 98 | cursor: pointer; 99 | margin-right: 20px; 100 | user-select: none; 101 | 102 | .dashicons-before { 103 | width: 18px; 104 | height: 18px; 105 | border: 1px solid #d3cfc8; 106 | border-radius: 50%; 107 | vertical-align: middle; 108 | display: inline-block; 109 | margin-right: 5px; 110 | position: relative; 111 | } 112 | 113 | &.checked { 114 | .dashicons-before { 115 | &::before { 116 | content: '\f147'; 117 | background-color: #0074a2; 118 | color: #fff; 119 | border-radius: 50%; 120 | top: -1px; 121 | left: -1px; 122 | text-indent: -1px; 123 | position: absolute; 124 | animation: loader-spinner 300ms linear 1; 125 | } 126 | } 127 | } 128 | } 129 | 130 | .form-table { 131 | th { 132 | width: 140px; 133 | padding: 0; 134 | } 135 | 136 | td { 137 | padding: 0 0 40px 0; 138 | } 139 | 140 | tr th label, 141 | tr td label { 142 | color: #455473; 143 | font-weight: normal; 144 | font-size: 16px; 145 | } 146 | } 147 | 148 | input.large-text, 149 | textarea.large-text { 150 | width: 100%; 151 | } 152 | 153 | textarea.code { 154 | line-height: 1.4; 155 | padding: 2%; 156 | } 157 | 158 | .pure-setting-switch { 159 | display: inline-block; 160 | height: 18px; 161 | width: 42px; 162 | border: 1px solid #cfd6e5; 163 | border-radius: 9px; 164 | background: #fff; 165 | position: relative; 166 | i { 167 | position: absolute; 168 | top: 2px; 169 | left: 2px; 170 | width: 12px; 171 | height: 12px; 172 | border-radius: 12px; 173 | border: 1px solid #cfd6e5; 174 | transition: all 0.3s ease-out; 175 | animation: loader-spinner 400ms linear 1; 176 | } 177 | &.active { 178 | i { 179 | left: 26px; 180 | &:after { 181 | content: ''; 182 | position: absolute; 183 | width: 12px; 184 | height: 12px; 185 | border-radius: 12px; 186 | border: 1px solid #0074a2; 187 | background-color: #0074a2; 188 | left: -1px; 189 | top: -1px; 190 | animation: loader-spinner 400ms linear 1; 191 | } 192 | } 193 | } 194 | } 195 | 196 | @keyframes loader-spinner { 197 | 0% { 198 | transform: scale(0); 199 | } 200 | 80% { 201 | transform: scale(1.2); 202 | } 203 | 100% { 204 | transform: scale(1); 205 | } 206 | } 207 | 208 | .pure-save { 209 | padding-top: 60px; 210 | display: flex; 211 | align-items: center; 212 | } 213 | 214 | .button--save { 215 | color: rgb(255, 255, 255); 216 | background-color: #737f99; 217 | padding: 10px 20px; 218 | text-decoration: none; 219 | line-height: 1.4; 220 | text-align: center; 221 | font-size: 16px; 222 | cursor: pointer; 223 | transition: all 0.3s linear; 224 | border-radius: 3px; 225 | &:hover { 226 | background: #455473; 227 | } 228 | } 229 | 230 | .pure-docs { 231 | display: flex; 232 | padding-bottom: 10px; 233 | align-items: center; 234 | } 235 | -------------------------------------------------------------------------------- /scss/templates/_map.scss: -------------------------------------------------------------------------------- 1 | .footer--map { 2 | height: 550px; 3 | } 4 | 5 | .mapboxgl-ctrl-attrib-inner { 6 | display: none; 7 | } 8 | 9 | .mapboxgl-ctrl-bottom-left { 10 | display: none; 11 | } 12 | 13 | .map--container { 14 | max-width: 1000px; 15 | margin-left: auto; 16 | margin-right: auto; 17 | } 18 | 19 | .page--header { 20 | padding: 20px 0; 21 | text-align: center; 22 | } 23 | 24 | .markerPro { 25 | &--posts { 26 | grid-template-columns: repeat(2, 1fr); 27 | grid-gap: 16px; 28 | display: grid; 29 | // padding-bottom: 30px; 30 | } 31 | 32 | &--addon { 33 | padding-top: 30px; 34 | } 35 | 36 | &--post { 37 | box-shadow: none; 38 | transition: 1s background-position; 39 | background-color: var(--berry-background-gray-light); 40 | color: var(--berry-text-gray); 41 | border-radius: 10px; 42 | display: flex; 43 | flex-direction: column; 44 | justify-content: flex-start; 45 | position: relative; 46 | min-width: 0; 47 | background-size: cover; 48 | background-position: center; 49 | background-repeat: no-repeat; 50 | text-decoration: none !important; 51 | 52 | .markerPro--content { 53 | flex: 1 1 auto; 54 | padding: 15px; 55 | display: flex; 56 | flex-direction: column; 57 | } 58 | 59 | &__hera { 60 | &::before { 61 | display: none; 62 | } 63 | flex-direction: row; 64 | img { 65 | width: 110px; 66 | height: 110px; 67 | object-fit: cover; 68 | border-radius: 0 8px 8px 0; 69 | } 70 | } 71 | } 72 | 73 | &--title { 74 | position: relative; 75 | margin: 3px 0; 76 | font-size: 14px; 77 | font-weight: bold; 78 | line-height: 1.4; 79 | white-space: nowrap; 80 | overflow: hidden; 81 | text-overflow: ellipsis; 82 | max-width: 100%; 83 | font-size: 16px; 84 | color: var(--berry-text-color); 85 | 86 | a { 87 | text-decoration: none; 88 | &:hover { 89 | color: var(--berry-hover-color); 90 | } 91 | } 92 | } 93 | 94 | &--meta { 95 | display: flex; 96 | align-items: center; 97 | font-size: 12px; 98 | // color: rgba(255, 255, 255, 0.9); 99 | display: flex; 100 | align-items: center; 101 | position: relative; 102 | margin-top: auto; 103 | 104 | .flag { 105 | width: 24px; 106 | height: 24px; 107 | margin-left: auto; 108 | } 109 | } 110 | 111 | &--addonTitle { 112 | font-size: 18px; 113 | font-weight: bold; 114 | margin-bottom: 10px; 115 | } 116 | } 117 | 118 | @media screen and (max-width: 768px) { 119 | .markerPro--posts { 120 | grid-template-columns: 1fr; 121 | } 122 | } 123 | 124 | .sep { 125 | &:before { 126 | content: '·'; 127 | margin: 0 3px; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /scss/templates/_single.scss: -------------------------------------------------------------------------------- 1 | .postFooter--simple { 2 | display: flex; 3 | flex-direction: column; 4 | justify-content: center; 5 | align-items: center; 6 | padding-top: 30px; 7 | padding-bottom: 30px; 8 | .postFooter-author, 9 | .postFooter-collection { 10 | margin-bottom: 5px; 11 | font-size: 18px; 12 | font-weight: 700; 13 | a { 14 | &:hover { 15 | color: var(--berry-hover-color); 16 | } 17 | } 18 | } 19 | .postFooter-info, 20 | .postFooter-translators { 21 | font-size: 14px; 22 | color: var(--berry-text-gray); 23 | padding: 0 20%; 24 | line-height: 1.4; 25 | } 26 | } 27 | 28 | .card-image--collection { 29 | width: 80px; 30 | height: 80px; 31 | border-radius: 3px; 32 | background: #f0f0f0; 33 | } 34 | 35 | .collectionAvatar { 36 | display: flex; 37 | } 38 | 39 | .button--link, 40 | .button--chromeless { 41 | -webkit-border-radius: 0; 42 | -moz-border-radius: 0; 43 | border-radius: 0; 44 | -webkit-box-shadow: none; 45 | -moz-box-shadow: none; 46 | box-shadow: none; 47 | background: rgba(0, 0, 0, 0); 48 | height: auto; 49 | line-height: inherit; 50 | border-width: 0; 51 | padding: 0; 52 | vertical-align: baseline; 53 | color: rgba(0, 0, 0, 0.3); 54 | white-space: normal; 55 | } 56 | 57 | .page-title { 58 | font-weight: 700; 59 | font-size: 22px; 60 | } 61 | 62 | .taxonomy-description { 63 | font-size: 14px; 64 | color: var(--berry-text-gray); 65 | line-height: 1.4; 66 | padding: 0 10%; 67 | margin-top: 10px; 68 | } 69 | 70 | .archive-header { 71 | padding-bottom: 30px; 72 | } 73 | 74 | .articleRelated { 75 | display: grid; 76 | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 77 | grid-gap: 15px; 78 | padding-bottom: 20px; 79 | 80 | &__status { 81 | padding: 12px; 82 | border-radius: 8px; 83 | background-color: var(--berry-background-gray-light); 84 | 85 | p { 86 | font-size: 14px; 87 | line-height: 1.4; 88 | color: var(--berry-text-gray); 89 | } 90 | 91 | .meta { 92 | font-size: 12px; 93 | color: var(--berry-text-gray-lightest); 94 | line-height: 1; 95 | margin-top: 5px; 96 | display: flex; 97 | align-items: center; 98 | 99 | svg { 100 | fill: var(--berry-text-gray-lightest); 101 | margin-right: 5px; 102 | } 103 | } 104 | } 105 | 106 | &__item { 107 | padding: 10px; 108 | border-radius: 8px; 109 | background-color: var(--berry-background-gray-light); 110 | 111 | &__title { 112 | font-size: 16px; 113 | line-height: 1.4; 114 | overflow: hidden; 115 | text-overflow: ellipsis; 116 | white-space: nowrap; 117 | 118 | &:hover { 119 | color: var(--berry-hover-color); 120 | } 121 | } 122 | 123 | .meta { 124 | font-size: 12px; 125 | color: var(--berry-text-gray-lightest); 126 | line-height: 1; 127 | margin-top: 5px; 128 | } 129 | } 130 | 131 | .block--images { 132 | /* two columns */ 133 | grid-template-columns: repeat(3, 1fr); 134 | grid-gap: 8px; 135 | margin-bottom: 0; 136 | padding-bottom: 5px; 137 | position: relative; 138 | 139 | .block--image { 140 | /* straggle image */ 141 | aspect-ratio: 1 / 0.67; 142 | border-radius: 5px; 143 | object-fit: cover; 144 | } 145 | } 146 | } 147 | 148 | .related--posts__title { 149 | font-weight: bold; 150 | font-size: 14px; 151 | padding-bottom: 5px; 152 | } 153 | 154 | .postFooter-actions { 155 | display: flex; 156 | justify-content: center; 157 | align-items: center; 158 | margin-top: 20px; 159 | .postFooter-action { 160 | margin-right: 10px; 161 | font-size: 14px; 162 | color: var(--berry-text-gray); 163 | text-decoration: none; 164 | &:last-child { 165 | margin-right: 0; 166 | } 167 | } 168 | 169 | .button--like, 170 | .button--share { 171 | border: 0; 172 | background-color: rgba(0, 0, 0, 0); 173 | cursor: pointer; 174 | display: flex; 175 | align-items: center; 176 | 177 | &.is-active { 178 | svg { 179 | fill: var(--berry-main-color); 180 | } 181 | 182 | .icon--active { 183 | display: block; 184 | } 185 | 186 | .icon--default { 187 | display: none; 188 | } 189 | } 190 | 191 | .icon--active { 192 | display: none; 193 | } 194 | 195 | .icon--block { 196 | display: none; 197 | } 198 | } 199 | 200 | .button--like { 201 | svg { 202 | fill: var(--berry-text-gray); 203 | } 204 | 205 | &:hover, 206 | &.is-active { 207 | svg { 208 | fill: var(--berry-hover-color); 209 | } 210 | } 211 | } 212 | } 213 | 214 | .berry--toc { 215 | summary { 216 | margin-bottom: 3px; 217 | cursor: pointer; 218 | } 219 | 220 | font-size: 14px; 221 | background-color: var(--berry-background-gray-light); 222 | padding: 10px 15px; 223 | border-radius: 5px; 224 | margin-bottom: 15px; 225 | li { 226 | margin-bottom: 0; 227 | line-height: 1.4; 228 | 229 | &::before { 230 | width: 42px; 231 | margin-left: -42px; 232 | padding-right: 8px; 233 | } 234 | 235 | a { 236 | text-decoration: none; 237 | &:hover { 238 | color: var(--berry-main-color); 239 | } 240 | } 241 | } 242 | 243 | ul { 244 | padding-left: 5px; 245 | margin-bottom: 0; 246 | } 247 | } 248 | 249 | .link-title { 250 | font-weight: bold; 251 | } 252 | 253 | .link-description { 254 | font-size: 14px; 255 | line-height: 1.4; 256 | color: var(--berry-text-gray); 257 | margin-top: 5px; 258 | } 259 | 260 | .link-items { 261 | display: grid; 262 | grid-template-columns: repeat(4, 1fr); 263 | grid-gap: 15px; 264 | padding-bottom: 20px; 265 | padding-top: 20px; 266 | 267 | .link-item { 268 | .avatar { 269 | width: 32px; 270 | height: 32px; 271 | border-radius: 50%; 272 | } 273 | 274 | border-radius: 5px; 275 | background-color: var(--berry-background-gray-light); 276 | padding: 10px; 277 | display: flex; 278 | flex-direction: column; 279 | font-size: 14px; 280 | 281 | .sitename { 282 | font-size: 12px; 283 | line-height: 1.4; 284 | color: var(--berry-text-gray); 285 | max-height: 2.8em; 286 | overflow: hidden; 287 | text-overflow: ellipsis; 288 | display: -webkit-box; 289 | -webkit-line-clamp: 2; 290 | -webkit-box-orient: vertical; 291 | } 292 | } 293 | } 294 | 295 | .collectionCard { 296 | display: grid; 297 | grid-template-columns: repeat(3, 1fr); 298 | grid-gap: 15px; 299 | padding-top: 20px; 300 | 301 | &--item { 302 | border-radius: 5px; 303 | background-color: var(--berry-background-gray-light); 304 | padding: 8px; 305 | display: flex; 306 | flex-direction: column; 307 | } 308 | 309 | &--title { 310 | font-size: 14px; 311 | line-height: 1.4; 312 | } 313 | 314 | &--image { 315 | width: 100%; 316 | height: 100px; 317 | object-fit: cover; 318 | border-radius: 5px; 319 | margin-bottom: 5px; 320 | } 321 | 322 | &--description { 323 | font-size: 12px; 324 | line-height: 1.4; 325 | color: var(--berry-text-gray); 326 | max-height: 2.8em; 327 | overflow: hidden; 328 | text-overflow: ellipsis; 329 | display: -webkit-box; 330 | -webkit-line-clamp: 2; 331 | -webkit-box-orient: vertical; 332 | -webkit-box-pack: center; 333 | -webkit-box-align: center; 334 | -webkit-box-direction: normal; 335 | -webkit-box-flex: 1; 336 | } 337 | } 338 | 339 | .author--card { 340 | position: absolute; 341 | top: 0; 342 | left: -200px; 343 | padding-top: 80px; 344 | max-width: 170px; 345 | 346 | &__avatar { 347 | display: flex; 348 | .avatar { 349 | width: 36px; 350 | height: 36px; 351 | border-radius: 50%; 352 | } 353 | margin-bottom: 5px; 354 | } 355 | 356 | &__name { 357 | font-size: 16px; 358 | font-weight: bold; 359 | line-height: 1.4; 360 | a { 361 | &:hover { 362 | color: var(--berry-hover-color); 363 | } 364 | } 365 | } 366 | 367 | &__desc { 368 | font-size: 14px; 369 | color: var(--berry-text-gray-lightest); 370 | line-height: 1.5; 371 | } 372 | } 373 | 374 | @media (max-width: 1180px) { 375 | .author--card { 376 | display: none; 377 | } 378 | } 379 | 380 | .post-navigation { 381 | .article + & { 382 | margin-top: 10px; 383 | } 384 | 385 | display: flex; 386 | justify-content: space-between; 387 | 388 | .nav-previous, 389 | .nav-next { 390 | width: 49%; 391 | box-sizing: border-box; 392 | border-radius: 10px; 393 | 394 | a { 395 | display: flex; 396 | flex-direction: column; 397 | } 398 | 399 | .cover { 400 | border-radius: 8px; 401 | height: 170px; 402 | object-fit: cover; 403 | } 404 | 405 | text-align: right; 406 | background-origin: border-box; 407 | background-clip: padding-box, border-box; 408 | border: 1px solid transparent; 409 | 410 | .cover--link { 411 | position: relative; 412 | .marker--tips { 413 | position: absolute; 414 | bottom: 5px; 415 | right: 5px; 416 | background-color: #f8f8f8; 417 | border-radius: 5px; 418 | padding: 5px; 419 | font-size: 12px; 420 | color: var(--berry-text-gray); 421 | line-height: 1; 422 | } 423 | } 424 | } 425 | 426 | .nav-previous { 427 | text-align: left; 428 | } 429 | 430 | .meta-nav { 431 | font-size: 12px; 432 | text-transform: uppercase; 433 | color: var(--berry-text-gray); 434 | } 435 | 436 | .post-title { 437 | font-size: 14px; 438 | margin-bottom: 10px; 439 | &:hover { 440 | color: var(--berry-hover-color); 441 | } 442 | } 443 | } 444 | 445 | @media (max-width: 720px) { 446 | .post-navigation { 447 | flex-direction: column; 448 | 449 | .nav-previous, 450 | .nav-next { 451 | width: 100%; 452 | margin-bottom: 10px; 453 | text-align: center; 454 | } 455 | } 456 | } 457 | -------------------------------------------------------------------------------- /scss/templates/_term.scss: -------------------------------------------------------------------------------- 1 | .term--header { 2 | display: flex; 3 | align-items: center; 4 | flex-direction: column; 5 | justify-content: center; 6 | padding-bottom: 20px; 7 | 8 | .term--image { 9 | width: 80px; 10 | height: 80px; 11 | border-radius: 3px; 12 | object-fit: cover; 13 | margin-bottom: 10px; 14 | } 15 | 16 | &__content { 17 | text-align: center; 18 | 19 | .term--title { 20 | font-size: 20px; 21 | font-weight: 700; 22 | } 23 | 24 | .term--description { 25 | font-size: 14px; 26 | color: var(--berry-text-light); 27 | } 28 | } 29 | } 30 | 31 | .month-posts { 32 | background-color: var(--berry-background-gray-light); 33 | border-radius: 5px; 34 | } 35 | 36 | .month-post { 37 | padding: 15px; 38 | display: flex; 39 | flex-direction: column; 40 | border-bottom: 1px solid var(--berry-border-color-light); 41 | 42 | &:last-child { 43 | border-bottom: none; 44 | } 45 | 46 | .post-time { 47 | font-size: 12px; 48 | color: var(--berry-text-gray-lightest); 49 | } 50 | 51 | a { 52 | &:hover { 53 | color: var(--berry-hover-color); 54 | } 55 | } 56 | } 57 | 58 | .page-archive-title { 59 | font-size: 28px; 60 | font-weight: 700; 61 | } 62 | -------------------------------------------------------------------------------- /single.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |
    6 | get_setting('bio')) : ?> 7 |
    8 |
    9 | 10 |
    11 |
    12 |

    13 | 14 |

    15 |

    16 | 17 |

    18 |
    19 |
    20 | 21 | 38 |

    39 | 40 |

    41 |
    42 | 43 |
    44 | '', 47 | 'pagelink' => '%', 48 | 'separator' => ', ', 49 | )); ?> 50 | '; 54 | foreach ($tags as $tag) { 55 | echo ' 56 | 57 | 58 | 59 | 60 | ' . $tag->name . ''; 61 | } 62 | echo '
  • '; 63 | } ?> 64 |
    65 | get_setting('category_card')) : 67 | $category = $categories[0]; 68 | ?> 69 | term_id, '_thumb', true)) : ?> 70 | 71 | 72 | 73 | 74 |

    75 | name; ?> 76 |

    77 |
    78 | description; ?> 79 |
    80 | 81 |
    82 | get_setting('postlike')) : ?> 83 | 92 | 93 | get_setting('show_copylink')) : ?> 94 | 99 | 100 |
    101 |
    102 | get_setting('post_navigation')) get_template_part('template-part/post', 'navigation'); ?> 103 | 108 | get_setting('related')) get_template_part('template-part/single', 'related'); ?> 109 | 110 | 111 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Berry 3 | Theme URI: https://fatesinger.com/100095 4 | Author: bigfa 5 | Author URI: https://github.com/bigfa 6 | Description: theme 2018 7 | Version: 2.0.8 8 | License: GNU General Public License v2 or later 9 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 | 11 | This theme, like WordPress, is licensed under the GPL. 12 | Use it to make something cool, have fun, and share what you've learned with others. 13 | */ 14 | -------------------------------------------------------------------------------- /template-part/post-navigation.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /template-part/post/content-card.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 4 | 5 |
    6 | 7 | 8 | 9 | 12 |
    13 |
    14 |
    15 | 16 |
    17 | 18 | 0) : ?> 19 |
    20 | '; 24 | } 25 | } 26 | ?> 27 |
    28 | 29 |
    30 | 31 |
    32 |
    33 | 36 |
    37 |
    38 |
    39 | -------------------------------------------------------------------------------- /template-part/post/content-status.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 5 | 8 |
    9 | 10 |
    11 | 12 |
    13 |
    -------------------------------------------------------------------------------- /template-part/post/content.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
    4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
    14 | 17 | 18 | 19 |
    20 | 27 |
    28 |

    29 | 30 |

    31 |
    32 |

    33 | post_content))), 0, 380, "..."); 38 | } 39 | ?> 40 |

    41 | get_setting('hide_home_cover') && berry_get_post_image_count(get_the_ID()) > 0) : ?> 42 |
    43 | '; 47 | } 48 | } 49 | ?> 50 |
    51 | 52 |

    53 | read more.. 54 |

    55 |
    56 |
    -------------------------------------------------------------------------------- /template-part/single-related.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 'post', 7 | 'post__not_in' => array(get_the_ID()), 8 | 'orderby' => 'rand', 9 | 'ignore_sticky_posts' => true, 10 | 'posts_per_page' => 2, 11 | 'category__in' => wp_get_post_categories(get_the_ID()), 12 | 'tax_query' => get_post_format(get_the_ID()) ? array( // same post format 13 | array( 14 | 'taxonomy' => 'post_format', 15 | 'field' => 'slug', 16 | 'terms' => array('post-format-' . get_post_format(get_the_ID())), 17 | 'operator' => 'IN' 18 | ) 19 | ) : array() 20 | )); 21 | while ($the_query->have_posts()) : $the_query->the_post(); ?> 22 | 23 | 25 |
    -------------------------------------------------------------------------------- /tpl/page-map.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 |
    10 |
    11 | 16 |
    17 | 18 |
    19 |
    20 |
    21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tpl/template-archive.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
    8 |
    9 |

    10 |
    11 |
    12 | -1, 15 | 'post_type' => array('post'), 16 | 'ignore_sticky_posts' => 1, 17 | ); 18 | $the_query = new WP_Query($args); 19 | $posts = []; 20 | 21 | $all = []; 22 | $output = ''; 23 | while ($the_query->have_posts()) : $the_query->the_post(); 24 | $posts[] = [ 25 | 'title' => get_the_title(), 26 | 'permalink' => get_permalink(), 27 | 'time' => get_the_time('Y-m-d'), 28 | 'year' => get_the_time('Y'), 29 | 'mon' => get_the_time('n'), 30 | ]; 31 | endwhile; 32 | wp_reset_postdata(); 33 | // group post by year 34 | foreach ($posts as $key => $val) { 35 | $all[$val['year']][$val['mon']][] = $val; 36 | } 37 | 38 | // list years 39 | 40 | $years = array_keys($all); 41 | // echo ''; 46 | 47 | // list posts 48 | foreach ($all as $year => $months) { 49 | echo '
    '; 50 | echo '

    ' . $year . '

    '; 51 | foreach ($months as $mon => $posts) { 52 | echo '

    ' . $mon . ' 月

    '; 53 | echo '
      '; 54 | foreach ($posts as $post) { 55 | echo '
    • ' . $post['title'] . '' . $post['time'] . '
    • '; 56 | } 57 | echo '
    '; 58 | } 59 | echo '
    '; 60 | } 61 | 62 | ?> 63 |
    64 |
    65 | -------------------------------------------------------------------------------- /tpl/template-links.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 |
    11 |
    12 | 13 |
    14 |

    15 |
    16 | 17 | 18 |
    19 |
    20 | 21 | -------------------------------------------------------------------------------- /tpl/template-terms.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
    8 | 9 |
    10 |
    11 |

    12 |
    13 |
    14 | 'category', 16 | 'hide_empty' => false, 17 | // 'orderby' => 'meta_value_num', 18 | 'order' => 'DESC', 19 | // 'meta_key' => '_views', 20 | ]); 21 | foreach ($categories as $category) { 22 | $link = get_term_link($category, 'category') 23 | ?> 24 | 25 | term_id, '_thumb', true)) : ?> 26 | <?php echo $category->name; ?> 27 | 28 |
    29 |
    name; ?>
    30 |
    description; ?>
    31 |
    32 |
    33 | 34 |
    35 |
    36 | 37 |
    38 | 39 | -------------------------------------------------------------------------------- /ts/app.ts: -------------------------------------------------------------------------------- 1 | class berryBase { 2 | is_single: boolean = false; 3 | post_id: number = 0; 4 | is_archive: boolean = false; 5 | darkmode: any = false; 6 | VERSION: string; 7 | 8 | constructor() { 9 | //@ts-ignore 10 | this.is_single = obvInit.is_single; 11 | //@ts-ignore 12 | this.post_id = obvInit.post_id; 13 | //@ts-ignore 14 | this.is_archive = obvInit.is_archive; 15 | //@ts-ignore 16 | this.darkmode = obvInit.darkmode; 17 | //@ts-ignore 18 | this.VERSION = obvInit.version; 19 | } 20 | 21 | getCookie(t: any) { 22 | if (0 < document.cookie.length) { 23 | var e = document.cookie.indexOf(t + '='); 24 | if (-1 != e) { 25 | e = e + t.length + 1; 26 | var n = document.cookie.indexOf(';', e); 27 | return -1 == n && (n = document.cookie.length), document.cookie.substring(e, n); 28 | } 29 | } 30 | return ''; 31 | } 32 | 33 | setCookie(t: any, e: any, n: any) { 34 | var o = new Date(); 35 | o.setTime(o.getTime() + 24 * n * 60 * 60 * 1e3); 36 | var i = 'expires=' + o.toUTCString(); 37 | document.cookie = t + '=' + e + ';' + i + ';path=/'; 38 | } 39 | 40 | showNotice(message: any, type: any = 'success') { 41 | const html = `
    ${message}
    `; 42 | 43 | document.querySelector('body')!.insertAdjacentHTML('beforeend', html); 44 | document.querySelector('.notice--wrapper')!.classList.add('is-active'); 45 | setTimeout(() => { 46 | document.querySelector('.notice--wrapper')!.remove(); 47 | }, 3000); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ts/extensions/help.ts: -------------------------------------------------------------------------------- 1 | function isEmailValid(email: string): boolean { 2 | return email.includes('@'); 3 | } 4 | 5 | function isUrlValid(url: string): boolean { 6 | return url.includes('http'); 7 | } 8 | -------------------------------------------------------------------------------- /ts/extensions/zoom.ts: -------------------------------------------------------------------------------- 1 | class imgZoom { 2 | selector: string; 3 | selectorAttr: string; 4 | currentIndex: number; 5 | images: string[]; 6 | constructor() { 7 | this.selector = '[data-action="imageZoomIn"]'; 8 | this.selectorAttr = 'href'; 9 | this.currentIndex = 0; 10 | this.images = []; 11 | this.getZoomImages(); 12 | window.addEventListener('resize', () => { 13 | if (document.querySelector('.overlay')) { 14 | this.loadImage(this.images[this.currentIndex]); 15 | } 16 | }); 17 | } 18 | 19 | getZoomImages() { 20 | const images = Array.from(document.querySelectorAll(this.selector)); 21 | this.images = [...images] 22 | .map((image) => image.getAttribute(this.selectorAttr)) 23 | .filter((url) => url !== null) as string[]; 24 | images.forEach((image) => { 25 | image.addEventListener('click', (e: any) => { 26 | e.preventDefault(); 27 | const url = image.getAttribute(this.selectorAttr) as string; 28 | this.showOverlay(url); 29 | }); 30 | }); 31 | } 32 | 33 | renderNav() { 34 | const nav = `${this.currentIndex + 1}/${this.images.length}`; 35 | const imageNav = document.querySelector('.image--nav'); 36 | if (imageNav) { 37 | imageNav.innerHTML = nav; 38 | } 39 | } 40 | 41 | prevImage() { 42 | if (this.currentIndex === 0) { 43 | return; 44 | } 45 | this.currentIndex = this.currentIndex - 1; 46 | this.loadImage(this.images[this.currentIndex]); 47 | this.renderNav(); 48 | } 49 | 50 | nextImage() { 51 | if (this.currentIndex === this.images.length - 1) { 52 | return; 53 | } 54 | this.currentIndex = this.currentIndex + 1; 55 | this.loadImage(this.images[this.currentIndex]); 56 | this.renderNav(); 57 | } 58 | 59 | showOverlay(url: string) { 60 | const self = this; 61 | let currentIndex = this.images.indexOf(url); 62 | this.currentIndex = currentIndex; 63 | let nav = 64 | this.images.length > 1 65 | ? `
    ${currentIndex + 1}/${ 66 | this.images.length 67 | }
    ` 72 | : ''; 73 | let html = `
    ${nav}
    `; 74 | const body = document.querySelector('body'); 75 | if (body) { 76 | body.insertAdjacentHTML('beforeend', html); 77 | body.classList.add('u-overflowYHidden'); 78 | } 79 | this.loadImage(url); 80 | document.querySelector('.zoomImgClose')?.addEventListener('click', () => { 81 | self.overlayRemove(); 82 | }); 83 | document.querySelector('.mfp-arrow-right')?.addEventListener('click', () => { 84 | self.nextImage(); 85 | }); 86 | document.querySelector('.mfp-arrow-left')?.addEventListener('click', () => { 87 | self.prevImage(); 88 | }); 89 | } 90 | 91 | loadImage(o: any) { 92 | let s = new Image(); 93 | const loading = document.querySelector('.lds-ripple') as HTMLElement; 94 | if (loading) { 95 | loading.style.display = 'inline-block'; 96 | } 97 | const i = document.querySelector('.overlay-image') as HTMLPreElement; 98 | const nav = document.querySelector('.image--nav'); 99 | nav?.classList.add('u-hide'); 100 | i.style.display = 'none'; 101 | s.onload = () => { 102 | let imageWidth = s.width, 103 | imageHeight = s.height, 104 | maxHeight = window.innerHeight - 140, 105 | maxWidth = window.innerWidth - 80; 106 | maxWidth < imageWidth 107 | ? ((imageHeight *= maxWidth / imageWidth), 108 | (imageWidth = maxWidth), 109 | maxHeight < imageHeight && 110 | ((imageWidth *= maxHeight / imageHeight), (imageHeight = maxHeight))) 111 | : maxHeight < imageHeight && 112 | ((imageWidth *= maxHeight / imageHeight), 113 | (imageHeight = maxHeight), 114 | maxWidth < imageWidth && 115 | ((imageHeight *= maxWidth / imageWidth), (imageWidth = maxWidth))); 116 | i.setAttribute('src', o), 117 | (i.style.width = imageWidth + 'px'), 118 | (i.style.height = imageHeight + 'px'), 119 | (i.style.display = 'block'), 120 | nav?.classList.remove('u-hide'); 121 | 122 | document.querySelector('.overlay-img-wrap')?.classList.add('is-finieshed'); 123 | loading.style.display = 'none'; 124 | }; 125 | s.src = o; 126 | } 127 | 128 | overlayRemove() { 129 | let overlay = document.querySelector('.overlay') as HTMLElement; 130 | if (overlay) this._remove(overlay); 131 | const body = document.querySelector('body'); 132 | if (body) { 133 | body.classList.remove('u-overflowYHidden'); 134 | } 135 | } 136 | 137 | _remove(dom: HTMLElement) { 138 | const parent: any = dom.parentNode; 139 | parent && parent.removeChild(dom); 140 | } 141 | } 142 | 143 | new imgZoom(); 144 | -------------------------------------------------------------------------------- /ts/modules/action.ts: -------------------------------------------------------------------------------- 1 | class berryAction extends berryBase { 2 | like_btn: any; 3 | selctor: string = '.like-btn'; 4 | is_single: boolean = false; 5 | post_id: number = 0; 6 | is_archive: boolean = false; 7 | constructor() { 8 | super(); 9 | //@ts-ignore 10 | this.is_single = obvInit.is_single; 11 | //@ts-ignore 12 | this.post_id = obvInit.post_id; 13 | //@ts-ignore 14 | this.is_archive = obvInit.is_archive; 15 | this.like_btn = document.querySelector(this.selctor); 16 | if (this.like_btn) { 17 | this.like_btn.addEventListener('click', () => { 18 | this.handleLike(); 19 | }); 20 | if (this.getCookie('like_' + this.post_id)) { 21 | this.like_btn.classList.add('is-active'); 22 | } 23 | } 24 | 25 | const theme = localStorage.getItem('theme') ? localStorage.getItem('theme') : 'auto'; 26 | const html = `
    27 | 28 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 53 | 54 | 55 | 56 | 57 | 58 |
    `; 59 | if (this.darkmode) { 60 | document.querySelector('body')!.insertAdjacentHTML('beforeend', html); 61 | } 62 | 63 | document.querySelectorAll('.fixed--theme span').forEach((item) => { 64 | item.addEventListener('click', () => { 65 | if (item.classList.contains('is-active')) return; 66 | document.querySelectorAll('.fixed--theme span').forEach((item) => { 67 | item.classList.remove('is-active'); 68 | }); 69 | // @ts-ignore 70 | if (item.dataset.actionValue == 'dark') { 71 | localStorage.setItem('theme', 'dark'); 72 | document.querySelector('body')!.classList.remove('auto'); 73 | document.querySelector('body')!.classList.add('dark'); 74 | item.classList.add('is-active'); 75 | //this.showNotice('夜间模式已开启'); 76 | // @ts-ignore 77 | } else if (item.dataset.actionValue == 'light') { 78 | localStorage.setItem('theme', 'light'); 79 | document.querySelector('body')!.classList.remove('auto'); 80 | document.querySelector('body')!.classList.remove('dark'); 81 | item.classList.add('is-active'); 82 | //this.showNotice('夜间模式已关闭'); 83 | // @ts-ignore 84 | } else if (item.dataset.actionValue == 'auto') { 85 | localStorage.setItem('theme', 'auto'); 86 | document.querySelector('body')!.classList.remove('dark'); 87 | document.querySelector('body')!.classList.add('auto'); 88 | item.classList.add('is-active'); 89 | //this.showNotice('夜间模式已关闭'); 90 | } 91 | }); 92 | }); 93 | 94 | if (document.querySelector('.post--share')) { 95 | document.querySelector('.post--share')!.addEventListener('click', () => { 96 | navigator.clipboard.writeText(document.location.href).then(() => { 97 | this.showNotice('复制成功'); 98 | }); 99 | }); 100 | } 101 | 102 | if (this.is_single) { 103 | this.trackPostView(); 104 | } 105 | 106 | if (this.is_archive) { 107 | this.trackArchiveView(); 108 | } 109 | 110 | console.log(`theme version: ${this.VERSION} init success!`); 111 | } 112 | 113 | trackPostView() { 114 | //@ts-ignore 115 | const id = obvInit.post_id; 116 | //@ts-ignore 117 | 118 | const url = obvInit.restfulBase + 'berry/v1/view?id=' + id; 119 | fetch(url, { 120 | headers: { 121 | // @ts-ignore 122 | 'X-WP-Nonce': obvInit.nonce, 123 | 'Content-Type': 'application/json', 124 | }, 125 | }) 126 | .then((response) => { 127 | return response.json(); 128 | }) 129 | .then((data) => { 130 | console.log(data); 131 | }); 132 | } 133 | 134 | trackArchiveView() { 135 | if (document.querySelector('.archive-header')) { 136 | // @ts-ignore 137 | const id = obvInit.archive_id; 138 | // @ts-ignore 139 | fetch(`${obvInit.restfulBase}berry/v1/archive/${id}`, { 140 | method: 'POST', 141 | // body: JSON.stringify({ 142 | // // @ts-ignore 143 | // id: this.post_id, 144 | // }), 145 | headers: { 146 | // @ts-ignore 147 | 'X-WP-Nonce': obvInit.nonce, 148 | 'Content-Type': 'application/json', 149 | }, 150 | }) 151 | .then((response) => { 152 | return response.json(); 153 | }) 154 | .then((data) => { 155 | //this.showNotice('Thanks for your like'); 156 | // @ts-ignore 157 | //this.setCookie('like_' + this.post_id, '1', 1); 158 | }); 159 | } 160 | } 161 | 162 | handleLike() { 163 | // @ts-ignore 164 | if (this.getCookie('like_' + this.post_id)) { 165 | return this.showNotice('You have already liked this post'); 166 | } 167 | // @ts-ignore 168 | const url = obvInit.restfulBase + 'berry/v1/like'; 169 | fetch(url, { 170 | method: 'POST', 171 | body: JSON.stringify({ 172 | // @ts-ignore 173 | id: this.post_id, 174 | }), 175 | headers: { 176 | // @ts-ignore 177 | 'X-WP-Nonce': obvInit.nonce, 178 | 'Content-Type': 'application/json', 179 | }, 180 | }) 181 | .then((response) => { 182 | return response.json(); 183 | }) 184 | .then((data) => { 185 | this.showNotice('Thanks for your like'); 186 | // @ts-ignore 187 | this.setCookie('like_' + this.post_id, '1', 1); 188 | }); 189 | this.like_btn.classList.add('is-active'); 190 | } 191 | 192 | refresh() {} 193 | } 194 | 195 | new berryAction(); 196 | -------------------------------------------------------------------------------- /ts/modules/comment.ts: -------------------------------------------------------------------------------- 1 | class berryComment extends berryBase { 2 | loading = false; 3 | constructor() { 4 | super(); 5 | this.init(); 6 | } 7 | 8 | private init() { 9 | if (document.querySelector('.comment-form')) { 10 | document.querySelector('.comment-form')?.addEventListener('submit', (e) => { 11 | e.preventDefault(); 12 | if (this.loading) return; 13 | const form = document.querySelector('.comment-form') as HTMLFormElement; 14 | // @ts-ignore 15 | const formData = new FormData(form); 16 | // @ts-ignore 17 | const formDataObj: { [index: string]: any } = {}; 18 | formData.forEach((value, key: any) => (formDataObj[key] = value)); 19 | this.loading = true; 20 | // @ts-ignore 21 | fetch(obvInit.restfulBase + 'berry/v1/comment', { 22 | method: 'POST', 23 | body: JSON.stringify(formDataObj), 24 | headers: { 25 | // @ts-ignore 26 | 'X-WP-Nonce': obvInit.nonce, 27 | 'Content-Type': 'application/json', 28 | }, 29 | }) 30 | .then((response) => { 31 | return response.json(); 32 | }) 33 | .then((data) => { 34 | this.loading = false; 35 | if (data.code != 200) { 36 | return this.showNotice(data.message, 'error'); 37 | } 38 | let a = document.getElementById('cancel-comment-reply-link'), 39 | i = document.getElementById('respond'), 40 | n = document.getElementById('wp-temp-form-div'); 41 | const comment = data.data; 42 | const html = `
  • 43 |
    44 |
    45 |
    46 | 47 | ${comment.comment_author} 48 |
    49 | 52 | 53 |
    54 |
    55 | ${comment.comment_content} 56 |
    57 |
    58 |
  • `; // @ts-ignore 59 | const parent_id = document.querySelector('#comment_parent')?.value; 60 | // @ts-ignore 61 | (a.style.display = 'none'), // @ts-ignore 62 | (a.onclick = null), // @ts-ignore 63 | (document.getElementById('comment_parent').value = '0'), 64 | n && // @ts-ignore 65 | i && // @ts-ignore 66 | (n.parentNode.insertBefore(i, n), n.parentNode.removeChild(n)); 67 | if (document.querySelector('.comment-body__fresh')) 68 | document 69 | .querySelector('.comment-body__fresh') 70 | ?.classList.remove('comment-body__fresh'); 71 | // @ts-ignore 72 | document.getElementById('comment').value = ''; 73 | // @ts-ignore 74 | if (parent_id != '0') { 75 | document 76 | .querySelector( 77 | // @ts-ignore 78 | '#comment-' + parent_id 79 | ) 80 | ?.insertAdjacentHTML( 81 | 'beforeend', 82 | '
      ' + html + '
    ' 83 | ); 84 | console.log(parent_id); 85 | } else { 86 | if (document.querySelector('.no--comment')) { 87 | document.querySelector('.no--comment')?.remove(); 88 | } 89 | document 90 | .querySelector('.commentlist') 91 | ?.insertAdjacentHTML('beforeend', html); 92 | } 93 | 94 | const newComment = document.querySelector( 95 | `#comment-${comment.comment_ID}` 96 | ) as HTMLElement; 97 | 98 | if (newComment) { 99 | newComment.scrollIntoView({ behavior: 'smooth' }); 100 | } 101 | 102 | this.showNotice('评论成功'); 103 | }); 104 | }); 105 | } 106 | } 107 | } 108 | 109 | new berryComment(); 110 | -------------------------------------------------------------------------------- /ts/modules/date.ts: -------------------------------------------------------------------------------- 1 | class berryDate { 2 | selector: string; 3 | timeFormat: any = { 4 | second: 'second ago', 5 | seconds: 'seconds ago', 6 | minute: 'minute ago', 7 | minutes: 'minutes ago', 8 | hour: 'hour ago', 9 | hours: 'hours ago', 10 | day: 'day ago', 11 | days: 'days ago', 12 | week: 'week ago', 13 | weeks: 'weeks ago', 14 | month: 'month ago', 15 | months: 'months ago', 16 | year: 'year ago', 17 | years: 'years ago', 18 | }; 19 | doms: Array = []; 20 | constructor(config: any) { 21 | this.selector = config.selector; 22 | if (config.timeFormat) { 23 | this.timeFormat = config.timeFormat; 24 | } 25 | this.init(); 26 | setTimeout(() => { 27 | this.refresh(); 28 | }, 1000 * 5); 29 | } 30 | 31 | init() { 32 | this.doms = Array.from(document.querySelectorAll(this.selector)); 33 | this.doms.forEach((dom: any) => { 34 | dom.innerText = this.humanize_time_ago(dom.attributes['datetime'].value); 35 | }); 36 | } 37 | 38 | humanize_time_ago(datetime: string) { 39 | const time = new Date(datetime); 40 | const between: number = Date.now() / 1000 - Number(time.getTime() / 1000); 41 | if (between < 3600) { 42 | return `${Math.ceil(between / 60)} ${ 43 | Math.ceil(between / 60) == 1 ? this.timeFormat.second : this.timeFormat.seconds 44 | }`; 45 | } else if (between < 86400) { 46 | return `${Math.ceil(between / 3600)} ${ 47 | Math.ceil(between / 3660) == 1 ? this.timeFormat.hour : this.timeFormat.hours 48 | }`; 49 | } else if (between < 86400 * 30) { 50 | return `${Math.ceil(between / 86400)} ${ 51 | Math.ceil(between / 86400) == 1 ? this.timeFormat.day : this.timeFormat.days 52 | }`; 53 | } else if (between < 86400 * 30 * 12) { 54 | return `${Math.ceil(between / (86400 * 30))} ${ 55 | Math.ceil(between / (86400 * 30)) == 1 56 | ? this.timeFormat.month 57 | : this.timeFormat.months 58 | }`; 59 | } else { 60 | return time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate(); 61 | } 62 | } 63 | 64 | refresh() { 65 | this.doms.forEach((dom: any) => { 66 | dom.innerText = this.humanize_time_ago(dom.attributes['datetime'].value); 67 | }); 68 | } 69 | } 70 | 71 | new berryDate({ 72 | selector: '.humane--time', 73 | //@ts-ignore 74 | timeFormat: obvInit.timeFormat, 75 | }); 76 | -------------------------------------------------------------------------------- /ts/modules/posts.ts: -------------------------------------------------------------------------------- 1 | class berryPost extends berryBase { 2 | loading = false; 3 | page = 1; 4 | button: any; 5 | constructor() { 6 | super(); 7 | this.init(); 8 | } 9 | 10 | init() { 11 | if (document.querySelector('.loadmore')) { 12 | this.button = document.querySelector('.loadmore'); 13 | document.querySelector('.loadmore')?.addEventListener('click', (e) => { 14 | e.preventDefault(); 15 | if (this.loading) return; 16 | this.loading = true; 17 | this.page++; 18 | this.fetchPosts(); 19 | }); 20 | } 21 | } 22 | 23 | randerPosts(data: any) { 24 | let html = data 25 | .map((post: any) => { 26 | const thumbnail = //@ts-ignore 27 | obvInit.hide_home_cover || !post.has_image 28 | ? '' 29 | : ` 30 | ${post.post_title} 31 | `; 32 | return post.post_format && post.post_format == 'status' 33 | ? `
    34 |
    35 |
    36 | 37 |
    38 |

    ${post.excerpt}

    39 |
    40 |
    41 |
    ` 42 | : `
    43 |
    44 |

    45 | 46 | ${post.post_title} 47 |

    48 |
    ${post.excerpt}
    49 |
    50 | 51 | 52 | 53 | 54 |
    55 |
    ${thumbnail} 56 |
    `; 57 | }) 58 | .join(''); 59 | // @ts-ignore 60 | document.querySelector('.posts--list')?.innerHTML += html; 61 | } 62 | 63 | randerCardPosts(data: any) { 64 | let html = data 65 | .map((post: any) => { 66 | return `
    67 | 68 | ${post.post_title} 69 | 70 |
    71 |
    ${post.day}
    72 |

    73 | ${post.post_title} 74 |

    75 |
    76 | ${post.excerpt} 77 |
    78 |
    79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | ${post.author} 87 |
    88 |
    89 |
    `; 90 | }) 91 | .join(''); 92 | // @ts-ignore 93 | document.querySelector('.post--cards')?.innerHTML += html; 94 | } 95 | 96 | fetchPosts() { 97 | this.button.innerHTML = '加载中...'; 98 | let params: any = { 99 | page: this.page, 100 | category: '', 101 | tag: '', 102 | author: '', 103 | }; 104 | if (this.button.dataset.category) { 105 | params.category = this.button.dataset.category; 106 | } 107 | 108 | if (this.button.dataset.tag) { 109 | params.tag = this.button.dataset.tag; 110 | } 111 | 112 | if (this.button.dataset.author) { 113 | params.author = this.button.dataset.author; 114 | } 115 | 116 | const fecthParmas = new URLSearchParams(params).toString(); 117 | 118 | // @ts-ignore 119 | fetch(obvInit.restfulBase + 'berry/v1/posts?' + fecthParmas, { 120 | method: 'get', 121 | headers: { 122 | // @ts-ignore 123 | 'X-WP-Nonce': obvInit.nonce, 124 | 'Content-Type': 'application/json', 125 | }, 126 | }) 127 | .then((response) => { 128 | return response.json(); 129 | }) 130 | .then((data) => { 131 | this.loading = false; 132 | if (data.code != 200) { 133 | return this.showNotice(data.message, 'error'); 134 | } else { 135 | if (data.data.length == 0) { 136 | document.querySelector('.loadmore')?.remove(); 137 | this.showNotice('没有更多文章了', 'error'); 138 | } else { 139 | if (document.querySelector('.posts--list')) { 140 | this.randerPosts(data.data); 141 | } else { 142 | this.randerCardPosts(data.data); 143 | } 144 | this.showNotice('加载成功', 'error'); 145 | } 146 | this.button.innerHTML = '加载更多'; 147 | } 148 | }); 149 | } 150 | } 151 | new berryPost(); 152 | -------------------------------------------------------------------------------- /ts/modules/scroll.ts: -------------------------------------------------------------------------------- 1 | class berryScroll { 2 | is_single: boolean = false; 3 | constructor() { 4 | //@ts-ignore 5 | this.is_single = obvInit.is_single; 6 | this.init(); 7 | 8 | if (document.querySelector('.backToTop')) { 9 | const backToTop = document.querySelector('.backToTop') as HTMLElement; 10 | window.addEventListener('scroll', () => { 11 | const t = window.scrollY || window.pageYOffset; 12 | // console.log(t); 13 | // const documentHeight = document.body.clientHeight; 14 | //const windowHeight = window.innerHeight; 15 | // const percent = Math.ceil((t / (documentHeight - windowHeight)) * 100); 16 | 17 | t > 200 18 | ? backToTop!.classList.add('is-active') 19 | : backToTop!.classList.remove('is-active'); 20 | }); 21 | 22 | backToTop.addEventListener('click', () => { 23 | window.scrollTo({ top: 0, behavior: 'smooth' }); 24 | }); 25 | } 26 | } 27 | 28 | init() { 29 | this.scroll(); 30 | } 31 | 32 | scroll() { 33 | const endScroll = document.querySelector('.post-navigation') as HTMLElement; 34 | const endScrollTop: any = endScroll ? endScroll.offsetTop : 0; 35 | 36 | const windowHeight = window.innerHeight; 37 | 38 | window.addEventListener('scroll', () => { 39 | if (window.scrollY > 10) { 40 | document.querySelector('.site--header')?.classList.add('is-active'); 41 | } else { 42 | document.querySelector('.site--header')?.classList.remove('is-active'); 43 | } 44 | if (this.is_single) { 45 | if (window.scrollY > endScrollTop - windowHeight) { 46 | document.querySelector('.post-navigation')?.classList.add('is-active'); 47 | } else { 48 | document.querySelector('.post-navigation')?.classList.remove('is-active'); 49 | } 50 | } 51 | }); 52 | } 53 | } 54 | 55 | new berryScroll(); 56 | -------------------------------------------------------------------------------- /ts/setting.ts: -------------------------------------------------------------------------------- 1 | document.querySelectorAll('.leftpanel li').forEach((element, index) => { 2 | element.addEventListener('click', (event) => { 3 | document.querySelectorAll('.leftpanel li').forEach((element) => { 4 | element.classList.remove('active'); 5 | }); 6 | element.classList.add('active'); 7 | document.querySelectorAll('.div-tab').forEach((element) => { 8 | element.classList.add('hidden'); 9 | }); 10 | document.querySelectorAll('.div-tab')[index].classList.remove('hidden'); 11 | }); 12 | }); 13 | 14 | document.querySelector('#upload-categoryCover')?.addEventListener('click', (event) => { 15 | event.preventDefault(); 16 | //@ts-ignore 17 | const image = wp 18 | .media({ 19 | //@ts-ignore 20 | title: obvInit.upload_title, 21 | multiple: false, 22 | button: { 23 | //@ts-ignore 24 | text: obvInit.upload_button, 25 | }, 26 | }) 27 | .open() 28 | .on('select', function () { 29 | const uploaded_image = image.state().get('selection').first(); 30 | const image_url = uploaded_image.toJSON().url; 31 | document.querySelector('#_category_cover')?.setAttribute('value', image_url); 32 | }); 33 | }); 34 | 35 | document.querySelector('#pure-save')?.addEventListener('click', (event) => { 36 | event.preventDefault(); 37 | const form = document.querySelector('#pure-form') as HTMLFormElement; 38 | // @ts-ignore 39 | const formData = new FormData(form); 40 | // @ts-ignore 41 | const data = new URLSearchParams(formData); 42 | 43 | // const emailElement = document.querySelector('#pure-setting-email'); 44 | // const email = emailElement?.getAttribute('value'); 45 | // if (email && !isEmailValid(email)) { 46 | // return alert('Email is not valid'); 47 | // } 48 | 49 | //@ts-ignore 50 | jQuery.ajax({ 51 | //@ts-ignore 52 | url: obvInit.ajaxurl, 53 | data: data + '&action=berry_setting', 54 | type: 'POST', 55 | success: function () { 56 | //@ts-ignore 57 | const html = `

    ${obvInit.success_message}

    `; 58 | //@ts-ignore 59 | jQuery('.pure-wrap').before(html); 60 | window.scrollTo(0, 0); 61 | }, 62 | }); 63 | }); 64 | +(function ($) { 65 | $(document).on('click', '#berry-settings_updated .notice-dismiss', function () { 66 | $('#berry-settings_updated').remove(); 67 | }); 68 | let $switch = $('.pure-setting-switch'); 69 | $switch.click(function () { 70 | var $this = $(this), 71 | $input = $('#' + $this.attr('data-id')); 72 | 73 | if (!$this.hasClass('active')) { 74 | $this.addClass('active'); 75 | $input.val(1); 76 | } else { 77 | $this.removeClass('active'); 78 | $input.val(0); 79 | } 80 | 81 | $input.change(); 82 | }); 83 | //@ts-ignore 84 | })(jQuery); 85 | --------------------------------------------------------------------------------