mirror of
https://git.kittycat.homes/zoe/hugo-battheme.git
synced 2024-08-15 03:25:18 +00:00
Compare commits
No commits in common. "3967fa102756f2e97fa17cb5693775e35c964543" and "26372fdcca121d7d9a5b5ae4c4259efd1bbc69f3" have entirely different histories.
3967fa1027
...
26372fdcca
10 changed files with 3 additions and 98 deletions
21
\
21
\
|
@ -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() {}
|
|
|
@ -35,25 +35,6 @@ a {
|
||||||
color: $dark-ln;
|
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.active,
|
||||||
a.footer-nav-item:hover {
|
a.footer-nav-item:hover {
|
||||||
&.light {
|
&.light {
|
||||||
|
|
|
@ -21,19 +21,13 @@ footer {
|
||||||
margin-bottom: 84pt;
|
margin-bottom: 84pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
.randomword-button {
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content p,
|
#content p,
|
||||||
#content ul,
|
#content ul,
|
||||||
#content ol,
|
#content ol,
|
||||||
#content table,
|
#content table,
|
||||||
code,
|
code,
|
||||||
.postdescription,
|
.postdescription,
|
||||||
hr,
|
hr
|
||||||
#content div .video-player
|
|
||||||
{
|
{
|
||||||
margin-right: 24%;
|
margin-right: 24%;
|
||||||
margin-left: 24%;
|
margin-left: 24%;
|
||||||
|
|
|
@ -108,12 +108,3 @@ ul a{
|
||||||
padding: 0.12em;
|
padding: 0.12em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.randomword-button {
|
|
||||||
border-style: solid;
|
|
||||||
padding: 0.12em;
|
|
||||||
border-radius: 0;
|
|
||||||
&::before {
|
|
||||||
content: " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,5 +5,6 @@
|
||||||
{{- partial "header.html" . -}}
|
{{- partial "header.html" . -}}
|
||||||
<div id="content">{{- block "main" . }}{{- end }}</div>
|
<div id="content">{{- block "main" . }}{{- end }}</div>
|
||||||
{{- partial "footer.html" . -}}
|
{{- partial "footer.html" . -}}
|
||||||
|
<script type="module" src="/js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>{{ .Title }}@{{ .Site.Title }}</title>
|
<title>{{ .Title }}@{{ .Site.Title }}</title>
|
||||||
<script type="module" src="/js/main.js"></script>
|
|
||||||
{{ $css := resources.Get "scss/main.scss" }}
|
{{ $css := resources.Get "scss/main.scss" }}
|
||||||
{{ $css = $css | toCSS }}
|
{{ $css = $css | toCSS }}
|
||||||
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<button class="randomword-button colorswitch" data-wordlist="{{.Get 0}}"></button>
|
|
|
@ -12,6 +12,7 @@ function switchToLight() {
|
||||||
function switchToDark() {
|
function switchToDark() {
|
||||||
button.innerHTML = "";
|
button.innerHTML = "";
|
||||||
for (let item of colorswitchers) {
|
for (let item of colorswitchers) {
|
||||||
|
console.log(item);
|
||||||
item.classList.remove("light");
|
item.classList.remove("light");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import { updateMode } from "./lightmode.js";
|
import { updateMode } from "./lightmode.js";
|
||||||
import { activateHamburger } from "./hamburger.js";
|
import { activateHamburger } from "./hamburger.js";
|
||||||
import { randomizeWords } from "./randomword.js";
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
updateMode();
|
updateMode();
|
||||||
activateHamburger();
|
activateHamburger();
|
||||||
randomizeWords();
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -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)];
|
|
||||||
};
|
|
Loading…
Add table
Add a link
Reference in a new issue