-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
24 lines (20 loc) · 853 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { wholesome } from './wholesome.js'
let t = document.getElementById('actualText')
let fonts = ['Dancing Script, cursive', 'Gloria Hallelujah, cursive', 'Chilanka, cursive','Petit Formal Script, cursive','Pacifico, cursive','Nothing You Could Do, cursive']
let hoverColors = ['#1e90ff','#7700ff', '#ff006a', '#ffc400', '#ff5e00', '#00ff80', '#9e00ce']
function addHover(){
t.addEventListener('mouseover',()=>{
t.style.color = hoverColors[Math.round(Math.random()*hoverColors.length)]
})
t.addEventListener('mouseout',()=>{
t.style.color = 'White'
})
}
window.addEventListener('load', ()=>{
let f = fonts[Math.floor(Math.random()*fonts.length)]
let q = wholesome[Math.floor(Math.random()*wholesome.length)]
t.style.fontWeight = "bold"
t.style.fontFamily = f
t.innerText = q
addHover()
})