-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
575 additions
and
4,372 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,28 @@ | ||
let cursorOuter = document.getElementById("cursor-outer"); | ||
let cursorInner = document.getElementById("cursor-inner"); | ||
let links = document.getElementsByTagName("a"); | ||
const time = document.getElementById("time"); | ||
const state = document.getElementById("state"); | ||
|
||
document.addEventListener("mousemove", function (e) { | ||
cursorInner.style.transform = | ||
cursorOuter.style.transform = `translate(${e.clientX}px, ${e.clientY}px)`; | ||
}); | ||
|
||
for (let i = 0; i < links.length; i++) { | ||
links[i].addEventListener("mouseover", () => { | ||
cursorOuter.classList.add("cursor-outer-hover"); | ||
cursorInner.classList.add("cursor-inner-hover"); | ||
}); | ||
links[i].addEventListener("mouseout", () => { | ||
cursorOuter.classList.remove("cursor-outer-hover"); | ||
cursorInner.classList.remove("cursor-inner-hover"); | ||
}); | ||
if (state && time) { | ||
const localTime = new Date().toLocaleString('en-US', { timeZone: 'Australia/Melbourne' }); | ||
|
||
const hour = new Date(localTime).getHours(); | ||
const minutes = new Date(localTime).getMinutes(); | ||
|
||
if (hour < 9) { | ||
state.innerHTML = "sleeping"; | ||
} else if (hour < 17) { | ||
state.innerHTML = "working"; | ||
} | ||
|
||
time.innerHTML = `${hour < 12 ? hour : hour - 12}:${minutes < 10 ? '0' + minutes : minutes} ${hour >= 12 ? "PM" : "AM"}`; | ||
} | ||
|
||
const currentTime = document.getElementById("currentTime"); | ||
const currentState = document.getElementById("currentState"); | ||
const time = new Date(); | ||
const toTop = document.getElementById("toTop"); | ||
|
||
const options = { timeZone: 'Australia/Melbourne' }; | ||
const localTime = time.toLocaleString('en-US', options); | ||
|
||
let hour = new Date(localTime).getHours(); | ||
|
||
if (hour >= 17 && hour < 24) { | ||
currentState.innerHTML = "awake"; | ||
} else if (hour >= 9 && hour < 17) { | ||
currentState.innerHTML = "working"; | ||
} else { | ||
currentState.innerHTML = "sleeping"; | ||
} | ||
let minutes = new Date(localTime).getMinutes(); | ||
currentTime.innerHTML = `${hour < 12 ? hour : hour - 12}:${minutes < 10 ? '0' + minutes : minutes} ${hour >= 12 ? "PM" : "AM"}`; | ||
|
||
function changeStyle() { | ||
document.documentElement.style.setProperty('--text-color-default', "#b7b8c5"); | ||
document.documentElement.style.setProperty('--text-color-alt', "#e0e1f0"); | ||
document.documentElement.style.setProperty('--background-color-default', "#1d1d1d"); | ||
document.documentElement.style.setProperty('--background-color-alt', "#131c22"); | ||
document.documentElement.style.setProperty('--text-color-link', "#329e9e"); | ||
document.documentElement.style.setProperty('--border-color', "#262626"); | ||
} | ||
if (toTop) { | ||
toTop.addEventListener("click", () => { | ||
window.scrollTo({ | ||
top: 0, | ||
behavior: "smooth" | ||
}); | ||
}); | ||
} |
Oops, something went wrong.