Add files via upload
This commit is contained in:
parent
ac00396004
commit
9af941ac5e
18
100_projects/50-line-through-effect/inedx.html
Normal file
18
100_projects/50-line-through-effect/inedx.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="line"></div>
|
||||
<h1 id="text">
|
||||
I Love You So Much <3
|
||||
</h1>
|
||||
|
||||
<script src="main.js"></script>
|
||||
</body>
|
||||
</html>
|
13
100_projects/50-line-through-effect/main.js
Normal file
13
100_projects/50-line-through-effect/main.js
Normal file
@ -0,0 +1,13 @@
|
||||
const text = document.getElementById('text');
|
||||
const textArr = text.innerText.split('');
|
||||
|
||||
const newEl = document.createElement('h1');
|
||||
newEl.innerHTML = `${textArr.map(letter => `<span class="letter" style="${randomVisibility()}">${letter}</span>`).join('')}`;
|
||||
newEl.classList.add('overlay');
|
||||
|
||||
document.body.appendChild(newEl);
|
||||
|
||||
|
||||
function randomVisibility() {
|
||||
return Math.random() < 0.5 ? 'visibility: hidden' : 'visibility: visible';
|
||||
}
|
41
100_projects/50-line-through-effect/style.css
Normal file
41
100_projects/50-line-through-effect/style.css
Normal file
@ -0,0 +1,41 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
background-color: #FA8072;
|
||||
font-family: 'Muli', sans-serif;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
h1 {
|
||||
font-size: 8vw;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
}
|
||||
.overlay {
|
||||
z-index: 2;
|
||||
}
|
||||
.line {
|
||||
background-color: #fff;
|
||||
border-radius: 50px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -1vw;
|
||||
transform: translateY(-50%);
|
||||
height: 2vw;
|
||||
width: 0;
|
||||
animation: grow 3s linear forwards;
|
||||
z-index: 2;
|
||||
}
|
||||
@keyframes grow {
|
||||
to {
|
||||
width: 85vw;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user