html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!--Created with ♡ by: Tarun Pandey-->
<!DOCTYPE html>
<html>
<head>
<title>Happy New Year 2021</title>
</head>
<body>
<section>
<h2>Happy New Year</br><span>2021</span></h2></section>
<script>
function stars(){
const count = 200;
const section = document.querySelector('section');
var i = 0;
while(i < count){
const star = document.createElement('i');
const x = Math.floor(Math.random() * window.innerWidth)
const y = Math.floor(Math.random() * window.innerHeight)
const size = Math.random() * 4;
star.style.left = x + "px";
star.style.top = y + "px";
star.style.height = 1+size+"px";
star.style.width = 1+size+"px";
const dur = Math.random() * 2;
star.style.animationDuration = 2+dur+"s";
star.style.animationDelay = dur+"s";
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
* {
margin:0;
padding:0;
box-sizing:border-box;
}
body{
overflow:hidden;
}
section{
min-height:100vh;
display:flex;
align-items:center;
justify-content:center;
background:linear-gradient(135deg, #111, #222, #111);
}
section::before{
content:'';
position:absolute;
width:40vw;
height:40vw;
border:5vw solid #ff1062;
border-radius:50%;
box-shadow:0 0 0 1vw #222,
0 0 0 1.5vw #fff;
}
h2{
position:absolute;
color: #fff;
Enter to Rename, Shift+Enter to Preview
js
js
1
//I won't irritate you by showing alerts...
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run