mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:30:53 +08:00
1. fix Traditional Chinese and Simplified Chinese Conversion
2. Add the option to hidden the aside items #2 3. Add the option to change subtitle 4. Add the option to change the font 5. fix read-mode and night-mode 6. fix the bugs of the cover #2
This commit is contained in:
@@ -260,18 +260,7 @@ table
|
||||
margin-bottom: 2px
|
||||
cursor: pointer
|
||||
padding-top: 6px
|
||||
|
||||
#to_comment
|
||||
width: 30px
|
||||
height: 30px
|
||||
background-color: #49b1f5
|
||||
color: #e3e8ee
|
||||
text-align: center
|
||||
font-size: 17px
|
||||
display: block
|
||||
margin-bottom: 2px
|
||||
cursor: pointer
|
||||
padding-top: 6px
|
||||
|
||||
|
||||
a
|
||||
&:hover
|
||||
|
||||
236
source/css/_layout/nightshift.styl
Normal file
236
source/css/_layout/nightshift.styl
Normal file
@@ -0,0 +1,236 @@
|
||||
if hexo-config("nightshift") && hexo-config("nightshift.enable")
|
||||
.night-mode
|
||||
footer
|
||||
background: #2d3035
|
||||
|
||||
#sidebar
|
||||
background: #2d3035 !important
|
||||
box-shadow: -0.25rem 0 0.25rem #2d3035 !important
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: lighten(#2d3035,5)
|
||||
|
||||
if hexo-config("local_search") && hexo-config("local_search.enable")
|
||||
#local-search
|
||||
background: #2d3035
|
||||
.local-search-box--input
|
||||
background: #2d3035
|
||||
color: #99a9bf
|
||||
|
||||
.search-result-title
|
||||
color: #99a9bf
|
||||
if hexo-config("algolia_search.enable")
|
||||
#algolia-search
|
||||
background: #2d3035
|
||||
.ais-search-box--input
|
||||
background: #2d3035
|
||||
color: #99a9bf
|
||||
|
||||
#algolia-search-results
|
||||
.algolia-hit-item-link
|
||||
color: #99a9bf !important
|
||||
|
||||
h1, h2, h3, h4, h5, h6
|
||||
color: #99a9bf
|
||||
|
||||
.article-container code
|
||||
background: #616a6b
|
||||
color: #99a9bf
|
||||
|
||||
// 評論
|
||||
#vcomment
|
||||
*
|
||||
color: #99a9bf !important
|
||||
|
||||
.vsys
|
||||
background: rgb(97, 106, 107) !important
|
||||
|
||||
.vbtn
|
||||
background: rgb(45, 48, 53) !important
|
||||
color: #99a9bf !important
|
||||
|
||||
.recent-post-item .article-title
|
||||
color: #99a9bf
|
||||
|
||||
#page-header
|
||||
&.fixed
|
||||
background: #2d3035
|
||||
box-shadow: 0 5px 6px -5px rgba(133,133,133,0)
|
||||
|
||||
a,
|
||||
.toggle-menu,
|
||||
#site-name
|
||||
color: #99a9bf
|
||||
|
||||
blockquote
|
||||
border-left: 0.2rem solid #7A5353
|
||||
color: #99a9bf
|
||||
|
||||
hr
|
||||
background: 0
|
||||
border: 2px dashed #616A6B
|
||||
&:before
|
||||
color: #99a9bf
|
||||
|
||||
.post-meta__tags
|
||||
background: 0
|
||||
border: 1px solid #99a9bf
|
||||
color: #99a9bf
|
||||
|
||||
|
||||
.post-copyright
|
||||
border: 1px solid #99a9bf
|
||||
|
||||
*
|
||||
color: #99a9bf
|
||||
|
||||
.article-container .highlight
|
||||
background-color: #1B2631
|
||||
.code pre
|
||||
background-color: #1B2631
|
||||
|
||||
.gutter pre
|
||||
background: #1C2833
|
||||
|
||||
|
||||
&:after
|
||||
background: rgb(27, 38, 59)
|
||||
|
||||
table
|
||||
&:after,.copy-notice
|
||||
background: rgb(27, 38, 59)
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: lighten(#1B2631,10)
|
||||
|
||||
.copy-notice
|
||||
background: rgb(27, 38, 59)
|
||||
|
||||
.post-cards,.md-links-item
|
||||
// background: #2d3035
|
||||
a
|
||||
color: #99a9bf
|
||||
|
||||
.aplayer
|
||||
color: #000000
|
||||
filter: brightness(0.6)
|
||||
|
||||
.article-sort-item__title
|
||||
color: #99a9bf
|
||||
|
||||
.category-list
|
||||
a
|
||||
color: #99a9bf
|
||||
|
||||
|
||||
|
||||
.translate_chn_to_cht,
|
||||
.nightshift,
|
||||
#readmode
|
||||
background-color: #2d3035 !important
|
||||
|
||||
img
|
||||
filter: brightness(0.6)
|
||||
|
||||
.layout_post
|
||||
background:#2d3035
|
||||
|
||||
canvas
|
||||
display: none !important
|
||||
|
||||
#aside_content
|
||||
.card_widget
|
||||
background:#2d3035 !important
|
||||
.headline,
|
||||
.length_num,
|
||||
.aside_post_title,
|
||||
.aside_category_list_link,
|
||||
.archive-list-link,
|
||||
.social-icon
|
||||
color: #99a9bf !important
|
||||
|
||||
#bookmark-it
|
||||
background: #616a6b !important
|
||||
|
||||
#archive,
|
||||
.tag-cloud,
|
||||
#tag,
|
||||
.category-content,
|
||||
#category,
|
||||
#page,
|
||||
.flink
|
||||
background:#2d3035
|
||||
|
||||
#nav,
|
||||
#top-container
|
||||
&::before
|
||||
content: ""
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
background-color: rgba(0,0,0,.6)
|
||||
|
||||
.layout_page
|
||||
.post-meta__date,
|
||||
.article-meta__separator,
|
||||
.article-meta__categories,
|
||||
i
|
||||
color: #99a9bf
|
||||
|
||||
#site-info .blogtitle,
|
||||
span.subtitle,
|
||||
#post-info .posttitle,
|
||||
#post-info #post-meta,
|
||||
#site-social-icons i,
|
||||
#top-container a
|
||||
color: rgba(238,238,238,.6)
|
||||
|
||||
//打賞 分享
|
||||
.post-reward
|
||||
.reward-buttom
|
||||
background-color: #616a6b
|
||||
.post_share
|
||||
filter: brightness(0.6)
|
||||
img
|
||||
filter: brightness(1)
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: lighten(#2d3035,5)
|
||||
|
||||
@media screen and (max-width: 768px)
|
||||
.night-mode
|
||||
color: #99a9bf
|
||||
background-color: rgb(45, 48, 53)
|
||||
|
||||
#page-header
|
||||
.menus
|
||||
a
|
||||
color: #99a9bf
|
||||
background: #2d3035
|
||||
&.fixed
|
||||
.menu-icon-first,
|
||||
.menu-icon-second,
|
||||
.menu-icon-third
|
||||
background-color: #99a9bf;
|
||||
|
||||
|
||||
@media screen and (min-width: 768px)
|
||||
.night-mode
|
||||
color: #99a9bf
|
||||
background-color: #2d3032
|
||||
|
||||
.recent-post-item
|
||||
background: #2d3035 !important
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#post
|
||||
overflow: hidden
|
||||
text-align: justify
|
||||
|
||||
&-meta
|
||||
text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15)
|
||||
|
||||
@@ -1,100 +1,104 @@
|
||||
.read-mode
|
||||
background: $pale-yellow
|
||||
padding: 0 !important
|
||||
|
||||
#sidebar,
|
||||
#toggle-sidebar
|
||||
display: none
|
||||
|
||||
#top-container
|
||||
background-image: none !important
|
||||
height: 14rem
|
||||
background-color: $pale-yellow
|
||||
|
||||
a
|
||||
color: #4c4948
|
||||
|
||||
|
||||
&:before
|
||||
opacity: 0
|
||||
|
||||
#site-name,
|
||||
.site-page
|
||||
text-shadow: none
|
||||
color: #4c4948
|
||||
|
||||
#post-info
|
||||
text-align: center
|
||||
padding: 0
|
||||
color: #4c4948
|
||||
|
||||
#post-title,
|
||||
#post-meta
|
||||
text-shadow: none
|
||||
|
||||
#page-header
|
||||
&.fixed
|
||||
background: none
|
||||
box-shadow: none
|
||||
|
||||
&.open-sidebar
|
||||
.site-page
|
||||
display: inline-block
|
||||
opacity: 1
|
||||
|
||||
.toggle-menu
|
||||
.menu-icon-first,
|
||||
.menu-icon-second,
|
||||
.menu-icon-third
|
||||
background-color: #4c4948
|
||||
|
||||
.layout_post
|
||||
box-shadow: none
|
||||
if hexo-config("readmode") && hexo-config("readmode.enable")
|
||||
.read-mode
|
||||
background: $pale-yellow
|
||||
padding: 0 !important
|
||||
|
||||
&:hover
|
||||
box-shadow: none
|
||||
|
||||
.article-container
|
||||
pre,
|
||||
.highlight
|
||||
background: darken($pale-yellow,5);
|
||||
#sidebar,
|
||||
#toggle-sidebar
|
||||
display: none
|
||||
|
||||
#top-container
|
||||
background-image: none !important
|
||||
height: 14rem
|
||||
background-color: $pale-yellow
|
||||
|
||||
a
|
||||
color: #4c4948
|
||||
|
||||
|
||||
&:before
|
||||
opacity: 0
|
||||
|
||||
.highlight
|
||||
&:after
|
||||
background: darken($pale-yellow,10);
|
||||
table
|
||||
#site-name,
|
||||
.site-page
|
||||
text-shadow: none
|
||||
color: #4c4948
|
||||
|
||||
#post-info
|
||||
text-align: center
|
||||
padding: 0
|
||||
color: #4c4948
|
||||
|
||||
#post-title,
|
||||
#post-meta
|
||||
text-shadow: none
|
||||
|
||||
#page-header
|
||||
&.fixed
|
||||
background: none
|
||||
box-shadow: none
|
||||
|
||||
&.open-sidebar
|
||||
.site-page
|
||||
display: inline-block
|
||||
opacity: 1
|
||||
|
||||
.toggle-menu
|
||||
.menu-icon-first,
|
||||
.menu-icon-second,
|
||||
.menu-icon-third
|
||||
background-color: #4c4948
|
||||
|
||||
.layout_post
|
||||
box-shadow: none
|
||||
background: $pale-yellow
|
||||
|
||||
&:hover
|
||||
box-shadow: none
|
||||
|
||||
.article-container
|
||||
pre,
|
||||
.highlight
|
||||
background: darken($pale-yellow,5);
|
||||
|
||||
.highlight
|
||||
&:after
|
||||
background: darken($pale-yellow,10);
|
||||
|
||||
|
||||
blockquote
|
||||
border-left: 0.2rem solid #d6dbdf
|
||||
background-color: rgba(102,128,153,.05)
|
||||
|
||||
#rightside
|
||||
#to_comment,#nightshift
|
||||
table
|
||||
&:after
|
||||
background: darken($pale-yellow,10);
|
||||
|
||||
|
||||
blockquote
|
||||
border-left: 0.2rem solid #d6dbdf
|
||||
background-color: rgba(102,128,153,.05)
|
||||
|
||||
#rightside
|
||||
#nightshift
|
||||
display: none
|
||||
|
||||
canvas
|
||||
display: none !important
|
||||
|
||||
footer,
|
||||
#post-comment,
|
||||
hr,
|
||||
.relatedPosts,
|
||||
#pagination,
|
||||
.post-reward,
|
||||
.tag_share,
|
||||
.post-copyright
|
||||
display: none
|
||||
|
||||
canvas
|
||||
display: none !important
|
||||
|
||||
footer,
|
||||
#post-comment,
|
||||
hr,
|
||||
.relatedPosts,
|
||||
#pagination,
|
||||
.post-reward,
|
||||
.tag_share,
|
||||
.post-copyright
|
||||
display: none
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: darken($pale-yellow,15)
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: darken($pale-yellow,15)
|
||||
|
||||
*::-webkit-scrollbar-thumb
|
||||
background: darken($pale-yellow,15)
|
||||
|
||||
*::-webkit-scrollbar-thumb
|
||||
background: darken($pale-yellow,15)
|
||||
|
||||
.copy-notice
|
||||
background: darken($pale-yellow,10)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -106,8 +110,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
@import "_global"
|
||||
@import "_highlight/highlight"
|
||||
@import "_layout/*"
|
||||
@import "other"
|
||||
if hexo-config("nightshift.enable")
|
||||
@import "nightshift"
|
||||
|
||||
|
||||
// search
|
||||
if hexo-config("algolia_search.enable")
|
||||
@import "_search/index"
|
||||
|
||||
@@ -1,236 +0,0 @@
|
||||
.night-mode
|
||||
footer
|
||||
background: #2d3035
|
||||
|
||||
#sidebar
|
||||
background: #2d3035 !important
|
||||
box-shadow: -0.25rem 0 0.25rem #2d3035 !important
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: lighten(#2d3035,5)
|
||||
|
||||
if hexo-config("local_search") && hexo-config("local_search.enable")
|
||||
#local-search
|
||||
background: #2d3035
|
||||
.local-search-box--input
|
||||
background: #2d3035
|
||||
color: #99a9bf
|
||||
|
||||
.search-result-title
|
||||
color: #99a9bf
|
||||
if hexo-config("algolia_search.enable")
|
||||
#algolia-search
|
||||
background: #2d3035
|
||||
.ais-search-box--input
|
||||
background: #2d3035
|
||||
color: #99a9bf
|
||||
|
||||
#algolia-search-results
|
||||
.algolia-hit-item-link
|
||||
color: #99a9bf !important
|
||||
|
||||
h1, h2, h3, h4, h5, h6
|
||||
color: #99a9bf
|
||||
|
||||
.article-container code
|
||||
background: #616a6b
|
||||
color: #99a9bf
|
||||
|
||||
// 評論
|
||||
#vcomment
|
||||
*
|
||||
color: #99a9bf !important
|
||||
|
||||
.vsys
|
||||
background: rgb(97, 106, 107) !important
|
||||
|
||||
.vbtn
|
||||
background: rgb(45, 48, 53) !important
|
||||
color: #99a9bf !important
|
||||
|
||||
.recent-post-item .article-title
|
||||
color: #99a9bf
|
||||
|
||||
#page-header
|
||||
&.fixed
|
||||
background: #2d3035
|
||||
box-shadow: 0 5px 6px -5px rgba(133,133,133,0)
|
||||
|
||||
a,
|
||||
.toggle-menu,
|
||||
#site-name
|
||||
color: #99a9bf
|
||||
|
||||
blockquote
|
||||
border-left: 0.2rem solid #7A5353
|
||||
color: #99a9bf
|
||||
|
||||
hr
|
||||
background: 0
|
||||
border: 2px dashed #616A6B
|
||||
&:before
|
||||
color: #99a9bf
|
||||
|
||||
.post-meta__tags
|
||||
background: 0
|
||||
border: 1px solid #99a9bf
|
||||
color: #99a9bf
|
||||
|
||||
|
||||
.post-copyright
|
||||
border: 1px solid #99a9bf
|
||||
|
||||
*
|
||||
color: #99a9bf
|
||||
|
||||
.article-container .highlight
|
||||
background-color: #1B2631
|
||||
.code pre
|
||||
background-color: #1B2631
|
||||
|
||||
.gutter pre
|
||||
background: #1C2833
|
||||
|
||||
|
||||
&:after
|
||||
background: rgb(27, 38, 59)
|
||||
|
||||
table
|
||||
&:after,.copy-notice
|
||||
background: rgb(27, 38, 59)
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: lighten(#1B2631,10)
|
||||
|
||||
.copy-notice
|
||||
background: rgb(27, 38, 59)
|
||||
|
||||
.post-cards,.md-links-item
|
||||
// background: #2d3035
|
||||
a
|
||||
color: #99a9bf
|
||||
|
||||
.aplayer
|
||||
color: #000000
|
||||
filter: brightness(0.6)
|
||||
|
||||
.article-sort-item__title
|
||||
color: #99a9bf
|
||||
|
||||
.category-list
|
||||
a
|
||||
color: #99a9bf
|
||||
|
||||
|
||||
|
||||
.translate_chn_to_cht,
|
||||
.nightshift,
|
||||
#to_comment,
|
||||
#readmode
|
||||
background-color: #2d3035 !important
|
||||
|
||||
img
|
||||
filter: brightness(0.6)
|
||||
|
||||
.layout_post
|
||||
background:#2d3035
|
||||
|
||||
canvas
|
||||
display: none !important
|
||||
|
||||
#aside_content
|
||||
.card_widget
|
||||
background:#2d3035 !important
|
||||
.headline,
|
||||
.length_num,
|
||||
.aside_post_title,
|
||||
.aside_category_list_link,
|
||||
.archive-list-link,
|
||||
.social-icon
|
||||
color: #99a9bf !important
|
||||
|
||||
#bookmark-it
|
||||
background: #616a6b !important
|
||||
|
||||
#archive,
|
||||
.tag-cloud,
|
||||
#tag,
|
||||
.category-content,
|
||||
#category,
|
||||
#page,
|
||||
.flink
|
||||
background:#2d3035
|
||||
|
||||
#nav,
|
||||
#top-container
|
||||
&::before
|
||||
content: ""
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
background-color: rgba(0,0,0,.6)
|
||||
|
||||
.layout_page
|
||||
.post-meta__date,
|
||||
.article-meta__separator,
|
||||
.article-meta__categories,
|
||||
i
|
||||
color: #99a9bf
|
||||
|
||||
#site-info .blogtitle,
|
||||
span.subtitle,
|
||||
#post-info .posttitle,
|
||||
#post-info #post-meta,
|
||||
#site-social-icons i,
|
||||
#top-container a
|
||||
color: rgba(238,238,238,.6)
|
||||
|
||||
//打賞 分享
|
||||
.post-reward
|
||||
.reward-buttom
|
||||
background-color: #616a6b
|
||||
.post_share
|
||||
filter: brightness(0.6)
|
||||
img
|
||||
filter: brightness(1)
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: lighten(#2d3035,5)
|
||||
|
||||
@media screen and (max-width: 768px)
|
||||
.night-mode
|
||||
color: #99a9bf
|
||||
background-color: rgb(45, 48, 53)
|
||||
|
||||
#page-header
|
||||
.menus
|
||||
a
|
||||
color: #99a9bf
|
||||
background: #2d3035
|
||||
&.fixed
|
||||
.menu-icon-first,
|
||||
.menu-icon-second,
|
||||
.menu-icon-third
|
||||
background-color: #99a9bf;
|
||||
|
||||
|
||||
@media screen and (min-width: 768px)
|
||||
.night-mode
|
||||
color: #99a9bf
|
||||
background-color: #2d3032
|
||||
|
||||
.recent-post-item
|
||||
background: #2d3035 !important
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ $theme-meta-color = #858585
|
||||
$theme-link-color = #99a9bf
|
||||
$theme-hr-color = #A4D8FA
|
||||
$theme-read-mode-bg-color = #FAF9DE
|
||||
$font-family= Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
$code-font = consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||
|
||||
|
||||
if hexo-config("theme_color") && hexo-config("theme_color.enable")
|
||||
$theme-color = convert(hexo-config("theme_color.main")) || #49B1F5
|
||||
@@ -18,12 +21,16 @@ if hexo-config("theme_color") && hexo-config("theme_color.enable")
|
||||
$theme-hr-color = convert(hexo-config("theme_color.hr_color")) || #A4D8FA
|
||||
$theme-read-mode-bg-color = convert(hexo-config("theme_color.read-mode-bg_color")) || #FAF9DE
|
||||
|
||||
if hexo-config("font") && hexo-config("font.enable")
|
||||
$font-family = convert(hexo-config("font.font-family")) || 'Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif'
|
||||
$code-font = convert(hexo-config("font.code-font")) || 'consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number'
|
||||
|
||||
// Global Variables
|
||||
$font-size = 14px
|
||||
$font-color = #1F2D3D
|
||||
$rem = 20px
|
||||
$font-family = Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft JhengHei","Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
$code-font = consolas, Menlo, "PingFang SC", "Microsoft JhengHei","Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||
$font-family = $font-family
|
||||
$code-font = $code-font
|
||||
$text-line-height = 2
|
||||
$sm = 768px
|
||||
$bg = 1024px
|
||||
|
||||
@@ -86,13 +86,7 @@ $(function () {
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
//側邊欄comment
|
||||
$("#to_comment").on("click", function () {
|
||||
|
||||
scrollTo('#post-comment')
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(".scroll-down").on("click", function () {
|
||||
|
||||
scrollTo('#content-outer')
|
||||
@@ -177,8 +171,8 @@ $(function () {
|
||||
} else { // webkit - safari/chrome
|
||||
// alert('按 ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D 鍵將本頁加入書籤.');
|
||||
$.fancyConfirm({
|
||||
title: "添加書籤?",
|
||||
message: '按 ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D 鍵將本頁加入書籤.',
|
||||
title: GLOBAL_CONFIG.bookmark.title + '?',
|
||||
message: GLOBAL_CONFIG.bookmark.message_prev + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + '+ D ' + GLOBAL_CONFIG.bookmark.message_next + '.',
|
||||
okButton: "OK",
|
||||
});
|
||||
|
||||
@@ -188,55 +182,64 @@ $(function () {
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
//代码copy
|
||||
// Add copy icon
|
||||
// $('figure.highlight').wrap('<div class="code-area-wrap"></div>')
|
||||
// var $copyIcon = $('<i class="fa fa-clipboard" aria-hidden="true"></i>')
|
||||
// var $notice = $('<div class="copy-notice"></div>')
|
||||
// $('.code-area-wrap').prepend($copyIcon)
|
||||
// $('.code-area-wrap').prepend($notice)
|
||||
// // copy function
|
||||
// function copy(text, ctx) {
|
||||
// if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||
// try {
|
||||
// document.execCommand('copy') // Security exception may be thrown by some browsers.
|
||||
// $(ctx).prev('.copy-notice')
|
||||
// .text(GLOBAL_CONFIG.copy.success)
|
||||
// .velocity({
|
||||
// translateX: -30,
|
||||
// opacity: 1
|
||||
// }, {
|
||||
// loop: 1,
|
||||
// duration: 750,
|
||||
// easing: 'easeOutQuint'
|
||||
// })
|
||||
// } catch (ex) {
|
||||
// $(ctx).prev('.copy-notice')
|
||||
// .text(GLOBAL_CONFIG.copy.error)
|
||||
// .velocity({
|
||||
// translateX: -30,
|
||||
// opacity: 1
|
||||
// }, {
|
||||
// loop: 1,
|
||||
// duration: 750,
|
||||
// easing: 'easeOutQuint'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// } else {
|
||||
// $(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
|
||||
// }
|
||||
// }
|
||||
// // click events
|
||||
// $('.code-area-wrap .fa-clipboard').on('click', function () {
|
||||
// var selection = window.getSelection()
|
||||
// var range = document.createRange()
|
||||
// range.selectNodeContents($(this).siblings('figure').find('.code pre')[0])
|
||||
// selection.removeAllRanges()
|
||||
// selection.addRange(range)
|
||||
// var text = selection.toString()
|
||||
// copy(text, this)
|
||||
// selection.removeAllRanges()
|
||||
// })
|
||||
|
||||
var highlight_copy = GLOBAL_CONFIG.highlight_copy
|
||||
if (highlight_copy == 'true') {
|
||||
$('figure.highlight').wrap('<div class="code-area-wrap"></div>')
|
||||
var $copyIcon = $('<i class="fa fa-clipboard" aria-hidden="true"></i>')
|
||||
var $notice = $('<div class="copy-notice"></div>')
|
||||
$('.code-area-wrap').prepend($copyIcon)
|
||||
$('.code-area-wrap').prepend($notice)
|
||||
// copy function
|
||||
function copy(text, ctx) {
|
||||
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||
try {
|
||||
document.execCommand('copy') // Security exception may be thrown by some browsers.
|
||||
$(ctx).prev('.copy-notice')
|
||||
.text(GLOBAL_CONFIG.copy.success)
|
||||
.animate({
|
||||
opacity: 1,
|
||||
right: 30
|
||||
}, 450, function () {
|
||||
setTimeout(function () {
|
||||
$(ctx).prev('.copy-notice').animate({
|
||||
opacity: 0,
|
||||
right: 0
|
||||
}, 650)
|
||||
}, 400)
|
||||
})
|
||||
} catch (ex) {
|
||||
$(ctx).prev('.copy-notice')
|
||||
.text(GLOBAL_CONFIG.copy.error)
|
||||
.animate({
|
||||
opacity: 1,
|
||||
right: 30
|
||||
}, 650, function () {
|
||||
setTimeout(function () {
|
||||
$(ctx).prev('.copy-notice').animate({
|
||||
opacity: 0,
|
||||
right: 0
|
||||
}, 650)
|
||||
}, 400)
|
||||
})
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
$(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
|
||||
}
|
||||
}
|
||||
// click events
|
||||
$('.code-area-wrap .fa-clipboard').on('click', function () {
|
||||
var selection = window.getSelection()
|
||||
var range = document.createRange()
|
||||
range.selectNodeContents($(this).siblings('figure').find('.code pre')[0])
|
||||
selection.removeAllRanges()
|
||||
selection.addRange(range)
|
||||
var text = selection.toString()
|
||||
copy(text, this)
|
||||
selection.removeAllRanges()
|
||||
})
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//fancybox
|
||||
var imgList = $(".recent-post-info img");
|
||||
@@ -517,25 +520,22 @@ $(function () {
|
||||
$('body').toggleClass('read-mode');
|
||||
$('#font_plus,#font_minus').toggleClass('is_visible');
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$('body').toggleClass('read-mode');
|
||||
$('#font_plus,#font_minus').toggleClass('is_visible');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//閲讀模式下字體調整
|
||||
|
||||
//閲讀模式下字體調整
|
||||
$("#font_plus").click(function () {
|
||||
var font_size_record = parseFloat($('body').css('font-size'))
|
||||
$('body').css('font-size',font_size_record + 1)
|
||||
}
|
||||
);
|
||||
var font_size_record = parseFloat($('body').css('font-size'))
|
||||
$('body').css('font-size', font_size_record + 1)
|
||||
});
|
||||
|
||||
$("#font_minus").click(function () {
|
||||
var font_size_record = parseFloat($('body').css('font-size'))
|
||||
$('body').css('font-size',font_size_record - 1)
|
||||
}
|
||||
);
|
||||
var font_size_record = parseFloat($('body').css('font-size'))
|
||||
$('body').css('font-size', font_size_record - 1)
|
||||
});
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user