Moved qJuery install

This commit is contained in:
Kristofers Solo 2023-01-21 20:31:55 +02:00
parent 4a1cdd1236
commit f4137a4cf6
11 changed files with 125 additions and 159 deletions

47
'
View File

@ -1,47 +0,0 @@
$(document).ready(function () {
let lightmode = localStorage.getItem("lightmode")
const HTML = $("html")
const AUDIO = $("#flashbang")
const enable_light_mode = () => {
HTML.attr("data-color-mode", "light")
localStorage.setItem("lightmode", "enabled")
}
const disable_light_mode = () => {
HTML.attr("data-color-mode", "dark")
localStorage.setItem("lightmode", null)
}
if (lightmode === "enabled") {
enable_light_mode()
}
window
.matchMedia("(prefers-color-scheme: dark)")
.addEventListener("change", (event) => {
if (event.matches) {
disable_light_mode()
} else {
enable_light_mode()
}
})
if (window.matchMedia) {
if (window.matchMedia("(prefers-color-scheme: light)").matches) {
enable_light_mode()
} else {
disable_light_mode()
}
}
$("#color-mode-toggle").click(() => {
lightmode = localStorage.getItem("lightmode")
if (lightmode !== "enabled") {
enable_light_mode()
AUDIO[0].play()
} else {
disable_light_mode()
}
})
})

View File

@ -1,15 +1,15 @@
$(document).ready(function () {
window.addEventListener("DOMContentLoaded", () => {
const HTML = document.documentElement
const AUDIO = document.getElementById("flashbang")
let lightmode = localStorage.getItem("lightmode")
const HTML = $("html")
const AUDIO = $("#flashbang")
const enable_light_mode = () => {
HTML.attr("data-color-mode", "light")
HTML.setAttribute("data-color-mode", "light")
localStorage.setItem("lightmode", "enabled")
}
const disable_light_mode = () => {
HTML.attr("data-color-mode", "dark")
HTML.setAttribute("data-color-mode", "dark")
localStorage.setItem("lightmode", null)
}
@ -35,11 +35,13 @@ $(document).ready(function () {
}
}
$("#color-mode-toggle").click(() => {
document
.querySelector("#color-mode-toggle")
.addEventListener("click", () => {
lightmode = localStorage.getItem("lightmode")
if (lightmode !== "enabled") {
enable_light_mode()
AUDIO[0].play()
AUDIO.play()
} else {
disable_light_mode()
}

View File

@ -1,3 +1,4 @@
window.addEventListener("DOMContentLoaded", () => {
const COLORS = [
"#2ff924",
"#2e67f8",
@ -7,7 +8,10 @@ const COLORS = [
"#ffffff",
]
let random_color = COLORS[Math.floor(Math.random() * COLORS.length)]
document.documentElement.style.setProperty("--lightsaber-color", random_color)
document.documentElement.style.setProperty(
"--lightsaber-color",
random_color
)
let body = document.body
body.addEventListener("click", () => {
@ -26,3 +30,4 @@ document.addEventListener("keypress", () => {
? document.head.removeChild(style)
: document.head.appendChild(style)
})
})

View File

@ -1,3 +1,4 @@
window.addEventListener("DOMContentLoaded", () => {
const PRIMARY_NAV = document.querySelector(".primary-navigation")
const MENU_BUTTON = document.querySelector(".mobile-nav-toggle")
@ -13,3 +14,4 @@ MENU_BUTTON.addEventListener("click", () => {
MENU_BUTTON.classList.remove("open")
}
})
})

View File

@ -1,3 +1,4 @@
window.addEventListener("DOMContentLoaded", () => {
const DISPLAY_NAME = document.getElementById("swap-text")
const NAMES = [
"Kristiāns",
@ -15,3 +16,4 @@ const NAMES = [
DISPLAY_NAME.addEventListener("click", () => {
DISPLAY_NAME.innerHTML = NAMES[Math.floor(Math.random() * NAMES.length)]
})
})

View File

@ -1,5 +1,6 @@
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
window.addEventListener("DOMContentLoaded", () => {
window.addEventListener("load", async () => {
const TEXT_DISPLAY = document.getElementById("rotating-text")
const PHRASES = ["Software Developer", "Jedi", "Student"]
@ -34,3 +35,4 @@ window.addEventListener("load", async () => {
}
}
})
})

View File

@ -88,8 +88,8 @@ $(document).ready(function () {
$("#submit-btn").remove()
}
}
})
$("#register-form").submit(function (e) {
e.preventDefault()
$("#submit-btn").click(function () {
$("#register-form").submit()
})
})

View File

@ -1,3 +1,4 @@
window.addEventListener("DOMContentLoaded", () => {
document.getElementById("cards").onmousemove = (e) => {
for (const CARD of document.getElementsByClassName("card")) {
const RECT = CARD.getBoundingClientRect(),
@ -7,3 +8,4 @@ document.getElementById("cards").onmousemove = (e) => {
CARD.style.setProperty("--mouse-y", `${y}px`)
}
}
})

View File

@ -5,8 +5,6 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="{% static 'main/img/icons/logo.svg' %}" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet">
<title>
@ -27,7 +25,6 @@
<link rel="stylesheet"
type="text/css"
href="{% static 'main/css/layout.css' %}"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="{% static 'main/js/navigation.js' %}" defer></script>
<script src="{% static 'main/js/lightmode.js' %}" defer></script>
{% block meta %}{% endblock %}

View File

@ -5,6 +5,7 @@
<link rel="stylesheet"
type="text/css"
href="{% static 'main/css/validation.css' %}"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="{% static 'main/js/validation.js' %}" defer></script>
{% endblock %}
{% block content %}

View File

@ -137,8 +137,8 @@
detected, according to the expected signal - permission to continue the route.
</p>
<p>
Ierosinātais risinājums sastāv no 4 pamatprincipiem, kas likvidē cilvēka reakcijas laika ietekmi
uz satiksmes sastrēgumu realizāciju:
The proposed solution consists of 4 basic principles that eliminate the impact of
human reaction time on the realisation of traffic congestion:
</p>
<ul>
<li>
@ -163,7 +163,7 @@
received, using the basic module for the audible signal or the optional light and other user interfaces formats.
</li>
</ul>
<p>Aprakstītā ierīce pamatprincipu un funkcionalitātes nodrošināšanai izmanto:</p>
<p>The device described uses the following to provide the basic principles and functionality:</p>
<ul>
<li>
Raspberry Pi 4 microcontroller -