Alessandro Senior Graphic & Packaging Designer

ABOUT

Animation and Music by Alessandro Vitali

MADEIT CREDITS

PinKOculus

' }; } var $a = $pf.find('a:not(.adminLink):not(.likepool-btn)').filter(function() { // plain image return jQuery(this).find('img').length > 0; }).first(); if ($a.length && $a.attr('href')) return { type: 'image', href: $a.attr('href') }; return null; } function cpOpenMedia($pf) { var group = [], openIndex = 0, target = $pf.get(0); jQuery('.projectItem_list .port_full').each(function() { // DOM order = carousel order var item = cpMediaItemFor(jQuery(this)); if (!item) return; if (this === target) openIndex = group.length; group.push(item); }); if (!group.length) return false; jQuery.fancybox(group, { index: openIndex, padding: 0, overlayOpacity: 0.85, overlayColor: '#000', titleShow: false, changeSpeed: 0, autoScale: true, autoDimensions: true, centerOnScroll: true, onComplete: function() { // autoplay the self-hosted video on whichever slide we land on // tracker 4224 c18537: flag video/embed slides so the prev/next click-zones let clicks reach // the player's scrubber (see CSS). Image slides keep click-anywhere-to-advance. var isMedia = jQuery('#fancybox-content').find('video, iframe').length > 0; jQuery('#fancybox-wrap').toggleClass('cp-media-noclicknav', isMedia); var v = jQuery('#fancybox-content video').get(0); if (!v) return; // tracker 4224 c18535: posters below the fold may not be decoded when the group is built, so their box // can fall back to 16/9. Once the modal video reports its real size, refit the box to the true aspect // (portrait included) and re-center - independent of whether the poster had loaded. var refit = function() { if (!v.videoWidth || !v.videoHeight) return; var box = cpVideoModalBox(v.videoWidth / v.videoHeight); jQuery('#fancybox-content, #fancybox-content .cp-video-modal').css({ width: box.w + 'px', height: box.h + 'px' }); try { if (jQuery.fancybox && jQuery.fancybox.resize) jQuery.fancybox.resize(); } catch (err) {} }; if (v.videoWidth) refit(); else jQuery(v).one('loadedmetadata', refit); try { var p = v.play(); if (p && typeof p.catch === 'function') { p.catch(function(){}); } } catch (err) {} }, onCleanup: function() { // and stop it when leaving/closing the slide var v = jQuery('#fancybox-content video').get(0); if (v) { try { v.pause(); v.currentTime = 0; } catch (err) {} } }, onClosed: function() { // #fancybox-wrap is cached & reused - don't leave the flag on it jQuery('#fancybox-wrap').removeClass('cp-media-noclicknav'); } }); return false; } // Single delegated handler for every media item. Rebuilt on each click so async (Vimeo/YouTube) posters are caught. var cpMediaSel = '.cp-video-poster, .cp-embed-poster, a:not(.adminLink):not(.likepool-btn)'; jQuery('.projectItem_list').off('click.cpmedia', cpMediaSel).on('click.cpmedia', cpMediaSel, function(e) { var $t = jQuery(this); if ($t.is('a') && !$t.find('img').length) return; // not an image link (title/credit/etc.) - leave it alone var $pf = $t.closest('.port_full'); e.preventDefault(); if ($pf.length) return cpOpenMedia($pf); // tracker 4224: image anchor not inside a media block - still open it (parity with the old gallery, which // lightboxed every such ) instead of navigating to the raw image. Posters always live in a .port_full, // so this only ever catches stray inline images. if ($t.is('a') && $t.attr('href')) { jQuery.fancybox({ href: $t.attr('href'), type: 'image', padding: 0, overlayOpacity: 0.85, overlayColor: '#000', titleShow: false, changeSpeed: 0 }); } return false; }); jQuery(document).ready(function(){ // resume ready(): everything below needs the full DOM (aside, comments, scroll, ajax) cp10.setup_comments('PROJECT', 49362); window.scrl = {}; window.scrl.el = $('#p-side-btm'); window.scrl.fixed = $('.p-detail-aside .fixer'); window.scrl.h = $(window).height(); window.scrl.firedAt = false; window.scrl.detectOffset = $('.profile-page').length > 0 ? 165 : 105; $(window).resize(function(){ window.scrl.h = $(window).height(); }); var onscroll = function(e){ if(( window.scrl.h - window.scrl.detectOffset ) > window.scrl.fixed.height()){ return $(window.scrl.fixed).css({ 'position': 'fixed', 'top': 'inherit' }); } var scrollTop = $('.showing_project').length > 0 ? $('.profile-detail-wrapper').scrollTop() : $(window).scrollTop(); if(window.scrl.firedAt && scrollTop < window.scrl.firedAt){ // we can revert to original style $(window.scrl.fixed).css({ 'position': 'absolute', 'top': 0 }); window.scrl.firedAt = false; return true; } if(window.scrl.el.visible(true)) { if (!window.scrl.firedAt) { // this is first time we initiate fixed position window.scrl.firedAt = scrollTop; } $(window.scrl.fixed).css({ 'position': 'fixed', 'top': (-1) * (window.scrl.fixed.height() - window.scrl.h + 100 ) }); } }; cp10.handle_back_button(); $(window).off('scroll', onscroll).on('scroll', onscroll).scroll(); });