250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- xcode
- react
- effect
- ipad
- javascript
- HTML
- keyframes
- Animation
- 애니메이션
- button
- 비전공자
- 프론트엔드
- jQuery
- MAC
- 풀스택
- 비전공 개발자
- image
- SWIFT
- 백엔드
- html5
- css3
- front-end
- 개발자
- 자바스크립트
- iPhone
- php
- iOS 개발자
- IOS
- CSS
- hover
Archives
- Today
- Total
비전공자 개발일기
Confetti Text Effect 본문
728x90
SMALL
<!DOCTYPE html>
<html lang="ko">
<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>CONFETTI TEXT EFFECT</title>
<link rel="stylesheet" href="style.css">
<script defer src="main.js"></script>
<script src="https://code.jquery.com/jquery-3.6.1.min.js"
integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
</head>
<body>
<div class="wrapper">
<span class="particletext confetti">OLLEH!!!</span>
</div>
</body>
</html>
body {
height: 100vh;
display: grid;
place-items: center;
font-family: "bebas", sans-serif;
background-color: #000;
}
.particletext {
text-align: center;
font-size: 48px;
position: relative;
color: #fff;
}
.particletext.confetti > .particle {
opacity: 0;
position: absolute;
-webkit-animation: confetti 3s ease-in infinite;
animation: confetti 3s ease-in infinite;
}
.particletext.confetti > .particle.c1 {
background-color: #4CAF50;
}
.particletext.confetti > .particle.c2 {
background-color: #9C27B0;
}
@keyframes confetti {
0% {
opacity: 0;
transform: translateY(0%) rotate(0deg);
}
10% {
opacity: 1;
}
35% {
transform: translateY(-800%) rotate(270deg);
}
80% {
opacity: 1;
}
100% {
opacity: 0;
transform: translateY(2000%) rotate(1440deg);
}
}
function initparticles() {
confetti();
}
function confetti() {
$.each($(".particletext.confetti"), function () {
var confetticount = ($(this).width() / 50) * 10;
for (var i = 0; i <= confetticount; i++) {
$(this).append(
'<span class="particle c' +
$.rnd(1, 2) +
'" style="top:' +
$.rnd(10, 50) +
"%; left:" +
$.rnd(0, 100) +
"%;width:" +
$.rnd(6, 8) +
"px; height:" +
$.rnd(3, 4) +
"px;animation-delay: " +
$.rnd(0, 30) / 10 +
's;"></span>'
);
}
});
}
jQuery.rnd = function (m, n) {
m = parseInt(m);
n = parseInt(n);
return Math.floor(Math.random() * (n - m + 1)) + m;
};
initparticles();
728x90
LIST
'HTML _CSS' 카테고리의 다른 글
Custome Upload File (0) | 2023.02.11 |
---|---|
Neon Love (0) | 2023.02.10 |
Send Button Animation (0) | 2023.02.08 |
Bouncing Ball (0) | 2023.02.07 |
Pulse effect on button hover (0) | 2023.02.06 |