|
@@ -31,7 +31,7 @@ function click_link() {
|
|
lazy();
|
|
lazy();
|
|
},
|
|
},
|
|
complete: function(data) {
|
|
complete: function(data) {
|
|
- console.log('cat', cat);
|
|
|
|
|
|
+ // console.log('cat', cat);
|
|
$loader.hide();
|
|
$loader.hide();
|
|
click_img(e, $this, $href, url, page, cat, project_name);
|
|
click_img(e, $this, $href, url, page, cat, project_name);
|
|
closeAjax();
|
|
closeAjax();
|
|
@@ -45,6 +45,7 @@ function click_list() {
|
|
var $link = $('.list-projets li > a');
|
|
var $link = $('.list-projets li > a');
|
|
|
|
|
|
$link.click(function(e) {
|
|
$link.click(function(e) {
|
|
|
|
+ $('.sidebar-right, .sidebar-right button.hamburger').removeClass('is-active');
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
var $this = $(this);
|
|
var $this = $(this);
|
|
$href = $this.attr("href");
|
|
$href = $this.attr("href");
|
|
@@ -58,10 +59,8 @@ function click_list() {
|
|
var $link_card = $('.card > #'+project_name + ' a');
|
|
var $link_card = $('.card > #'+project_name + ' a');
|
|
|
|
|
|
if ($link_txt.hasClass('open') && $link_card.parent().hasClass('open') ) {
|
|
if ($link_txt.hasClass('open') && $link_card.parent().hasClass('open') ) {
|
|
-
|
|
|
|
anchor($href);
|
|
anchor($href);
|
|
-
|
|
|
|
- }else if ($link_txt.hasClass('open')) {
|
|
|
|
|
|
+ } else if ($link_txt.hasClass('open')) {
|
|
anchor($href);
|
|
anchor($href);
|
|
$.ajax({
|
|
$.ajax({
|
|
url : '/' + page + '/' + cat + '/' + project_name, // La ressource ciblée
|
|
url : '/' + page + '/' + cat + '/' + project_name, // La ressource ciblée
|
|
@@ -78,10 +77,12 @@ function click_list() {
|
|
complete: function(data) {
|
|
complete: function(data) {
|
|
marg_item(project_name);
|
|
marg_item(project_name);
|
|
closeAjax();
|
|
closeAjax();
|
|
|
|
+ anchor($href);
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
+
|
|
$('#item_list').remove();
|
|
$('#item_list').remove();
|
|
$('.open').removeClass('open');
|
|
$('.open').removeClass('open');
|
|
|
|
|
|
@@ -100,11 +101,11 @@ function click_list() {
|
|
click_img(e, $this, $href, url, page, cat, project_name)
|
|
click_img(e, $this, $href, url, page, cat, project_name)
|
|
},
|
|
},
|
|
complete: function(data) {
|
|
complete: function(data) {
|
|
- console.log('cat', cat);
|
|
|
|
|
|
+ // console.log('cat', cat);
|
|
var $link_card = $('.card > #'+project_name + ' a');
|
|
var $link_card = $('.card > #'+project_name + ' a');
|
|
setTimeout( function(){
|
|
setTimeout( function(){
|
|
- console.log('project_name', project_name);
|
|
|
|
- console.log('$link_card', $link_card);
|
|
|
|
|
|
+ // console.log('project_name', project_name);
|
|
|
|
+ // console.log('$link_card', $link_card);
|
|
if ($link_card.hasClass('open')) {
|
|
if ($link_card.hasClass('open')) {
|
|
}else {
|
|
}else {
|
|
anchor($href);
|
|
anchor($href);
|
|
@@ -121,6 +122,7 @@ function click_list() {
|
|
marg_item(project_name);
|
|
marg_item(project_name);
|
|
closeAjax();
|
|
closeAjax();
|
|
anchor($href);
|
|
anchor($href);
|
|
|
|
+ scrollTop();
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -132,6 +134,7 @@ function click_list() {
|
|
}
|
|
}
|
|
|
|
|
|
function click_img(e, $this, $href, url, page, cat, project_name) {
|
|
function click_img(e, $this, $href, url, page, cat, project_name) {
|
|
|
|
+
|
|
$('section.' + cat +' .card-image > a').click(function(e) {
|
|
$('section.' + cat +' .card-image > a').click(function(e) {
|
|
var $this = $(this);
|
|
var $this = $(this);
|
|
$href = $this.attr("href");
|
|
$href = $this.attr("href");
|
|
@@ -161,24 +164,30 @@ function click_img(e, $this, $href, url, page, cat, project_name) {
|
|
marg_item(project_name);
|
|
marg_item(project_name);
|
|
anchor($href);
|
|
anchor($href);
|
|
lazy();
|
|
lazy();
|
|
|
|
+ scrollTop();
|
|
|
|
+
|
|
|
|
+ // ScrollReveal().reveal($('#item_list > .card'), {
|
|
|
|
+ // duration: 1000,
|
|
|
|
+ // distance: '10px',
|
|
|
|
+ // });
|
|
|
|
+
|
|
},
|
|
},
|
|
complete:function() {
|
|
complete:function() {
|
|
closeAjax();
|
|
closeAjax();
|
|
$('.loader').hide();
|
|
$('.loader').hide();
|
|
- scrollTop();
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function anchor($href) {
|
|
function anchor($href) {
|
|
|
|
|
|
- var aTag = $("a[href='"+ $href +"']");
|
|
|
|
|
|
+ var aTag = $("#text_figli a[href='"+ $href +"']");
|
|
|
|
+ console.log(aTag);
|
|
// console.log('aTag.offset()', aTag.offset().top+10);
|
|
// console.log('aTag.offset()', aTag.offset().top+10);
|
|
- $('html,body').animate({scrollTop: aTag.offset().top-7},'slow');
|
|
|
|
|
|
+ $('html,body').animate({scrollTop: aTag.offset().top - 7},'slow');
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -209,7 +218,7 @@ function mouseHover() {
|
|
link_id = $(this).attr("id");
|
|
link_id = $(this).attr("id");
|
|
|
|
|
|
$('html').append("<div class=circle_hover ></div>");
|
|
$('html').append("<div class=circle_hover ></div>");
|
|
- console.log('link_id',link_id);
|
|
|
|
|
|
+ // console.log('link_id',link_id);
|
|
|
|
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
$('.circle_hover').addClass('open '+ link_id);
|
|
$('.circle_hover').addClass('open '+ link_id);
|
|
@@ -245,14 +254,6 @@ function lazy() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-function redirection() {
|
|
|
|
- var url = document.location.href;
|
|
|
|
- console.log(url);
|
|
|
|
- if (url != 'https://figureslibres.kevintessier.net/') {
|
|
|
|
- document.location.href="https://figureslibres.kevintessier.net/"
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function animate_burger() {
|
|
function animate_burger() {
|
|
var forEach=function(t,o,r){if("[object Object]"===Object.prototype.toString.call(t))for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.call(r,t[c],c,t);else for(var e=0,l=t.length;l>e;e++)o.call(r,t[e],e,t)};
|
|
var forEach=function(t,o,r){if("[object Object]"===Object.prototype.toString.call(t))for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.call(r,t[c],c,t);else for(var e=0,l=t.length;l>e;e++)o.call(r,t[e],e,t)};
|
|
var hamburgers = document.querySelectorAll(".hamburger");
|
|
var hamburgers = document.querySelectorAll(".hamburger");
|
|
@@ -297,12 +298,55 @@ function scrollTop() {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function imgmouse() {
|
|
|
|
+ var currentMousePos = { x: 0, y: 0 };
|
|
|
|
+ var $img = $('.list-projets .img');
|
|
|
|
+
|
|
|
|
+ $(document).mousemove(function(event) {
|
|
|
|
+ currentMousePos.x = event.pageX;
|
|
|
|
+ currentMousePos.y = event.pageY;
|
|
|
|
+
|
|
|
|
+ $img.css('left', currentMousePos.x );
|
|
|
|
+ $img.css('top', currentMousePos.y );
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function scrollreveal() {
|
|
|
|
+ var $txt = $('#text_figli p');
|
|
|
|
+
|
|
|
|
+ ScrollReveal().reveal($txt, {
|
|
|
|
+ duration: 1000,
|
|
|
|
+ distance: '10px',
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var $button = $('.sidebar button');
|
|
|
|
+ var $title_menu = $('.title-menu h2');
|
|
|
|
+
|
|
|
|
+$button.click(function() {
|
|
|
|
+ ScrollReveal().destroy($txt, {
|
|
|
|
+ duration: 1000,
|
|
|
|
+ distance: '10px',
|
|
|
|
+ });
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function clickmenu() {
|
|
|
|
+ var $menu = $('.sidebar-right button');
|
|
|
|
+
|
|
|
|
+ $menu.click(function() {
|
|
|
|
+ $('#text_figli').toggleClass('hidden');
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
$(document).ready(function($){
|
|
$(document).ready(function($){
|
|
- // redirection();
|
|
|
|
|
|
+ scrollreveal();
|
|
click_link();
|
|
click_link();
|
|
click_list();
|
|
click_list();
|
|
mouseHover();
|
|
mouseHover();
|
|
animate_burger();
|
|
animate_burger();
|
|
croix();
|
|
croix();
|
|
|
|
+ imgmouse();
|
|
|
|
+ clickmenu();
|
|
});
|
|
});
|