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 |
Tags
- 백엔드
- 비전공자
- xcode
- php
- front-end
- 비전공 개발자
- html5
- 풀스택
- javascript
- react
- button
- 프론트엔드
- MAC
- iOS 개발자
- IOS
- hover
- 자바스크립트
- css3
- effect
- iPhone
- image
- keyframes
- HTML
- jQuery
- ipad
- CSS
- 개발자
- Animation
- SWIFT
- 애니메이션
Archives
- Today
- Total
비전공자 개발일기
Image Distribution 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>IMAGE DISTRIBUTION EFFECT</title>
<link rel="stylesheet" href="style.css">
<script defer src="main.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js' integrity='sha512-z4OUqw38qNLpn1libAN9BsoDx6nbNFio5lA6CuTp9NlK83b89hgyCVq+N5FdBJptINztxn1Z3SaKSKUS5UP60Q==' crossorigin='anonymous'></script>
</head>
<body>
<div class="container"></div>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
position: relative;
}
body {
min-height: 100vh;
overflow: hidden;
background-color: #FFF;
}
.container {
display: flex;
flex-wrap: wrap;
transform-style: preserve-3d;
perspective: 1000px;
}
.container .block {
width: 5vw;
height: 5vw;
background: url('img.jpg');
background-size: cover;
background-attachment: fixed;
background-position: center;
transform-style: preserve-3d;
}
let container = document.querySelector(".container");
for (let i = 0; i <= 400; i++) {
let block = document.createElement("div");
block.classList.add("block");
container.appendChild(block);
}
let block = document.querySelectorAll(".block");
let animation = anime.timeline({
targets: block,
easing: "easeInOutExpo",
loop: true,
delay: anime.stagger(10, { start: 50 }),
});
animation
.add({
scale: 0,
translateX: function () {
return anime.random(360, 2100);
},
translateY: function () {
return anime.random(360, -2100);
},
rotate: function () {
return anime.random(-360, 360);
},
duration: function () {
return anime.random(500, 3000);
},
})
.add({
scale: 1,
translateX: 0,
translateY: 0,
rotate: 1,
duration: function () {
return anime.random(500, 3000);
},
});
728x90
LIST
'Javascript' 카테고리의 다른 글
Create Email Validation (0) | 2022.12.08 |
---|---|
Password Strength Checker with color (0) | 2022.12.07 |
Product Filter (0) | 2022.12.04 |
New Year 2023 Countdown (0) | 2022.12.02 |
Dictionary App (0) | 2022.12.01 |