https://github.com/wagerfield/parallax
GitHub - wagerfield/parallax: Parallax Engine that reacts to the orientation of a smart device
Parallax Engine that reacts to the orientation of a smart device - GitHub - wagerfield/parallax: Parallax Engine that reacts to the orientation of a smart device
github.com
사용법
<div id="scene">
<div class="layer" data-depth-x="-0.1" data-depth-y="0.25"><img src="main_bg.jpg"></div>
<div class="layer" data-depth-x="0.25"><img src="main_water.png"></div>
<div class="layer" data-depth-x="0.5" ><img src="main_ground.png"></div>
</div>
css
#scene .layer
{ position: absolute; top:0; left:0; width: 100%; height: 100vh;}
#scene .layer img
{ position: absolute; width: 100%; height: 1005; left:0; bottom: 0; object-fit: cover;}
script
let scene = document.getElementById('scene');
let parallax = new Parallax(scene);
'Opensource' 카테고리의 다른 글
jquery-smooth-scroll (0) | 2023.04.19 |
---|---|
AI 음악 생성 사이트, Soundraw (0) | 2023.03.24 |
3D Real Glassmorphism, Vanilla-tilt (0) | 2023.03.20 |
Typed plugin (0) | 2023.03.19 |
클릭이벤트 플러그인 hammer.js (0) | 2023.03.07 |
Email Services - EmailJS (0) | 2023.03.07 |
Scroll Plugin, AOS (0) | 2023.03.07 |
VS Code 단축키 모음 기본 설치 플러그인 (0) | 2023.02.20 |