forked from root/public
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.
15 lines
440 B
15 lines
440 B
4 years ago
|
const body = document.querySelector('body')
|
||
|
|
||
4 years ago
|
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||
4 years ago
|
|
||
|
export const generateLetters = () => {
|
||
4 years ago
|
body.append(...[...Array(120).keys()].map((c) => {
|
||
4 years ago
|
const shape = document.createElement('div')
|
||
|
|
||
4 years ago
|
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
|
||
|
}))
|
||
4 years ago
|
}
|