浏览代码

Minor fixes

Track3 6 年之前
父节点
当前提交
562eca8eab
共有 3 个文件被更改,包括 52 次插入22 次删除
  1. 6 3
      assets/js/main.js
  2. 41 14
      assets/scss/style.scss
  3. 5 5
      layouts/partials/social-svg.html

+ 6 - 3
assets/js/main.js

@@ -18,7 +18,11 @@ const loadScript = (source, beforeEl, async = true, defer = true) => {
         script.onreadystatechange = null;
         script = undefined;
 
-        if (isAbort) { reject(); } else { resolve(); }
+        if (isAbort) {
+          reject();
+        } else {
+          resolve();
+        }
       }
     }
 
@@ -58,8 +62,7 @@ const autoHideHeader = () => {
   if (currentScrollPosition > lastScrollPosition) {
     header.classList.remove('slideInUp');
     header.classList.add('slideOutDown');
-  }
-  else {
+  } else {
     header.classList.remove('slideOutDown');
     header.classList.add('slideInUp');
   }

+ 41 - 14
assets/scss/style.scss

@@ -12,7 +12,8 @@
 
 ::-webkit-scrollbar-thumb {
   background: #888;
-  &:hover{
+
+  &:hover {
     background: $text;
   }
 }
@@ -23,12 +24,18 @@ html {
   letter-spacing: .06em;
 }
 
-body, button, input, select, textarea {
+body,
+button,
+input,
+select,
+textarea {
   color: $text;
   font-family: $fonts;
 }
 
-pre, code, pre tt {
+pre,
+code,
+pre tt {
   font-family: $code-fonts;
 }
 
@@ -68,9 +75,11 @@ blockquote {
   margin: 1em;
   padding: 0 1em;
   font-style: italic;
+
   cite {
     font-weight: bold;
     font-style: normal;
+
     &::before {
       content: "—— ";
     }
@@ -107,7 +116,8 @@ table {
   width: 100%;
   max-width: 100%;
 
-  th, td {
+  th,
+  td {
     padding: 1.5%;
     border: 1px solid;
   }
@@ -185,7 +195,7 @@ table {
   bottom: 0;
   width: 100%;
   box-sizing: border-box;
-  box-shadow: -1px -2px 3px rgba(0,0,0,0.45);
+  box-shadow: -1px -2px 3px rgba(0, 0, 0, 0.45);
   background-color: $dark-grey;
 }
 
@@ -204,10 +214,12 @@ table {
     margin-right: .8em;
     font-size: 1.2em;
   }
+
   .site-nav {
     display: inline-block;
     font-size: 1.1em;
     opacity: .8;
+
     a {
       margin-left: .8em;
     }
@@ -230,7 +242,8 @@ table {
   cursor: pointer;
 }
 
-#menu-btn, #search-btn {
+#menu-btn,
+#search-btn {
   display: none;
   cursor: pointer;
 }
@@ -242,7 +255,7 @@ table {
   padding: .6em 1.8em;
   z-index: 1;
   box-sizing: border-box;
-  box-shadow: -1px -2px 3px 0px rgba(0,0,0,0.45);
+  box-shadow: -1px -2px 3px 0px rgba(0, 0, 0, 0.45);
   background-color: $dark-grey;
 
   a {
@@ -345,7 +358,7 @@ p.catguard {
   font-size: 1.4em;
 }
 
-#home-nav a{
+#home-nav a {
     display: block;
     border: none;
     text-align: center;
@@ -357,7 +370,7 @@ p.catguard {
 .posts-group {
   display: flex;
 
-  .post-year{
+  .post-year {
     font-size: 1.6em;
     margin: 0.4em 2em 1em 0;
     @include dimmed;
@@ -472,7 +485,8 @@ hr.post-end {
     border-radius: 4px;
   }
 
-  ul, ol {
+  ul,
+  ol {
     padding: 0;
     margin-left: 1.8em;
   }
@@ -488,8 +502,10 @@ figure.right {
   margin-left: 1em;
 }
 
-.footnote-ref a, a.footnote-return {
+.footnote-ref a,
+a.footnote-return {
   border: none;
+
   &:hover {
     background: transparent;
   }
@@ -545,6 +561,7 @@ figure.right {
   text-align: center;
   font-size: 2.5em;
   margin-top: 2.5em;
+
   svg {
     animation-duration: 1.2s;
   }
@@ -568,6 +585,7 @@ figure.right {
 
   .vwrap {
     border: 2px solid $text;
+
     input {
       border-bottom-width: 2px;
     }
@@ -593,16 +611,19 @@ figure.right {
 
   .vcontent {
     padding: 0;
+
     code {
       margin: 0 4px;
       color: #eee;
       background: $highlight-grey;
     }
+
     pre {
       color: #eee;
       background: $midnightblue;
       padding: 1em 1.5em;
       border-radius: 5px;
+
       code {
         background: $midnightblue;
       }
@@ -656,11 +677,14 @@ figure.right {
 }
 
 @media (max-width: 760px) {
-  .hide-in-mobile, .site-nav.hide-in-mobile {
+
+  .hide-in-mobile,
+  .site-nav.hide-in-mobile {
     display: none;
   }
 
-  #menu-btn, #search-btn {
+  #menu-btn,
+  #search-btn {
     display: inline-block;
   }
 
@@ -674,6 +698,7 @@ figure.right {
       border-bottom: 2px dashed;
     }
   }
+
   #spotlight.error-404 {
     flex-direction: column;
     text-align: center;
@@ -685,7 +710,9 @@ figure.right {
 }
 
 @media (max-width: 520px) {
-  figure.left, figure.right {
+
+  figure.left,
+  figure.right {
     float: unset;
     margin: 0;
   }

+ 5 - 5
layouts/partials/social-svg.html

@@ -1,9 +1,9 @@
-{{- if eq "twitter" .name -}}
+{{- if (eq .name "twitter") -}}
 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-twitter"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg>
-{{- end -}}
-{{- if eq "telegram" .name -}}
+{{- else if (eq .name "telegram") -}}
 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="feather"><path d="m 22.05,1.577 c -0.393,-0.016 -0.784,0.08 -1.117,0.235 -0.484,0.186 -4.92,1.902 -9.41,3.64 C 9.263,6.325 7.005,7.198 5.267,7.867 3.53,8.537 2.222,9.035 2.153,9.059 c -0.46,0.16 -1.082,0.362 -1.61,0.984 -0.79581202,1.058365 0.21077405,1.964825 1.004,2.499 1.76,0.564 3.58,1.102 5.087,1.608 0.556,1.96 1.09,3.927 1.618,5.89 0.174,0.394 0.553,0.54 0.944,0.544 l -0.002,0.02 c 0,0 0.307,0.03 0.606,-0.042 0.3,-0.07 0.677,-0.244 1.02,-0.565 0.377,-0.354 1.4,-1.36 1.98,-1.928 l 4.37,3.226 0.035,0.02 c 0,0 0.484,0.34 1.192,0.388 0.354,0.024 0.82,-0.044 1.22,-0.337 0.403,-0.294 0.67,-0.767 0.795,-1.307 0.374,-1.63 2.853,-13.427 3.276,-15.38 L 23.676,4.725 C 23.972,3.625 23.863,2.617 23.18,2.02 22.838,1.723 22.444,1.593 22.05,1.576 Z"></path></svg>
-{{- end -}}
-{{- if eq "github" .name -}}
+{{- else if (eq .name "github") -}}
 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
+{{- else -}}
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
 {{- end -}}