diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 4 | ||||
-rw-r--r-- | layouts/partials/comment-utterances.html | 56 | ||||
-rw-r--r-- | layouts/partials/fas/fa-angle-double-left.html | 1 | ||||
-rw-r--r-- | layouts/partials/fas/fa-angle-double-right.html | 1 | ||||
-rw-r--r-- | layouts/partials/fas/fa-angle-left.html | 1 | ||||
-rw-r--r-- | layouts/partials/fas/fa-angle-right.html | 1 | ||||
-rw-r--r-- | layouts/partials/fas/fa-angle-up.html | 1 | ||||
-rw-r--r-- | layouts/partials/head.html | 30 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 50 | ||||
-rw-r--r-- | layouts/shortcodes/lazyimg-col.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/lazyimg-row.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/lazyimg.html | 2 |
12 files changed, 27 insertions, 124 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a1eb732..d6e53f4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -15,8 +15,8 @@ <div class="col-md-3 col-12 float-left" id="sidebar"> {{ partial "sidebar.html" . }} </div> - <div id="container-progress"> - <div id="progress"></div> + <div id="scroll-top"> + <i class="fas fa-chevron-up"></i> </div> </div> </main> diff --git a/layouts/partials/comment-utterances.html b/layouts/partials/comment-utterances.html index 9411ee5..d217238 100644 --- a/layouts/partials/comment-utterances.html +++ b/layouts/partials/comment-utterances.html @@ -1,59 +1,5 @@ <div id="post-loading"> - <div class="loadingio-spinner-rolling-cfxk9ra3y9n"> - <div class="loading-rolling"> - <div></div> - </div> - </div> - <style type="text/css"> - @keyframes loading-rolling { - 0% { - transform: translate(-50%, -50%) rotate(0deg); - } - - 100% { - transform: translate(-50%, -50%) rotate(360deg); - } - } - - .loading-rolling div { - position: absolute; - width: 60px; - height: 60px; - border: 10px solid #8aa2d3; - border-top-color: transparent; - border-radius: 50%; - } - - .loading-rolling div { - animation: loading-rolling 1s linear infinite; - top: 50px; - left: 50px - } - - .loadingio-spinner-rolling-cfxk9ra3y9n { - width: 100px; - height: 100px; - display: inline-block; - overflow: hidden; - background: none; - } - - .loading-rolling { - width: 100%; - height: 100%; - position: relative; - transform: translateZ(0) scale(1); - backface-visibility: hidden; - transform-origin: 0 0; - /* see note above */ - } - - .loading-rolling div { - box-sizing: content-box; - } - - /* generated by https://loading.io/ */ - </style> + <i class="fas fa-circle-notch fa-spin"></i> <p>{{ i18n "postCommentLoading" }}</p> </div> <div id="post-comment"> diff --git a/layouts/partials/fas/fa-angle-double-left.html b/layouts/partials/fas/fa-angle-double-left.html deleted file mode 100644 index 95887a1..0000000 --- a/layouts/partials/fas/fa-angle-double-left.html +++ /dev/null @@ -1 +0,0 @@ -<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-double-left" class="svg-inline--fa fa-angle-double-left fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"></path></svg>
\ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-double-right.html b/layouts/partials/fas/fa-angle-double-right.html deleted file mode 100644 index 998f859..0000000 --- a/layouts/partials/fas/fa-angle-double-right.html +++ /dev/null @@ -1 +0,0 @@ -<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-double-right" class="svg-inline--fa fa-angle-double-right fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"></path></svg>
\ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-left.html b/layouts/partials/fas/fa-angle-left.html deleted file mode 100644 index 39198fc..0000000 --- a/layouts/partials/fas/fa-angle-left.html +++ /dev/null @@ -1 +0,0 @@ -<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-left" class="svg-inline--fa fa-angle-left fa-w-8" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"></path></svg>
\ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-right.html b/layouts/partials/fas/fa-angle-right.html deleted file mode 100644 index 26cb61e..0000000 --- a/layouts/partials/fas/fa-angle-right.html +++ /dev/null @@ -1 +0,0 @@ -<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" class="svg-inline--fa fa-angle-right fa-w-8" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"></path></svg>
\ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-up.html b/layouts/partials/fas/fa-angle-up.html deleted file mode 100644 index 47ffb0b..0000000 --- a/layouts/partials/fas/fa-angle-up.html +++ /dev/null @@ -1 +0,0 @@ -<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-up" class="svg-inline--fa fa-angle-up fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"></path></svg>
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 9f3ef76..05670e5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -25,14 +25,14 @@ <!-- global css --> {{ $options := (dict "targetPath" "css/main.min.css" "outputStyle" "compressed") }} -{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options | resources.Fingerprint }} -<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" /> +{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} +<link rel="stylesheet" href="{{ $style.Permalink }}" /> {{ if .Site.Params.useCDN }} <!-- global dependency --> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.0/dist/jquery.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/lazysizes@5.2.0/lazysizes.min.js" integrity="sha256-h2tMEmhemR2IN4wbbdNjj9LaDIjzwk2hralQwfJmBOE=" crossorigin="anonymous"></script> -<script src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/js/fontawesome.min.js" integrity="sha256-NP9NujdEzS5m4ZxvNqkcbxyHB0dTRy9hG13RwTVBGwo=" crossorigin="anonymous"></script> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/all.min.css" integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous"> <!-- optional katex math --> {{ if or .Params.math .Site.Params.math }} <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous" /> @@ -41,20 +41,20 @@ {{ end }} {{ else }} <!-- global dependency --> -{{ $jquery := resources.Get "js/jquery.min.js" | resources.Fingerprint }} -<script src="{{ $jquery.Permalink }}" integrity="{{ $jquery.Data.Integrity }}" crossorigin="anonymous"></script> -{{ $lazysizes := resources.Get "js/lazysizes.min.js" | resources.Fingerprint }} -<script src="{{ $lazysizes.Permalink }}" integrity="{{ $lazysizes.Data.Integrity }}" crossorigin="anonymous"></script> -{{ $fontawesome := resources.Get "js/fontawesome.min.js" | resources.Fingerprint }} -<script src="{{ $fontawesome.Permalink }}" integrity="{{ $fontawesome.Data.Integrity }}" crossorigin="anonymous"></script> +{{ $jquery := resources.Get "js/jquery.min.js" }} +<script src="{{ $jquery.Permalink }}"></script> +{{ $lazysizes := resources.Get "js/lazysizes.min.js" }} +<script src="{{ $lazysizes.Permalink }}"></script> +{{ $fontawesome := resources.Get "css/all.min.css" }} +<link rel="stylesheet" href="{{ $fontawesome.Permalink }}" /> <!-- optional katex math --> {{ if or .Params.math .Site.Params.math }} -{{ $katexCSS := resources.Get "css/katex.min.css" | resources.Fingerprint }} -<link rel="stylesheet" href="{{ $katexCSS.Permalink }}" integrity="{{ $katexCSS.Data.Integrity }}" crossorigin="anonymous" /> -{{ $katexJS := resources.Get "js/katex.min.js" | resources.Fingerprint }} -<script defer src="{{ $katexJS.Permalink }}" integrity="{{ $katexJS.Data.Integrity }}" crossorigin="anonymous"></script> -{{ $katexRender := resources.Get "js/auto-render.min.js" | resources.Fingerprint }} -<script defer src="{{ $katexRender.Permalink }}" integrity="{{ $katexRender.Data.Integrity }}" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script> +{{ $katexCSS := resources.Get "css/katex.min.css" }} +<link rel="stylesheet" href="{{ $katexCSS.Permalink }}" /> +{{ $katexJS := resources.Get "js/katex.min.js" }} +<script defer src="{{ $katexJS.Permalink }}"></script> +{{ $katexRender := resources.Get "js/auto-render.min.js" }} +<script defer src="{{ $katexRender.Permalink }}" onload="renderMathInElement(document.body);"></script> {{ end }} {{ end }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index c47a474..8294611 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -2,38 +2,24 @@ <!-- comment loading indicator --> <script> $(function () { - var loadingBar = new ProgressBar.Circle("#loading-bar", { - color: "#8AA2D3", - strokeWidth: 15, - trailColor: "#E5E2E4", - trailWidth: 15, - fill: "#E5E2E4" - }); - loadingBar.animate(1.0, { - duration: 10000 - }); - var commentStatus; var commentLoadingTime = 0; var commentCheckInterval = self.setInterval(checkUtterances, 500); function checkUtterances() { - commentStatus = $("#post-comment .utterances").attr("style"); + commentStatus = $('#post-comment .utterances').attr('style'); if (commentStatus === undefined) { commentLoadingTime += 1; if (commentLoadingTime > 20) { clearInterval(commentCheckInterval); - $("#post-comment").hide(); - $("#post-loading p").text('{{ i18n "postCommentLoadingFailed" }}'); + $('#post-comment').hide(); + $('#post-loading p').text('{{ i18n "postCommentLoadingFailed" }}'); + $('#post-loading i').attr("class", "far fa-times-circle"); } return; } else { clearInterval(commentCheckInterval); - loadingBar.animate(1.0, { - duration: 500 - }, function () { - $("#post-loading").hide(); - }); + $('#post-loading').hide(); } } }); @@ -42,31 +28,7 @@ {{ if .Site.Params.scrollTop }} <!-- scroll to top button --> <script> - $(function () { - var bar = new ProgressBar.Circle("#progress", { - color: "#8AA2D3", - strokeWidth: 10, - trailColor: "#E5E2E4", - trailWidth: 10, - text: { - value: '{{ partial "fas/fa-angle-up" . }}', - style: null - }, - fill: "#E5E2E4" - }); - var scrolled = ($(window).scrollTop() / ($(document).height() - $(window).height() - 1)); - bar.animate(scrolled); - $(window).scroll(function () { - scrolled = ($(window).scrollTop() / ($(document).height() - $(window).height() - 1)); - if (scrolled < 0.0005) { - scrolled = 0; - } else if (scrolled > 1) { - scrolled = 1; - } - bar.set(scrolled); - }); - }); - $("#container-progress").click(function () { + $("#scroll-top").click(function () { $("html, body").animate({ scrollTop: 0 }, "slow"); diff --git a/layouts/shortcodes/lazyimg-col.html b/layouts/shortcodes/lazyimg-col.html index 0067762..c973e67 100644 --- a/layouts/shortcodes/lazyimg-col.html +++ b/layouts/shortcodes/lazyimg-col.html @@ -1 +1 @@ -<p><img class="lazyload" src="{{ .Site.Params.cdnLazyPlaceholderCol }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file +<p><img class="lazyload" src="{{ .Site.Params.lazyPlaceholderCol }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file diff --git a/layouts/shortcodes/lazyimg-row.html b/layouts/shortcodes/lazyimg-row.html index 1e76de0..83c604e 100644 --- a/layouts/shortcodes/lazyimg-row.html +++ b/layouts/shortcodes/lazyimg-row.html @@ -1 +1 @@ -<p><img class="lazyload" src="{{ .Site.Params.cdnLazyPlaceholderRow }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file +<p><img class="lazyload" src="{{ .Site.Params.lazyPlaceholderRow }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file diff --git a/layouts/shortcodes/lazyimg.html b/layouts/shortcodes/lazyimg.html index 468a901..f9c6959 100644 --- a/layouts/shortcodes/lazyimg.html +++ b/layouts/shortcodes/lazyimg.html @@ -1 +1 @@ -<p><img class="lazyload" src="{{ .Site.Params.cdnLazyPlaceholder }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file +<p><img class="lazyload" src="{{ .Site.Params.lazyPlaceholder }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file |