wip
This commit is contained in:
@@ -34,6 +34,12 @@ body svg {
|
|||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
br {
|
br {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,44 @@
|
|||||||
$(document).ready(function(){
|
$('a[href*="#"]')
|
||||||
$('a').on('click', function(event) {
|
// Remove links that don't actually link to anything
|
||||||
if (this.hash !== "") {
|
.not('[href="#"]')
|
||||||
event.preventDefault();
|
.not('[href="#0"]')
|
||||||
var hash = this.hash;
|
.click(function(event) {
|
||||||
$('html, body').animate({
|
// On-page links
|
||||||
scrollTop: $(hash).offset().top - 80
|
if (
|
||||||
}, 800, function(){
|
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
|
||||||
window.location.hash = hash;
|
&&
|
||||||
});
|
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();
|
init();
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
let state = 0;
|
let state = 0;
|
||||||
|
|
||||||
// if (screen.width < screen.height){
|
|
||||||
// $('.section--preview').addClass('horizontal');
|
|
||||||
// }else{
|
|
||||||
// $('.section--preview').removeClass('horizontal');
|
|
||||||
// }
|
|
||||||
|
|
||||||
$('.js-prev-slide').click(function() {
|
$('.js-prev-slide').click(function() {
|
||||||
if(state - 1 == -1){state = 2;}else{state = state - 1;}
|
if(state - 1 == -1){state = 2;}else{state = state - 1;}
|
||||||
swiper(state,0);
|
swiper(state,0);
|
||||||
|
|||||||
Reference in New Issue
Block a user