Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,48 @@
<div id="hashtag">
#BeHappy❤
</div>

<script>

const stars1 = []
const stars2 = []
const stars3 = []

const numberOfStars1 = '1000'
const numberOfStars2 = '600'
const numberOfStars3 = '100'


for (let i = 0; i < numberOfStars1; i++) {
const pos1 = (Math.floor(Math.random() * 5200))
const pos2 = (Math.floor(Math.random() * 5200))
stars1.push(`${pos1}px ${pos2}px #fff`)
}

for (let i = 0; i < numberOfStars2; i++) {
const pos1 = (Math.floor(Math.random() * 5200))
const pos2 = (Math.floor(Math.random() * 5200))
stars2.push(`${pos1}px ${pos2}px #fff`)
}

for (let i = 0; i < numberOfStars3; i++) {
const pos1 = (Math.floor(Math.random() * 5200))
const pos2 = (Math.floor(Math.random() * 5200))
stars3.push(`${pos1}px ${pos2}px #fff`)
}

const addCSS = css => document.head.appendChild(document.createElement("style")).innerHTML = css;

addCSS(`#stars1{ box-shadow:${stars1}}`)
addCSS(`#stars1:after{ box-shadow:${stars1}}`)

addCSS(`#stars2{ box-shadow:${stars2}}`)
addCSS(`#stars2:after{ box-shadow:${stars2}}`)

addCSS(`#stars3{ box-shadow:${stars3}}`)
addCSS(`#stars3:after{ box-shadow:${stars3}}`)

</script>

</body>
</html>