<div id="tsparticles"></div>
<main class="box">
<h2>Login</h2>
<form>
<div class="inputBox">
<label for="userName">Username</label>
<input type="text" name="userName" id="userName" placeholder="type your username" required>
</div>
<div class="inputBox">
<label for="userPassword">Password</label>
<input type="password" name="userPassword" id="userPassword" placeholder="type your password" required>
</div>
<input type="submit" name="" value="Submit">
</form>
</main>
<footer>
</footer>
html * {
box-sizing: border-box;
}
body {
font-family: sans-serif;
height: 100vh;
margin: 0;
padding: 0;
}
#tsparticles {
position: fixed;
height: 100vh;
width: 100vw;
z-index: 0;
}
header {
display: none;
}
.box {
background-color: rgba(0, 0, 0, 0.8);
border-radius: 10px;
box-shadow: 0 15px 25px rgba(0, 0, 0, 0.8);
margin: auto auto;
padding: 40px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.box h2 {
margin: 0 0 30px 0;
padding: 0;
color: #fff;
text-align: center;
}
.box .inputBox label {
color: #fff;
}
.box .inputBox input {
background: transparent;
border: none;
border-bottom: 1px solid #fff;
color: #fff;
font-size: 18px;
letter-spacing: 2px;
margin-bottom: 30px;
outline: none;
padding: 10px 0;
width: 100%;
}
.box input[type="submit"] {
background: #03a9f4;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
font-weight: 600;
padding: 10px 20px;
letter-spacing: 2px;
outline: none;
text-transform: uppercase;
}
.box input[type="submit"]:hover {
opacity: 0.8;
}
tsParticles.load("tsparticles", {
fpsLimit: 60,
particles: {
number: {
value: 0,
density: {
enable: false,
value_area: 800
}
},
color: {
value: "#000"
},
shape: {
type: "circle",
stroke: {
width: 0,
color: "#000000"
},
polygon: {
nb_sides: 5
},
image: {
src: "https://cdn.matteobruni.it/images/particles/github.svg",
width: 100,
height: 100
}
},
opacity: {
value: 0.5,
random: false,
anim: {
enable: false,
speed: 1,
opacity_min: 0.1,
sync: false
}
},
size: {
value: 5,
random: true,
anim: {
enable: false,
speed: 40,
size_min: 0.1,
sync: false
}
},
line_linked: {
enable: true,
distance: 150,
color: "#000",
opacity: 0.4,
width: 1
},
move: {
enable: true,
speed: 2,
direction: "none",
random: false,
straight: false,
out_mode: "out",
attract: {
enable: false,
rotateX: 600,
rotateY: 1200
}
}
},
interactivity: {
detect_on: "canvas",
events: {
onhover: {
enable: false,
mode: "repulse",
parallax: {
enable: false,
force: 60,
smooth: 10
}
},
onclick: {
enable: true,
mode: "emitter"
},
resize: true
},
modes: {
grab: {
distance: 400,
line_linked: {
opacity: 1
}
},
bubble: {
distance: 400,
size: 40,
duration: 2,
opacity: 0.8,
speed: 3
},
repulse: {
distance: 50
},
push: {
particles_nb: 4
},
remove: {
particles_nb: 2
}
}
},
retina_detect: true,
background: {
color: "#fff",
image: "",
position: "50% 50%",
repeat: "no-repeat",
size: "cover"
},
emitters: {
direction: "top",
position: {
x: 50,
y: 130
},
rate: {
delay: 0.1
},
size: {
width: 100,
height: 0
},
particles: {
color: {
value: ["#5bc0eb", "#fde74c", "#9bc53d", "#e55934", "#fa7921"]
},
lineLinked: {
enable: false
},
opacity: {
value: 0.5
},
size: {
value: 400,
random: {
enable: true,
minimumValue: 50
}
},
opacity: {
value: 0.5
},
move: {
speed: 10,
random: false,
outMode: "destroy"
}
}
}
});
This Pen doesn't use any external CSS resources.