๐ AOS ์คํฌ๋กค ์ ๋๋ฉ์ด์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ - Animate On Scroll
AOS (Animate On Scroll)
๊ธฐ๋ณธ์ ์ผ๋ก ์คํฌ๋กค ์์ง์์ ๋ฐ๋ผ ๊ฐ์ฒด์ ์์ง์์ ์ฃผ๋ ์ ๋๋ฉ์ด์ ์ ๊ฒฝ์ฐ, AOS ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ฉด ์ฝ๊ฒ ์ ๋๋ฉ์ด์ ์ ์ค ์ ์๋ค.
AOS ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ์๋ฐ์คํฌ๋ฆฝํธ๋ฅผ ๊น๊ฒ ๋ชฐ๋ผ๋ ์ฝ๊ฒ ์ฌ์ฉํ ์ ์๋ค๋ ์ฅ์ ์ด ์๋ค.
์๊ฐ ํฌ์ ๋๋น ๊ฐ์ฑ๋น๋ ๋ชจ๋ ์คํฌ๋กค ์ ๋๋ฉ์ด์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค ์ต๊ณ ๋ผ๊ณ ํ๊ฐ ๋ฐ๋๋ค.
AOS ์ค์น
AOS - Animate on scroll library
AOS Animate On Scroll Library Scroll down
michalsnik.github.io
<head>
<!-- AOS ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ถ๋ฌ์ค๊ธฐ-->
<link rel="stylesheet" href="https://unpkg.com/aos@2.3.1/dist/aos.css">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
</head>
AOS ์ฌ์ฉ๋ฐฉ๋ฒ
<html>
<head>
<!-- AOS ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ถ๋ฌ์ค๊ธฐ-->
<link rel="stylesheet" href="https://unpkg.com/aos@2.3.1/dist/aos.css">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
</head>
<body>
<!-- data-aos-* ์์ฑ์ ํ๊ทธ์๋ค๊ฐ ์จ์ฃผ๋ฉด ์์์ ๋์๋๊ฒ ๋๋ค -->
<div data-aos="zoom-out-right"> <!-- ์ค๋ฅธ์ชฝ์ผ๋ก ์ค์์ ํ๋ ๋ชจ์
์ค์ -->
<!-- ๋ด์ฉ ... -->
</div>
<!-- ๋ค์ํ ์์ฑ๋ค์ด ์กด์ฌํ๋ค. (์ค๋ช
์ ํ์ ) -->
<div data-aos="fade-up"
data-aos-offset="200"
data-aos-easing="ease-out-cubic"
data-aos-duration="2000"
>
<!-- ๋ด์ฉ ... -->
</div>
<!-- AOS ์คํฌ๋ฆฝํธ ์์ -->
<script>
AOS.init(); // ์๋ฐ์คํฌ๋ฆฝํธ๋ก init()์ ํด์ผ ๋์ํ๋ค.
</script>
</body>
</html>
See the Pen aos-sample by barzz12 (@inpaSkyrim) on CodePen.
data-aos ์ต์ ์์ฑ
<div
data-aos="fade-up"
data-aos-offset="200"
data-aos-delay="50"
data-aos-duration="1000"
data-aos-easing="ease-in-out"
data-aos-mirror="true"
data-aos-once="false"
data-aos-anchor-placement="top-center"
>
</div>
์ต์ | ์ค๋ช |
data-aos | ์ฌ์ฉํ ์ ๋๋ฉ์ด์ ํจ๊ณผ๋ช |
data-aos-easing | ์ ๋๋ฉ์ด์ ์๊ฐํ๋ฆ์ ๋ฐ๋ฅธ ์๋์ค์ ์ต์ (default: ease) |
data-aos-anchor | ํน์ ํ ๊ฐ์ฒด์ anchor๋ฅผ ์ค์ ํ์ฌ, ์ด๋ค ๊ฐ์ฒด๋ฅผ ๊ธฐ์ค์ผ๋ก ์ ๋๋ฉ์ด์ ์ด ์์ ๋ ์ง๋ฅผ ์ค์ |
data-aos-delay | ์ ๋๋ฉ์ด์ ์ฌ์ ๋๊ธฐ์๊ฐ ์ค์ (default: 0) |
data-aos-offset | ์ ๋๋ฉ์ด์ ํจ๊ณผ๊ฐ ์์๋ ๊ฐ์ฒด์ ์์น ์ค์ |
data-aos-duration | ์ ๋๋ฉ์ด์ ์ ์ฌ์์๊ฐ ์ค์ (default: 400) |
data-aos-anchor-placement | ์ ๋๋ฉ์ด์ ์ด ์ด๋ ์์น์์๋ถํฐ ์ ์ฉ๋ ์ง ์ค์ (default: top-bottom) |
data-aos-once | ์คํฌ๋กค ํ ๋๋ง๋ค ์ ๋๋งค์ด์
์ด ์ฌ์๋ ์ง๋ฅผ ์ค์ (default: true) ์ด ๊ฐ์ false๋ก ํ๊ฒ๋๋ฉด, ์คํฌ๋กค์ ์๋ก ์ฌ๋ ท๋ค ๋ค์ ๋ด๋ฆด๋ ์ ๋๋ฉ์ด์ ์ด ๋ค์ ์ฌ์๋๋๋ก ํ ์ ์๋ค. |
โป delay์ duration์ 0๋ถํฐ 3000๊น์ง ์ต๋๊ฐ์ ์ค์ ํ ์ ์๊ณ , 50 ๋จ์๋ก ์ค์ ๋ณ๊ฒฝ์ด ๊ฐ๋ฅํ๋ค.
data-aos : ์ ๋๋ฉ์ด์ ํจ๊ณผ ์ข ๋ฅ
- Fade animations:
- fade
- fade-up
- fade-down
- fade-left
- fade-right
- fade-up-right
- fade-up-left
- fade-down-right
- fade-down-left
- Flip animations:
- flip-up
- flip-down
- flip-left
- flip-right
- Slide animations:
- slide-up
- slide-down
- slide-left
- slide-right
- Zoom animations:
- zoom-in
- zoom-in-up
- zoom-in-down
- zoom-in-left
- zoom-in-right
- zoom-out
- zoom-out-up
- zoom-out-down
- zoom-out-left
- zoom-out-right
data-aos-anchor-placement : ์ ๋๋ฉ์ด์ ์์ ์์น ์์ฑ ์ข ๋ฅ
- top-bottom
- top-center
- top-top
- center-bottom
- center-center
- center-top
- bottom-bottom
- bottom-center
- bottom-top
data-aos-easing : ์ ๋๋ฉ์ด์ ์ฌ์ ์๋ ์ข ๋ฅ
๊ทธ๋ํ์์ ๋ณผ์ ์๋ฏ์ด, ์ ๋๋ฉ์ด์ ์ด ์ฌ์ํ๋๋ฐ ๋งค๋๋ฝ๊ฒ ์ฌ์ํ๊ฑฐ๋ ์๋๋ฉด ์ฝ๊ฐ break๋ฅผ ๊ฑธ์ด์ ๋ญ๊ฐ ์ฌ์ํ๋ ๋๋ ๋ฑ์ ์ค์ ํ๋ ์์ฑ์ด๋ผ๊ณ ๋ณด๋ฉด ๋๋ค.
์ง์ ํ๋ํ๋ ์ ์ฉํด๋ด์ ์ฐจ์ด๋ฅผ ๋์ผ๋ก ๋๊ปด๋ณด๊ธฐ๋ฅผ ๊ถ์ฅํ๋ค.
- linear
- ease
- ease-in
- ease-out
- ease-in-out
- ease-in-back
- ease-out-back
- ease-in-out-back
- ease-in-sine
- ease-out-sine
- ease-in-out-sine
- ease-in-quad
- ease-out-quad
- ease-in-out-quad
- ease-in-cubic
- ease-out-cubic
- ease-in-out-cubic
- ease-in-quart
- ease-out-quart
- ease-in-out-quart