|
|
@@ -51,7 +51,7 @@ $(document).ready(function(){
|
|
|
iconmorph.to('mail', {duration:1000, easing:'quad-in-out', rotation:'random'});
|
|
|
});
|
|
|
$( "a.about-card" ).hover(function() {
|
|
|
- iconmorph.to('about', {duration:1000, easing:'quad-in-out', rotation:'clock'});
|
|
|
+ iconmorph.to('contact', {duration:1000, easing:'quad-in-out', rotation:'clock'});
|
|
|
});
|
|
|
$( "a.code-card" ).hover(function() {
|
|
|
iconmorph.to('code', {duration:1000, easing:'quad-in-out', rotation:'random'});
|
|
|
@@ -62,7 +62,26 @@ $(document).ready(function(){
|
|
|
$( "a.studio-card" ).hover(function() {
|
|
|
iconmorph.to('studio', {duration:1000, easing:'quad-in-out', rotation:'clock'});
|
|
|
});
|
|
|
- $( "a.contact-card" ).hover(function() {
|
|
|
- iconmorph.to('contact', {duration:1000, easing:'quad-in-out', rotation:'random'});
|
|
|
+ $( "a.work-card" ).hover(function() {
|
|
|
+ iconmorph.to('about', {duration:1000, easing:'quad-in-out', rotation:'random'});
|
|
|
+ });
|
|
|
+
|
|
|
+ // Zoom-into-card page transition: clicking a home nav-card scales the white card
|
|
|
+ // up until it fills the screen (fading the inner content), then navigates.
|
|
|
+ $( "a.about-card, a.desk-card, a.studio-card, a.work-card" ).on('click', function (e) {
|
|
|
+ var href = this.getAttribute('href');
|
|
|
+ if (!href) return;
|
|
|
+ e.preventDefault();
|
|
|
+ var $card = $('.container.card');
|
|
|
+ if ($card.hasClass('dw-zoom')) return; // already animating
|
|
|
+ document.documentElement.style.overflow = 'hidden';
|
|
|
+ document.body.style.overflow = 'hidden';
|
|
|
+ document.body.classList.add('dw-zooming'); // fade the dark veil in over the zoom
|
|
|
+ $card.addClass('dw-zoom');
|
|
|
+ var content = document.querySelector('.card .content');
|
|
|
+ var gone = false;
|
|
|
+ function go() { if (gone) return; gone = true; window.location.href = href; }
|
|
|
+ if (content) content.addEventListener('transitionend', go, { once: true });
|
|
|
+ setTimeout(go, 950); // fail-safe if transitionend never fires
|
|
|
});
|
|
|
});
|