summaryrefslogtreecommitdiff
path: root/assets/js/main.js
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-04-10 21:24:38 +0200
committerAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-04-10 21:24:38 +0200
commitb0afdbb4f226a2b13ec83e2442ed90d617988a18 (patch)
tree8ab922b9a766d8c139f826d1eb7cc261010dac68 /assets/js/main.js
parent9eee010f8fa93b1738be7b74e30174b170078e08 (diff)
reprise du code en prod
Diffstat (limited to 'assets/js/main.js')
-rw-r--r--assets/js/main.js105
1 files changed, 105 insertions, 0 deletions
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..7d9c058
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,105 @@
+/*
+ Overflow by HTML5 UP
+ html5up.net | @ajlkn
+ Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
+*/
+
+(function($) {
+
+ var $window = $(window),
+ $body = $('body'),
+ settings = {
+
+ // Parallax background effect?
+ parallax: true,
+
+ // Parallax factor (lower = more intense, higher = less intense).
+ parallaxFactor: 10
+
+ };
+
+ // Breakpoints.
+ breakpoints({
+ wide: [ '1081px', '1680px' ],
+ normal: [ '841px', '1080px' ],
+ narrow: [ '737px', '840px' ],
+ mobile: [ null, '736px' ]
+ });
+
+ // Mobile?
+ if (browser.mobile)
+ $body.addClass('is-scroll');
+
+ // Play initial animations on page load.
+ $window.on('load', function() {
+ window.setTimeout(function() {
+ $body.removeClass('is-preload');
+ }, 100);
+ });
+
+ // Scrolly.
+ $('.scrolly-middle').scrolly({
+ speed: 1000,
+ anchor: 'middle'
+ });
+
+ $('.scrolly').scrolly({
+ speed: 1000,
+ offset: function() { return (breakpoints.active('<=mobile') ? 70 : 190); }
+ });
+
+ // Parallax background.
+
+ // Disable parallax on IE/Edge (smooth scrolling is jerky), and on mobile platforms (= better performance).
+ if (browser.name == 'ie'
+ || browser.name == 'edge'
+ || browser.mobile)
+ settings.parallax = false;
+
+ if (settings.parallax) {
+
+ var $dummy = $(), $bg;
+
+ $window
+ .on('scroll.overflow_parallax', function() {
+
+ // Adjust background position.
+ $bg.css('background-position', 'center ' + (-1 * (parseInt($window.scrollTop()) / settings.parallaxFactor)) + 'px');
+
+ })
+ .on('resize.overflow_parallax', function() {
+
+ // If we're in a situation where we need to temporarily disable parallax, do so.
+ if (breakpoints.active('<=narrow')) {
+
+ $body.css('background-position', '');
+ $bg = $dummy;
+
+ }
+
+ // Otherwise, continue as normal.
+ else
+ $bg = $body;
+
+ // Trigger scroll handler.
+ $window.triggerHandler('scroll.overflow_parallax');
+
+ })
+ .trigger('resize.overflow_parallax');
+
+ }
+
+ // Poptrox.
+ $('.gallery').poptrox({
+ useBodyOverflow: false,
+ usePopupEasyClose: false,
+ overlayColor: '#0a1919',
+ overlayOpacity: 0.75,
+ usePopupDefaultStyling: false,
+ usePopupCaption: true,
+ popupLoaderText: '',
+ windowMargin: 10,
+ usePopupNav: true
+ });
+
+})(jQuery); \ No newline at end of file