You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
440 B

const body = document.querySelector('body')
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
export const generateLetters = () => {
body.append(...[...Array(120).keys()].map((c) => {
const shape = document.createElement('div')
shape.textContent = alphabet[Math.floor(Math.random() * alphabet.length)]
shape.style.fontSize = `${c + 11}px`
shape.style.fontWeight = [300,400,600][Math.floor(c / 40)]
return shape
}))
}