This commit is contained in:
2023-06-06 12:15:31 +02:00
parent 3a8a866e24
commit 418a095a2e
2 changed files with 39 additions and 27 deletions

View File

@@ -34,6 +34,12 @@ body svg {
overflow: visible;
}
img {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
br {
display: none;
}

View File

@@ -1,38 +1,44 @@
$(document).ready(function(){
$('a').on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top - 80
}, 800, function(){
window.location.hash = hash;
});
$('a[href*="#"]')
// Remove links that don't actually link to anything
.not('[href="#"]')
.not('[href="#0"]')
.click(function(event) {
// On-page links
if (
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
&&
location.hostname == this.hostname
) {
// Figure out element to scroll to
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
// Does a scroll target exist?
if (target.length) {
// Only prevent default if animation is actually gonna happen
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top - 80
}, 800, function() {
// Callback after animation
// Must change focus!
var $target = $(target);
$target.focus();
if ($target.is(":focus")) { // Checking if the target was focused
return false;
} else {
$target.attr('tabindex','-1'); // Adding tabindex for elements not focusable
$target.focus(); // Set focus again
};
});
}
}
});
});
// $(function() {
// $(window).on('resize', function(e) {
// if (screen.width < screen.height){
// $('.section--preview').addClass('horizontal');
// }else{
// $('.section--preview').removeClass('horizontal');
// }
// });
// })
init();
function init() {
let state = 0;
// if (screen.width < screen.height){
// $('.section--preview').addClass('horizontal');
// }else{
// $('.section--preview').removeClass('horizontal');
// }
$('.js-prev-slide').click(function() {
if(state - 1 == -1){state = 2;}else{state = state - 1;}
swiper(state,0);