diff --git "a/\\" "b/\\" deleted file mode 100644 index 5c36b35..0000000 --- "a/\\" +++ /dev/null @@ -1,21 +0,0 @@ -const buttons = document.getElementsByClassName("randomword-button"); - -export function randomizeWords() { - registerButtons(); -} - -function registerButtons() { - for (let button of buttons) { - button.addEventListener("click", function () { - button.innerHTML = processWordlist(button.getAttribute("data-wordlist")); - }); - button.click(); - } -} - -// takes all the words and returns only one -function processWordlist(wordlist) { - return wordlist; -} - -function stripSpaces() {} diff --git a/assets/scss/colors.scss b/assets/scss/colors.scss index 4fa1ad5..6b6bef4 100644 --- a/assets/scss/colors.scss +++ b/assets/scss/colors.scss @@ -35,25 +35,6 @@ a { color: $dark-ln; } -.randomword-button{ - &.light { - border-color: $light-fg; - background-color: $light-bg; - color: $light-fg; - &:hover { - color: $light-bg; - background-color: $light-fg; - } - } - border-color: $dark-fg; - background-color: $dark-bg; - color: $dark-fg; - &:hover{ - color: $dark-bg; - background-color: $dark-fg; - } -} - a.footer-nav-item.active, a.footer-nav-item:hover { &.light { diff --git a/assets/scss/layout.scss b/assets/scss/layout.scss index 08feff7..ac403a4 100644 --- a/assets/scss/layout.scss +++ b/assets/scss/layout.scss @@ -21,19 +21,13 @@ footer { margin-bottom: 84pt; } -.randomword-button { - width: auto; - height: auto; -} - #content p, #content ul, #content ol, #content table, code, .postdescription, -hr, -#content div .video-player +hr { margin-right: 24%; margin-left: 24%; diff --git a/assets/scss/style.scss b/assets/scss/style.scss index 14e75e0..664d339 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -108,12 +108,3 @@ ul a{ padding: 0.12em; } } - -.randomword-button { - border-style: solid; - padding: 0.12em; - border-radius: 0; - &::before { - content: " "; - } -} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6adab8f..69a1be2 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -5,5 +5,6 @@ {{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
{{- partial "footer.html" . -}} + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 1b6c536..37a42f3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -2,7 +2,6 @@ {{ .Title }}@{{ .Site.Title }} - {{ $css := resources.Get "scss/main.scss" }} {{ $css = $css | toCSS }} diff --git a/layouts/shortcodes/randomword.html b/layouts/shortcodes/randomword.html deleted file mode 100644 index 5fdf4fd..0000000 --- a/layouts/shortcodes/randomword.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/static/js/lightmode.js b/static/js/lightmode.js index 2bcc10b..cc5f62d 100644 --- a/static/js/lightmode.js +++ b/static/js/lightmode.js @@ -12,6 +12,7 @@ function switchToLight() { function switchToDark() { button.innerHTML = ""; for (let item of colorswitchers) { + console.log(item); item.classList.remove("light"); } } diff --git a/static/js/main.js b/static/js/main.js index fbd249e..6fc7c3d 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,9 +1,7 @@ import { updateMode } from "./lightmode.js"; import { activateHamburger } from "./hamburger.js"; -import { randomizeWords } from "./randomword.js"; document.addEventListener("DOMContentLoaded", () => { updateMode(); activateHamburger(); - randomizeWords(); }); diff --git a/static/js/randomword.js b/static/js/randomword.js deleted file mode 100644 index d6f0f65..0000000 --- a/static/js/randomword.js +++ /dev/null @@ -1,38 +0,0 @@ -const buttons = document.getElementsByClassName("randomword-button"); - -export function randomizeWords() { - registerButtons(); -} - -function registerButtons() { - for (let button of buttons) { - button.addEventListener("click", function () { - button.innerHTML = processWordlist( - button.getAttribute("data-wordlist"), - button.innerHTML - ); - // do this so people dont have to click twice - }); - button.click(); - } -} - -// takes all the words and returns only one -function processWordlist(wordlist, old) { - let seperated = wordlist.split(","); - for (let word of wordlist) { - word = word.trim(); - } - if (seperated.length <= 0) { - return "error! empty"; - } - if (seperated.length == 1) { - return seperated[0]; - } - seperated = seperated.filter((e) => e !== old); - return seperated.random(); -} - -Array.prototype.random = function () { - return this[Math.floor(Math.random() * this.length)]; -};