Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/darshanbaral/aafu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Baral <darshanbaral@gmail.com>2019-07-20 19:15:23 +0300
committerDarshan Baral <darshanbaral@gmail.com>2019-07-20 19:15:23 +0300
commit7a14f4e0eb4d001f2e11fdc0914a9f74ef311f01 (patch)
tree8bfd78f1608af770ed23609849175a8f9880cfbb
parent3a4879fffa13ca65e17db431113f8c2033278835 (diff)
Added type to colorCSS
-rw-r--r--layouts/partials/head.html1
-rw-r--r--layouts/partials/toggleTheme.html20
2 files changed, 11 insertions, 10 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 8d160e2..f2b9fea 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -26,6 +26,7 @@
id="color-CSS"
rel="stylesheet"
href="{{ print `/css/aafu_` .Site.Params.theme.mainTheme `.css` | relURL }}"
+ type="text/css"
/>
<link rel="stylesheet" href="{{ `/css/aafu.css` | relURL }}" />
diff --git a/layouts/partials/toggleTheme.html b/layouts/partials/toggleTheme.html
index 457921e..912c9d7 100644
--- a/layouts/partials/toggleTheme.html
+++ b/layouts/partials/toggleTheme.html
@@ -9,25 +9,25 @@
</div>
<script>
- let mainTheme =
+ const mainTheme =
"{{ print `/css/aafu_` .Site.Params.theme.mainTheme `.css` | absURL }}";
- let altTheme =
+ const altTheme =
"{{ print `/css/aafu_` .Site.Params.theme.altTheme `.css` | absURL }}";
- let toggleTheme = function(elem) {
+ const currentCSS = document.querySelector("#color-CSS");
+ function toggleTheme(elem) {
elem.classList.toggle("fa-toggle-off");
elem.classList.toggle("fa-toggle-on");
- let currentCSS = document.querySelector("#color-CSS");
if (currentCSS.href.includes(mainTheme)) {
- currentCSS.href = altTheme;
+ currentCSS.setAttribute("href", altTheme);
} else {
- currentCSS.href = mainTheme;
+ currentCSS.setAttribute("href", mainTheme);
}
- };
+ }
- let changeThemeColor = function() {
+ function changeThemeColor() {
themeColor.content = getComputedStyle(document.body)["background-color"];
- };
- let thisBody = document.body;
+ }
+ const thisBody = document.body;
thisBody.addEventListener("webkitTransitionEnd", changeThemeColor);
thisBody.addEventListener("transitionend", changeThemeColor);
</script>