diff options
| author | Eltrac <45323514+BigCoke233@users.noreply.github.com> | 2019-07-20 12:41:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-20 12:41:10 +0800 |
| commit | 4c7eff848dd38e826787fbd29dd2d8185ba42278 (patch) | |
| tree | df3b23ab5c91385f312b902a1507fa8866cf25f8 /assets | |
| parent | 947afd00d203b1523dad5578338540d36ad49408 (diff) | |
规范代码结构/增加设置项/优化部分样式
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/css/dark.miracles.css | 5 | ||||
| -rw-r--r-- | assets/css/miracles.min.css | 89 | ||||
| -rw-r--r-- | assets/js/miracles.min.js | 83 |
3 files changed, 138 insertions, 39 deletions
diff --git a/assets/css/dark.miracles.css b/assets/css/dark.miracles.css index 9e5b49e..e9071d5 100644 --- a/assets/css/dark.miracles.css +++ b/assets/css/dark.miracles.css @@ -61,7 +61,8 @@ .body-dark .comment-by-author .bubble.comment-content,
.body-dark .bubble.comment-content,
.body-dark .comment-author,
-.body-dark .bubble.saying-body {
+.body-dark .bubble.saying-body,
+.body-dark .tags-item a {
background: #646464
}
/* Need #5a5a5a bg */
@@ -155,7 +156,7 @@ }
.body-dark .nav a:hover,
.body-dark .nav-mobile-title:hover,
-.mobile-menu-pagelist a:hover {
+.body-dark .mobile-menu-pagelist a:hover {
background: #646464
}
.body-dark .nav-icon-button {
diff --git a/assets/css/miracles.min.css b/assets/css/miracles.min.css index 32a105e..707f2f9 100644 --- a/assets/css/miracles.min.css +++ b/assets/css/miracles.min.css @@ -51,6 +51,49 @@ hr { background-color: var(--theme-color)
}
+/* For Body tag */
+.body-dark {
+ /* For the dark theme
+ * turn to 'dark.miracles.css'
+ */
+}
+.body-gray {
+ /* For the gray theme */
+ filter: grayscale(100%);
+ -webkit-filter: grayscale(100%);
+}
+.body-sans-serif {
+ font-family: 'Noto Sans SC',sans-serif
+}
+.body-serif {
+ font-family: 'Noto Serif SC',serif
+}
+
+/* 组件 */
+/* > 按钮 */
+.button {
+ border: 3px solid #ccc;
+ border-radius: 30px;
+ padding: 8px 12px;
+ transition: all .2s;
+}
+.button:hover {
+ border-color: #000;
+ background: #000;
+ color: #fff
+}
+.button-sm {
+ padding: 3px 5px;
+}
+.button-md {
+ border: none;
+ border-radius: 3px;
+}
+.button-md:hover {
+ background: rgb(235,235,235);
+ color: #fff;
+}
+
/* 导航栏 */
.nav {
background: rgba(255,255,255,0.96);
@@ -62,7 +105,7 @@ hr { display: table;
top: 0;
z-index: 10;
- transition: all .2s
+ transition: all .2s;
}
.nav-content {
margin: 0;
@@ -127,14 +170,6 @@ hr { background: rgb(230,230,230);
cursor: pointer
}
-/* 字体 Class */
-.font-sans-serif {
- font-family: 'Noto Sans SC',sans-serif
-}
-
-.font-serif {
- font-family: 'Noto Serif SC',serif
-}
/* 首页大图 */
.index-banner {
margin-top: -21px;
@@ -206,17 +241,8 @@ hr { margin-top: 15px
}
.post-button {
- border: 3px solid #ccc;
- border-radius: 30px;
- padding: 8px 12px;
- transition: all .2s;
float: right
}
-.post-button:hover {
- border-color: #000;
- background: #000;
- color: #fff
-}
.post-footer {
color: #c8c8c8;
font-size: 14px
@@ -260,10 +286,10 @@ hr { display: block;
margin: 20px auto;
border-radius: 3px;
- box-shadow: 0 2px 10px #ccc;
- -moz-box-shadow: 0 2px 10px #ccc;
- -webkit-box-shadow: 0 2px 10px #ccc;
- max-width: 100%
+ box-shadow: 0 4px 20px #ccc;
+ -moz-box-shadow: 0 4px 20px #ccc;
+ -webkit-box-shadow: 0 4px 20px #ccc;
+ max-width: 90%
}
.post-content blockquote p {
margin: 0
@@ -634,20 +660,8 @@ hr { font-size: 100px;
text-shadow: 0 4px 12px #ccc;
}
-.error-button {
- padding: 5px 10px;
- margin: 20px 10px;
- transition: all .2s;
- border: 4px solid #ddd;
- border-radius: 100px;
-}
-.error-button:hover {
- background: #000;
- border-color: #000;
- color: #fff
-}
-/* Buttons */
-/* > 悬浮按钮 */
+
+/* 悬浮按钮 */
.dark-button,.gotop-button {
background: #fdfdfd;
font-size: 22px;
@@ -766,6 +780,7 @@ hr { .bubble.comment-content {
background: rgb(238,238,238);
padding: 3px 8px;
+ padding-right: 12px;
padding-top: -3px;
border-radius: 4px;
min-width: 10px!important;
@@ -788,7 +803,7 @@ hr { .comment-by-author > .container-fluid > .row > .comment-main > .bubble.comment-content:before {
border-right-color: var(--theme-color)
}
-.comment-by-author .bubble.comment-content .comment-reply a {
+.comment-by-author > .container-fluid > .row > .comment-main > .bubble.comment-content > .comment-reply a {
color:#fff!important;
}
.comment-reply a {
diff --git a/assets/js/miracles.min.js b/assets/js/miracles.min.js new file mode 100644 index 0000000..9890962 --- /dev/null +++ b/assets/js/miracles.min.js @@ -0,0 +1,83 @@ +/*
+ * The main JavaScript file for Theme Miracles
+ * Author: Eltrac
+ * License: MIT
+ */
+
+//toggleDark
+function Dark() {
+ $("body").toggleClass("body-dark");
+}
+//GoTop
+function GoTop() {
+ $('body,html').animate({scrollTop:0},500);
+ document.body.scrollTop = 0;
+ document.documentElement.scrollTop = 0;
+}
+//LazyLoad
+function LazyLoad() {
+ jQuery(function() {
+ jQuery("img").lazyload(
+ {threshold: 200,effect: "fadeIn"}
+ );
+ });
+}
+//Prism
+function PrismLoad() {
+ var pres = document.getElementsByTagName('pre');
+ for (var i = 0; i < pres.length; i++){
+ if (pres[i].getElementsByTagName('code').length > 0)pres[i].className = 'line-numbers';
+ }
+}
+function PrismReload() {
+ if (typeof Prism !== 'undefined') {
+ var pres = document.getElementsByTagName('pre');
+ for (var i = 0; i < pres.length; i++){
+ if (pres[i].getElementsByTagName('code').length > 0)
+ pres[i].className = 'line-numbers';
+ }
+ Prism.highlightAll(true,null);
+ }
+}
+//Search
+function Search() {
+ $(".search").toggleClass("ready");
+ $(".search-close").toggleClass("ready");
+}
+//mobileMenu
+function toggleMobileMenu() {
+ $(".mobile-menu").toggleClass("ready");
+ $(".mobile-menu-close").toggleClass("ready");
+}
+//Login
+function Login() {
+ $(".login").toggleClass("ready");
+ $(".login-close").toggleClass("ready");
+}
+//owo
+function owoLoad() {
+ var OwO_demo = new OwO({
+ logo: 'OωO表情',
+ container: document.getElementsByClassName('OwO')[0],
+ target: document.getElementsByClassName('OwO-textarea')[0],
+ api: owoJson,
+ position: 'down',
+ width: '300px',
+ maxHeight: '250px'
+ });
+}
+//pjax-loader
+if(loadPjax = true) {
+ $(document).pjax('a[href^="'+siteurl+'"]:not(a[target="_blank"], a[no-pjax])', {
+ container: '#pjax-container',fragment: '#pjax-container',timeout: 8000
+ }).on('pjax:send', function () {
+ GoTop();
+ beforePjax();
+ }).on('pjax:complete', function () {
+ $('form#login-form').addClass('need-refresh');
+ NProgress.done();
+ LazyLoad();
+ PrismReload();
+ afterPjax();
+ });
+}
\ No newline at end of file |
