left: 0;
}
+%gallery-buttons {
+ position: absolute;
+ cursor: pointer;
+ top: calc(50% - 50px);
+ z-index: 100;
+ color: white;
+ background: rgba(0, 0, 0, 0.1);
+ font-size: 40px;
+ border: none;
+ width: 100px;
+ height: 100px;
+ &#prev {
+ left: 10px;
+ &::before {
+ font-family: FontAwesome;
+ content: "\f053";
+ }
+ }
+ &#next {
+ right: 10px;
+ &::before {
+ font-family: FontAwesome;
+ content: "\f054";
+ }
+ }
+}
+
+%gallery-item {
+ width: 100%;
+ position: relative;
+ &.transition {
+ position: absolute;
+ z-index: 90;
+ transition: opacity ease-out 1s;
+ opacity: 1;
+ &.faded {
+ opacity: 0;
+ }
+ }
+ .img {
+ background-position: center;
+ background-size: cover;
+ background-repeat: no-repeat;
+ }
+}
+
#focus {
@extend %hero-width;
position: relative;
button {
- position: absolute;
- cursor: pointer;
- top: calc(50% - 50px);
- z-index: 100;
- color: white;
- background: rgba(0, 0, 0, 0.1);
- font-size: 40px;
- border: none;
- width: 100px;
- height: 100px;
- &#prev {
- left: 10px;
- &::before {
- font-family: FontAwesome;
- content: "\f053";
- }
- }
- &#next {
- right: 10px;
- &::before {
- font-family: FontAwesome;
- content: "\f054";
- }
- }
+ @extend %gallery-buttons;
}
@extend %hero-height;
overflow: hidden;
.item {
- width: 100%;
- position: relative;
- &.transition {
- position: absolute;
- z-index: 90;
- transition: opacity ease-out 1s;
- opacity: 1;
- &.faded {
- opacity: 0;
- }
- }
+ @extend %gallery-item;
.img {
- background-position: center;
- background-size: cover;
- background-repeat: no-repeat;
@extend %hero-height;
}
.infos {
}
}
+.gallery {
+ position: relative;
+ height: 400px;
+ margin: 1em 0;
+ overflow: hidden;
+ button {
+ @extend %gallery-buttons;
+ font-size: 30px;
+ width: 75px;
+ height: 75px;
+ top: calc(50% - 37.5px);
+ @media screen and (max-width: 600px) {
+ font-size: 20px;
+ width: 50px;
+ height: 50px;
+ top: calc(50% - 25px);
+ }
+ }
+ .item {
+ @extend %gallery-item;
+ .img {
+ height: 400px;
+ }
+ }
+ @media screen and (max-width: 600px) {
+ height: 300px;
+ .item .img {
+ height: 300px;
+ }
+ }
+}
+
h2 {
border-top: 2px ridge black;
border-bottom: 2px ridge black;
var roll_timeout = null;
function init_roll_buttons() {
- if ($('#focus').length == 0) return;
- if ($('#focus').hasClass('initialized')) return;
- if ($('#focus .item').length < 2) {
+ if ($('.scrolling-images').length == 0) return;
+ if ($('.scrolling-images').hasClass('initialized')) return;
+ if ($('.scrolling-images .item').length < 2) {
$('#next, #prev').hide();
return;
}
$('#next').on('click', function(ev, autoroll) {
if (roll_timeout && !autoroll) { clearTimeout(roll_timeout); roll_timeout = null; }
var current_position = $(window).scrollTop();
- const $first = $('#focus .item:not(.transition)').first();
- const $last = $('#focus .item:not(.transition)').last();
+ const $first = $('.scrolling-images .item:not(.transition)').first();
+ const $last = $('.scrolling-images .item:not(.transition)').last();
if ($first.length == 0) return;
const $cloned = $first.clone();
- $cloned.addClass('transition').insertBefore($('#focus .item').first());
+ $cloned.addClass('transition').insertBefore($('.scrolling-images .item').first());
$cloned.on('transitionend', function() { $cloned.remove(); });
$first.detach().insertAfter($last);
$cloned[0].offsetHeight; // redraw
});
$('#prev').on('click', function(ev, autoroll) {
if (roll_timeout && !autoroll) { clearTimeout(roll_timeout); roll_timeout = null; }
- const $first = $('#focus .item:not(.transition)').first();
- const $last = $('#focus .item:not(.transition)').last();
+ const $first = $('.scrolling-images .item:not(.transition)').first();
+ const $last = $('.scrolling-images .item:not(.transition)').last();
if ($first.length == 0) return;
const $cloned = $first.clone();
- $cloned.addClass('transition').insertBefore($('#focus .item').first());
+ $cloned.addClass('transition').insertBefore($('.scrolling-images .item').first());
$cloned.on('transitionend', function() { $cloned.remove(); });
$last.detach().insertBefore($first);
$cloned[0].offsetHeight; // redraw
$cloned.addClass('faded');
if (autoroll) { roll_timeout = setTimeout(function() {$('#next').trigger('click', ['autoroll']); }, 10000); }
});
- $('#focus').addClass('initialized');
+ $('.scrolling-images').addClass('initialized');
roll_timeout = setTimeout(function() {$('#next').trigger('click', ['autoroll']); }, 10000);
}
function init_newsletter_form() {