From 5394907cfb35ddd8ebeb30741807ac72865a54ea Mon Sep 17 00:00:00 2001 From: Mashiro Date: Fri, 28 Dec 2018 13:41:17 +0800 Subject: [PATCH] Fix share plugin --- footer.php | 28 ---------------------------- functions.php | 1 + js/sakura-app.js | 5 ++++- layouts/sharelike.php | 7 +------ options.php | 4 ++-- style.css | 21 +++++++++++++-------- 6 files changed, 21 insertions(+), 45 deletions(-) diff --git a/footer.php b/footer.php index ced4126..ada9b28 100644 --- a/footer.php +++ b/footer.php @@ -139,33 +139,5 @@ - - - - diff --git a/functions.php b/functions.php index 4a4c2c0..e0ddc0b 100644 --- a/functions.php +++ b/functions.php @@ -169,6 +169,7 @@ add_action( 'after_setup_theme', 'akina_content_width', 0 ); * Enqueue scripts and styles. */ function sakura_scripts() { + wp_enqueue_script( 'share-js', 'https://cdn.jsdelivr.net/gh/moezx/cdn@3.5.7/js/src/13.social-share.min.js', array(), SAKURA_VERSION, true ); if(akina_option('jsdelivr_cdn_test')){ wp_enqueue_script( 'js_lab', 'https://pages.shino.cc/cdn/js/lib.js', array(), SAKURA_VERSION, true ); } else { diff --git a/js/sakura-app.js b/js/sakura-app.js index 6605b67..595291e 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -12,10 +12,12 @@ mashiro_global.variables = new function () { mashiro_global.ini = new function () { this.normalize = function () { lazyload(); + social_share(); mashiro_global.post_list_show_animation.ini(); } this.pjax = function () { pjaxInit(); + social_share(); mashiro_global.post_list_show_animation.ini(); } } @@ -985,7 +987,8 @@ mashiro_global.ini.normalize(); loadCSS(mashiro_option.jsdelivr_css_src); loadCSS("https://at.alicdn.com/t/font_679578_qyt5qzzavdo39pb9.css"); loadCSS("https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css"); -loadCSS("https://fonts.googleapis.com/css?family=Noto+SerifMerriweather|Merriweather+Sans|Source+Code+Pro|Ubuntu:400,700"); +loadCSS("https://fonts.googleapis.com/css?family=Noto+SerifMerriweather|Merriweather+Sans|Source+Code+Pro|Ubuntu:400,700|Noto+Serif+SC"); +loadCSS("https://cdn.jsdelivr.net/gh/moezx/cdn@3.3.9/css/sharejs.css"); (function webpackUniversalModuleDefinition(b, a) { if (typeof exports === "object" && typeof module === "object") { module.exports = a() diff --git a/layouts/sharelike.php b/layouts/sharelike.php index d140ae1..d847410 100644 --- a/layouts/sharelike.php +++ b/layouts/sharelike.php @@ -20,12 +20,7 @@
- +
\ No newline at end of file diff --git a/options.php b/options.php index 6613f58..9028452 100644 --- a/options.php +++ b/options.php @@ -714,7 +714,7 @@ function optionsframework_options() { 'id' => 'qiniu_cdn', 'std' => '', 'type' => 'text'); - + /* $options[] = array( 'name' => __('Adobe Typekit ID 1', 'options_framework_theme'), 'desc' => __('加载 Adobe 字体,填写的是 js 文件名,请把这页七个字体都加入到你的 kit。免费账号有每月 2,5000 PV 的使用限制,可注册多个ID,每次随机选择一个调用,如果访问量没那么高,那么填这里第一个就OK了', 'options_framework_theme'), @@ -735,7 +735,7 @@ function optionsframework_options() { 'id' => 'adobe_id_3', 'std' => '', 'type' => 'text'); - + */ $options[] = array( 'name' => __('开启 jsDelivr 测试?', 'options_framework_theme'), 'desc' => __('如不清楚什么意思切勿勾选!', 'options_framework_theme'), diff --git a/style.css b/style.css index fc9116d..8e34023 100644 --- a/style.css +++ b/style.css @@ -2072,7 +2072,7 @@ h1.page-title.mb- { .post-share { float: right; list-style: none; - margin-right: 20px + margin-right: 20px; } .post-share img:hover { @@ -2093,15 +2093,20 @@ h1.page-title.mb- { transition: opacity .4s ease-out } +.post-share .social-share { + opacity: 0; + display: none; +} + .post-share li { float: left; - margin-right: 20px + margin-right: 20px; } .post-share li img { width: 32px; height: 32px; - padding: 7px + padding: 7px; } .post-share ul li i { @@ -2110,7 +2115,7 @@ h1.page-title.mb- { .post-share span { float: left; - margin-right: 10px + margin-right: 10px; } .post-share ul li a:hover { @@ -2128,10 +2133,10 @@ h1.page-title.mb- { transition: opacity .1s ease-out } -.post-share:hover .sharehidden, -.post-share:hover .show-share { +.post-share:hover .show-share, +.post-share:hover .sharehidden { opacity: 1; - display: inline-block + display: inline-block; } .post-squares { @@ -8228,7 +8233,7 @@ td.hljs-ln-numbers { } .serif { - font-family: 'Source Han Serif SC', 'Source Han Serif', source-han-serif-sc, 'PT Serif', 'SongTi SC', 'MicroSoft Yahei', Georgia, serif + font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Source Han Serif', source-han-serif-sc, 'PT Serif', 'SongTi SC', 'MicroSoft Yahei', Georgia, serif } @media (max-width:860px) {