├── README.md ├── app.js ├── img ├── 0.png ├── 1.png ├── 10.jpg ├── 11.jpg ├── 12.jpg ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png ├── 9.jpg └── logo.jpg ├── index.html ├── project.png └── style.css /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Youtube Lun Dev 3 | 4 | Free code HTML CSS Javascript and Free learning web developer 5 | 6 | 7 |  8 | 9 | ## Image in project 10 | 11 |  12 | - [Detailed instructions on this project](https://www.youtube.com/@lundeveloper/featured) 13 | 14 | 15 | ## Follow me for more free codes 16 | 17 | - [Youtube Lun Dev](https://www.youtube.com/results?search_query=lun+dev) 18 | - [Tiktok Lun Dev](https://www.tiktok.com/@lun.dev) 19 | - [Website Lun Dev Web](https://lundevweb.com) 20 | 21 | 22 | ## Built By 23 | 24 | This project is built and shared by 25 | 26 | - Lun Dev Youtube 27 | 28 | 29 | ## Feedback 30 | 31 | If you have any feedback, please reach out to us at hohoang.dev@gmail.com 32 | 33 | 34 | ## Tags 35 | 36 | Free code HTML CSS Javascript and Free learning web developer, html code, css code, javascript code tutorial 37 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | let listBg = document.querySelectorAll('.bg'); 2 | let listTab = document.querySelectorAll('.tab'); 3 | let titleBanner = document.querySelector('.banner h1'); 4 | window.addEventListener("scroll", (event) => { 5 | /*scrollY is the web scrollbar position (pixel)*/ 6 | let top = this.scrollY; 7 | /*index is the order of classes bg (0,1,2,3,4,5,6,7,8) 8 | When scrolling the web, the classes bg scroll down, 9 | the bigger the index, the faster the movement 10 | */ 11 | listBg.forEach((bg, index) => { 12 | if(index != 0 && index != 8){ 13 | bg.style.transform = `translateY(${(top*index/2)}px)`; 14 | }else if(index == 0){ 15 | bg.style.transform = `translateY(${(top/3)}px)`; 16 | } 17 | }) 18 | titleBanner.style.transform = `translateY(${(top*4/2)}px)`; 19 | 20 | /* parallax scroll in tab 21 | when tab's position is less than 550 px 22 | from scrollbar position add active class to animate 23 | and vice versa 24 | */ 25 | listTab.forEach(tab =>{ 26 | if(tab.offsetTop - top < 550){ 27 | tab.classList.add('active'); 28 | }else{ 29 | tab.classList.remove('active'); 30 | } 31 | }) 32 | }); -------------------------------------------------------------------------------- /img/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/0.png -------------------------------------------------------------------------------- /img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/1.png -------------------------------------------------------------------------------- /img/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/10.jpg -------------------------------------------------------------------------------- /img/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/11.jpg -------------------------------------------------------------------------------- /img/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/12.jpg -------------------------------------------------------------------------------- /img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/2.png -------------------------------------------------------------------------------- /img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/3.png -------------------------------------------------------------------------------- /img/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/4.png -------------------------------------------------------------------------------- /img/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/5.png -------------------------------------------------------------------------------- /img/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/6.png -------------------------------------------------------------------------------- /img/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/7.png -------------------------------------------------------------------------------- /img/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/8.png -------------------------------------------------------------------------------- /img/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/9.jpg -------------------------------------------------------------------------------- /img/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoanghoDev/parallax_scroll/a4be94eeb7a9eb3e6fc5cd6d712122e7cd07317e/img/logo.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |28 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque rem obcaecati libero eaque veniam est necessitatibus consectetur commodi non rerum, sapiente distinctio dignissimos! Dolorem eaque velit quam tenetur sapiente, qui veniam iste beatae officiis facilis aut expedita commodi, voluptatibus ullam voluptates! Explicabo, nisi. Odit, neque aliquid maiores minima cumque iusto? 29 |
30 | 31 |Image Name
37 |Image Name
41 |Image Name
45 |Image Name
49 |