mirror of
https://github.com/kristoferssolo/kristofersxyz.git
synced 2025-10-21 18:30:34 +00:00
Moved qJuery install
This commit is contained in:
parent
4a1cdd1236
commit
f4137a4cf6
47
'
47
'
@ -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()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@ -1,15 +1,15 @@
|
|||||||
$(document).ready(function () {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
|
const HTML = document.documentElement
|
||||||
|
const AUDIO = document.getElementById("flashbang")
|
||||||
let lightmode = localStorage.getItem("lightmode")
|
let lightmode = localStorage.getItem("lightmode")
|
||||||
const HTML = $("html")
|
|
||||||
const AUDIO = $("#flashbang")
|
|
||||||
|
|
||||||
const enable_light_mode = () => {
|
const enable_light_mode = () => {
|
||||||
HTML.attr("data-color-mode", "light")
|
HTML.setAttribute("data-color-mode", "light")
|
||||||
localStorage.setItem("lightmode", "enabled")
|
localStorage.setItem("lightmode", "enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
const disable_light_mode = () => {
|
const disable_light_mode = () => {
|
||||||
HTML.attr("data-color-mode", "dark")
|
HTML.setAttribute("data-color-mode", "dark")
|
||||||
localStorage.setItem("lightmode", null)
|
localStorage.setItem("lightmode", null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,13 +35,15 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#color-mode-toggle").click(() => {
|
document
|
||||||
lightmode = localStorage.getItem("lightmode")
|
.querySelector("#color-mode-toggle")
|
||||||
if (lightmode !== "enabled") {
|
.addEventListener("click", () => {
|
||||||
enable_light_mode()
|
lightmode = localStorage.getItem("lightmode")
|
||||||
AUDIO[0].play()
|
if (lightmode !== "enabled") {
|
||||||
} else {
|
enable_light_mode()
|
||||||
disable_light_mode()
|
AUDIO.play()
|
||||||
}
|
} else {
|
||||||
})
|
disable_light_mode()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,28 +1,33 @@
|
|||||||
const COLORS = [
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
"#2ff924",
|
const COLORS = [
|
||||||
"#2e67f8",
|
"#2ff924",
|
||||||
"#871efe",
|
"#2e67f8",
|
||||||
"#eb212e",
|
"#871efe",
|
||||||
"#ff8f18",
|
"#eb212e",
|
||||||
"#ffffff",
|
"#ff8f18",
|
||||||
]
|
"#ffffff",
|
||||||
let random_color = COLORS[Math.floor(Math.random() * COLORS.length)]
|
]
|
||||||
document.documentElement.style.setProperty("--lightsaber-color", random_color)
|
let random_color = COLORS[Math.floor(Math.random() * COLORS.length)]
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
"--lightsaber-color",
|
||||||
|
random_color
|
||||||
|
)
|
||||||
|
|
||||||
let body = document.body
|
let body = document.body
|
||||||
body.addEventListener("click", () => {
|
body.addEventListener("click", () => {
|
||||||
body.hidden = true
|
body.hidden = true
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
body.hidden = false
|
body.hidden = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
let style = document.createElement("style")
|
||||||
|
style.innerHTML =
|
||||||
|
" *, *:before, *:after { animation-play-state: paused !important; }"
|
||||||
|
|
||||||
|
document.addEventListener("keypress", () => {
|
||||||
|
style.parentNode
|
||||||
|
? document.head.removeChild(style)
|
||||||
|
: document.head.appendChild(style)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
let style = document.createElement("style")
|
|
||||||
style.innerHTML =
|
|
||||||
" *, *:before, *:after { animation-play-state: paused !important; }"
|
|
||||||
|
|
||||||
document.addEventListener("keypress", () => {
|
|
||||||
style.parentNode
|
|
||||||
? document.head.removeChild(style)
|
|
||||||
: document.head.appendChild(style)
|
|
||||||
})
|
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
const PRIMARY_NAV = document.querySelector(".primary-navigation")
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
const MENU_BUTTON = document.querySelector(".mobile-nav-toggle")
|
const PRIMARY_NAV = document.querySelector(".primary-navigation")
|
||||||
|
const MENU_BUTTON = document.querySelector(".mobile-nav-toggle")
|
||||||
|
|
||||||
MENU_BUTTON.addEventListener("click", () => {
|
MENU_BUTTON.addEventListener("click", () => {
|
||||||
const VISIBILITY = PRIMARY_NAV.getAttribute("data-visible") === "false"
|
const VISIBILITY = PRIMARY_NAV.getAttribute("data-visible") === "false"
|
||||||
if (VISIBILITY) {
|
if (VISIBILITY) {
|
||||||
PRIMARY_NAV.setAttribute("data-visible", true)
|
PRIMARY_NAV.setAttribute("data-visible", true)
|
||||||
MENU_BUTTON.setAttribute("aria-expanded", true)
|
MENU_BUTTON.setAttribute("aria-expanded", true)
|
||||||
MENU_BUTTON.classList.add("open")
|
MENU_BUTTON.classList.add("open")
|
||||||
} else {
|
} else {
|
||||||
PRIMARY_NAV.setAttribute("data-visible", false)
|
PRIMARY_NAV.setAttribute("data-visible", false)
|
||||||
MENU_BUTTON.setAttribute("aria-expanded", false)
|
MENU_BUTTON.setAttribute("aria-expanded", false)
|
||||||
MENU_BUTTON.classList.remove("open")
|
MENU_BUTTON.classList.remove("open")
|
||||||
}
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,17 +1,19 @@
|
|||||||
const DISPLAY_NAME = document.getElementById("swap-text")
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
const NAMES = [
|
const DISPLAY_NAME = document.getElementById("swap-text")
|
||||||
"Kristiāns",
|
const NAMES = [
|
||||||
"Francis",
|
"Kristiāns",
|
||||||
"Cagulis",
|
"Francis",
|
||||||
"Kristiāns Francis Cagulis",
|
"Cagulis",
|
||||||
"KFC",
|
"Kristiāns Francis Cagulis",
|
||||||
"Kristofers",
|
"KFC",
|
||||||
"Solo",
|
"Kristofers",
|
||||||
"Kristofers Solo",
|
"Solo",
|
||||||
"Salaspils 1",
|
"Kristofers Solo",
|
||||||
"Šis puisis",
|
"Salaspils 1",
|
||||||
]
|
"Šis puisis",
|
||||||
|
]
|
||||||
|
|
||||||
DISPLAY_NAME.addEventListener("click", () => {
|
DISPLAY_NAME.addEventListener("click", () => {
|
||||||
DISPLAY_NAME.innerHTML = NAMES[Math.floor(Math.random() * NAMES.length)]
|
DISPLAY_NAME.innerHTML = NAMES[Math.floor(Math.random() * NAMES.length)]
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,36 +1,38 @@
|
|||||||
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
||||||
|
|
||||||
window.addEventListener("load", async () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
const TEXT_DISPLAY = document.getElementById("rotating-text")
|
window.addEventListener("load", async () => {
|
||||||
const PHRASES = ["Software Developer", "Jedi", "Student"]
|
const TEXT_DISPLAY = document.getElementById("rotating-text")
|
||||||
let current_phrase = []
|
const PHRASES = ["Software Developer", "Jedi", "Student"]
|
||||||
let is_end = false
|
let current_phrase = []
|
||||||
|
let is_end = false
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
for (let phrase in PHRASES) {
|
for (let phrase in PHRASES) {
|
||||||
if (!is_end) {
|
if (!is_end) {
|
||||||
for (let character in PHRASES[phrase]) {
|
for (let character in PHRASES[phrase]) {
|
||||||
current_phrase.push(PHRASES[phrase][character])
|
current_phrase.push(PHRASES[phrase][character])
|
||||||
TEXT_DISPLAY.innerHTML = current_phrase.join("")
|
TEXT_DISPLAY.innerHTML = current_phrase.join("")
|
||||||
await sleep(150)
|
await sleep(150)
|
||||||
}
|
}
|
||||||
if (current_phrase.join("") == PHRASES[phrase]) {
|
if (current_phrase.join("") == PHRASES[phrase]) {
|
||||||
await sleep(1000)
|
await sleep(1000)
|
||||||
is_end = true
|
is_end = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (1) {
|
while (1) {
|
||||||
current_phrase.pop()
|
current_phrase.pop()
|
||||||
if (!current_phrase.length) {
|
if (!current_phrase.length) {
|
||||||
is_end = false
|
is_end = false
|
||||||
TEXT_DISPLAY.innerHTML = " "
|
TEXT_DISPLAY.innerHTML = " "
|
||||||
await sleep(500)
|
await sleep(500)
|
||||||
break
|
break
|
||||||
|
}
|
||||||
|
TEXT_DISPLAY.innerHTML = current_phrase.join("")
|
||||||
|
await sleep(80)
|
||||||
}
|
}
|
||||||
TEXT_DISPLAY.innerHTML = current_phrase.join("")
|
|
||||||
await sleep(80)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -88,8 +88,8 @@ $(document).ready(function () {
|
|||||||
$("#submit-btn").remove()
|
$("#submit-btn").remove()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
$("#register-form").submit(function (e) {
|
$("#submit-btn").click(function () {
|
||||||
e.preventDefault()
|
$("#register-form").submit()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
document.getElementById("cards").onmousemove = (e) => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
for (const CARD of document.getElementsByClassName("card")) {
|
document.getElementById("cards").onmousemove = (e) => {
|
||||||
const RECT = CARD.getBoundingClientRect(),
|
for (const CARD of document.getElementsByClassName("card")) {
|
||||||
x = e.clientX - RECT.left,
|
const RECT = CARD.getBoundingClientRect(),
|
||||||
y = e.clientY - RECT.top
|
x = e.clientX - RECT.left,
|
||||||
CARD.style.setProperty("--mouse-x", `${x}px`)
|
y = e.clientY - RECT.top
|
||||||
CARD.style.setProperty("--mouse-y", `${y}px`)
|
CARD.style.setProperty("--mouse-x", `${x}px`)
|
||||||
|
CARD.style.setProperty("--mouse-y", `${y}px`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
|||||||
@ -5,8 +5,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" />
|
||||||
<link rel="icon" href="{% static 'main/img/icons/logo.svg' %}" />
|
<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"
|
<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">
|
rel="stylesheet">
|
||||||
<title>
|
<title>
|
||||||
@ -27,7 +25,6 @@
|
|||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="{% static 'main/css/layout.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/navigation.js' %}" defer></script>
|
||||||
<script src="{% static 'main/js/lightmode.js' %}" defer></script>
|
<script src="{% static 'main/js/lightmode.js' %}" defer></script>
|
||||||
{% block meta %}{% endblock %}
|
{% block meta %}{% endblock %}
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="{% static 'main/css/validation.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>
|
<script src="{% static 'main/js/validation.js' %}" defer></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|||||||
@ -137,8 +137,8 @@
|
|||||||
detected, according to the expected signal - permission to continue the route.
|
detected, according to the expected signal - permission to continue the route.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Ierosinātais risinājums sastāv no 4 pamatprincipiem, kas likvidē cilvēka reakcijas laika ietekmi
|
The proposed solution consists of 4 basic principles that eliminate the impact of
|
||||||
uz satiksmes sastrēgumu realizāciju:
|
human reaction time on the realisation of traffic congestion:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@ -163,7 +163,7 @@
|
|||||||
received, using the basic module for the audible signal or the optional light and other user interfaces formats.
|
received, using the basic module for the audible signal or the optional light and other user interfaces formats.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Raspberry Pi 4 microcontroller -
|
Raspberry Pi 4 microcontroller -
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user