1
0
Fork 0
owenryan.us/source/assets/landingpage.ts

15 lines
504 B
TypeScript
Raw Normal View History

2023-05-16 03:59:18 +00:00
// JS Code that rotates the gradient on the content box on the front page
document.addEventListener("DOMContentLoaded", (): void => {
const mainBox: HTMLDivElement = document.querySelector("#rotating-gradient");
let angle: number = 0;
// Rotate the gradient 1 degree every 100ms
setInterval((): void => {
2024-02-06 04:13:57 +00:00
mainBox.style.background = `linear-gradient(${angle}deg, #1E1F46, #404040)`;
2023-05-16 03:59:18 +00:00
angle += 1;
if (angle >= 360) {
angle = 0
}
}, 100);
});