-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
307 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
- var path = "parallax/budda" | ||
.parallax.parallax--feedback | ||
picture(data-speed="0.1").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/jpg" srcset=require(`images/${path}/2560/1.jpg`)) | ||
source(media="(min-width: 1201px)" type="image/jpg" srcset=require(`images/${path}/1800/1.jpg`)) | ||
source(media="(min-width: 769px)" type="image/jpg" srcset=require(`images/${path}/1200/1.jpg`)) | ||
source(media="(min-width: 481px)" type="image/jpg" srcset=require(`images/${path}/768.jpg`)) | ||
source(media="(max-width: 480px)" type="image/jpg" srcset=require(`images/${path}/320.jpg`)) | ||
img(src=require(`images/${path}/768.jpg`) alt="").parallax__image | ||
picture(data-speed="0.18").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/2.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/2.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/2.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.4").parallax__layer | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/budda.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.6").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/4.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/4.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/4.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.65").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/5.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/5.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/5.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.8").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/6.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/6.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/6.png`)) | ||
img(src="" alt="").parallax__image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
- var path = "parallax/mountain" | ||
.parallax | ||
picture(data-speed="0.1").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/jpg" srcset=require(`images/${path}/2560/1.jpg`)) | ||
source(media="(min-width: 1201px)" type="image/jpg" srcset=require(`images/${path}/1800/1.jpg`)) | ||
source(media="(min-width: 769px)" type="image/jpg" srcset=require(`images/${path}/1200/1.jpg`)) | ||
source(media="(min-width: 481px)" type="image/jpg" srcset=require(`images/${path}/768.jpg`)) | ||
source(media="(max-width: 480px)" type="image/jpg" srcset=require(`images/${path}/320.jpg`)) | ||
img(src=require(`images/${path}/768.jpg`) alt="").parallax__image | ||
picture(data-speed="0.25").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/2.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/2.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/2.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.35").parallax__layer | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/balloon.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.38").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/4.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/4.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/4.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.42").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/5.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/5.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/5.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.45").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/6.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/6.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/6.png`)) | ||
img(src="" alt="").parallax__image | ||
picture(data-speed="0.45").parallax__layer | ||
source(media="(min-width: 1801px)" type="image/png" srcset=require(`images/${path}/2560/7.png`)) | ||
source(media="(min-width: 1201px)" type="image/png" srcset=require(`images/${path}/1800/7.png`)) | ||
source(media="(min-width: 769px)" type="image/png" srcset=require(`images/${path}/1200/7.png`)) | ||
img(src="" alt="").parallax__image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
const parallax = document.querySelector(".parallax"); | ||
const parallaxFeedback = document.querySelector(".parallax--feedback"); | ||
const layers = parallax.children; | ||
const layersFeedback = parallaxFeedback.children; | ||
const parallaxFeedbackOffset = parallaxFeedback.getBoundingClientRect().top; | ||
|
||
function moveLayers (layers ,scrollOffset, topOffset = null) { | ||
Array.from(layers).forEach(layer => { | ||
const divider = layer.dataset.speed; | ||
let offset = topOffset | ||
? scrollOffset - topOffset | ||
: scrollOffset; | ||
const strafe = offset * divider / (-60); | ||
|
||
layer.style.transform = `translateY(${strafe}%)`; | ||
}); | ||
} | ||
const parallax = document.querySelectorAll('.parallax'); | ||
let windowWidth = null; | ||
|
||
(() => { | ||
function getWindowWidth() { | ||
windowWidth = document.querySelector('body').clientWidth; | ||
}; | ||
|
||
getWindowWidth(); | ||
|
||
window.addEventListener('resize', () => getWindowWidth()) | ||
})(); | ||
|
||
Array.from(parallax).forEach(parallax => { | ||
const layers = parallax.children; | ||
const parent = parallax.parentNode; | ||
const parentOffsetTop = parent.offsetTop; | ||
|
||
window.addEventListener("scroll", e => { | ||
const scrollOffset = window.pageYOffset; | ||
moveLayers(layers, scrollOffset); | ||
moveLayers(layersFeedback, scrollOffset, parallaxFeedbackOffset); | ||
}) | ||
function moveLayers (scrollOffset) { | ||
Array.from(layers).forEach(layer => { | ||
const divider = layer.dataset.speed; | ||
const strafe = scrollOffset * divider / (-60); | ||
|
||
layer.style.transform = `translateY(${ strafe }%)`; | ||
}); | ||
} | ||
|
||
window.addEventListener('scroll', e => { | ||
const scrollOffset = window.pageYOffset; | ||
|
||
if (windowWidth > 768 && scrollOffset - parentOffsetTop >= 0) { | ||
moveLayers(scrollOffset - parentOffsetTop); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ new Vue({ | |
item.photo = requirePic; | ||
return item; | ||
}); | ||
}, | ||
} | ||
} | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.feedback { | ||
position: relative; | ||
width: 100%; | ||
min-height: 1600px; | ||
overflow: hidden; | ||
} |
Oops, something went wrong.