From: bruno@cubedesigners.com Date: Thu, 20 Feb 2014 12:42:39 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=71af088e8d813cc4a4d93f5dc7813fec03d1db46;p=cubedesigners-v7.git --- diff --git a/framework/application/views/helpers/RealisationsList.php b/framework/application/views/helpers/RealisationsList.php index 301f7f2..d8fe433 100644 --- a/framework/application/views/helpers/RealisationsList.php +++ b/framework/application/views/helpers/RealisationsList.php @@ -2,84 +2,84 @@ class Cubedesigners_View_Helper_RealisationsList extends Zend_View_Helper_Abstract { - public function RealisationsList($datas) { + public function RealisationsList($datas) { - $acl = Bootstrap::getInstance()->isAllowed("edition"); + $acl = Bootstrap::getInstance()->isAllowed("edition"); - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('realisations') - ->order('id ASC'); - if (!$acl) { - $s->where('online = ?', 1); - } + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('realisations') + ->order('id ASC'); + if (!$acl) { + $s->where('online = ?', 1); + } - $q = $s->query(); + $q = $s->query(); - $count = 1; + $count = 1; - $res = ''; + $res = ''; - $test = 0; - while ($r = $q->fetch()) { + $test = 0; + while ($r = $q->fetch()) { - $r = CubeIT_Util_Cms::unserialize($r); + $r = CubeIT_Util_Cms::unserialize($r); - $addSpacer = false; + $addSpacer = false; - /* if ($count == 4) { - $count = 1; - $addClass = ''; - //$addSpacer = true; - } else { - $addClass = ' blocmargin'; - $count++; - } */ + /* if ($count == 4) { + $count = 1; + $addClass = ''; + //$addSpacer = true; + } else { + $addClass = ' blocmargin'; + $count++; + } */ - $addClass = ' blocmargin'; + $addClass = ' blocmargin'; - $addOffline = ''; - if ($acl && $r->online == 0) { - $addOffline = 'data-offline="1"'; - } + $addOffline = ''; + if ($acl && $r->online == 0) { + $addOffline = 'data-offline="1"'; + } - //$res .= ''; + //$res .= ''; - $visuel = $this->view->imageProcess($r->visuel_detail, '', null, 440); + $visuel = $this->view->imageProcess($r->visuel_detail, '', null, 440); - fb($r); + fb($r); - $image = $this->view->imageProcess($r->visuel, $r->titre, 230, 230); - $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_rea']); + $image = $this->view->imageProcess($r->visuel, $r->titre, 230, 230); + $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_rea']); - $res .= ''; - /* $res .= '
'; - $res .= ''; + $res .= ''; + /* $res .= ''; */ - $res .= '
'; - $res .= '
' . $image . '
'; - //$res .= '
' . $r->titre . '
'; - $res .= '
'; - $res .= ''; - // if ($addSpacer) { - // $res .= '
'; - // } - $test++; + $res .= '
' . $visuel . '
'; + $res .= '
'; */ + $res .= '
'; + $res .= '
' . $image . '
'; + //$res .= '
' . $r->titre . '
'; + $res .= '
'; + $res .= ''; + // if ($addSpacer) { + // $res .= '
'; + // } + $test++; - $count++; - } + $count++; + } - return $res; - } + return $res; + } } diff --git a/framework/application/views/scripts/templates/realisations.phtml b/framework/application/views/scripts/templates/realisations.phtml index b94fe85..50778aa 100644 --- a/framework/application/views/scripts/templates/realisations.phtml +++ b/framework/application/views/scripts/templates/realisations.phtml @@ -10,8 +10,6 @@ $this->headScript()->addScriptAndStyle('realisations'); CasestudiesTagsList($this->studies); ?> - -
getCMSDatasOfPage($this->id); diff --git a/images/rea_close.jpg b/images/rea_close.jpg new file mode 100644 index 0000000..d14d4a4 Binary files /dev/null and b/images/rea_close.jpg differ diff --git a/js/common.js b/js/common.js index 3c068e0..3e1f4c2 100644 --- a/js/common.js +++ b/js/common.js @@ -4,10 +4,10 @@ var colors = ["#6F216C", "#F34B0D", "#C50102", "#5DA537", "#F1D81B"]; //turn an icon a random color $(function() { $("#header").hover(function() { - var color = colors[Math.floor(Math.random()*5)]; - $(this).css('fill',color); - }, - function() { - $(this).css('fill','black'); - }) + var color = colors[Math.floor(Math.random()*5)]; + $(this).css('fill',color); + }, + function() { + $(this).css('fill','black'); + }) }); diff --git a/js/realisations.js b/js/realisations.js index 56a7d86..b0fcb78 100644 --- a/js/realisations.js +++ b/js/realisations.js @@ -5,13 +5,14 @@ var isAnim = false; var currentOpen = 0; var currentOpenValues; var detail = ""; -var switchTimer; var currentSlide = 1; -var autoSlide = true; +var autoSlide = false; +var totalWidth; +var lastWidth; function load_realisations() { //initTagsLink(); - + $(".bloc").click( function () { var currentRea = $(this).attr("data-pos"); @@ -42,9 +43,7 @@ function load_realisations() { } detail = ""; - - - //$.ajax(); + $.ajax({ url : '/ajax/displayrealisation', type : 'GET', @@ -56,52 +55,80 @@ function load_realisations() { currentOpenValues = rea; - detail += '
'; + detail += '
'; detail += '
'; detail += '
'+rea.titre+'
'; - detail += '
'+rea.legende+'
'; - detail += '
Agence : '+rea.agence+'
'; + + if( rea.legende != '') { + detail += '
'+rea.legende+'
'; + } + + if( rea.agence != '') { + detail += '
Agence : '+rea.agence+'
'; + } + detail += '
'+rea.description+'
'; detail += 'Voir le site'; detail += '
'; + detail += '
    '; - var image=new Image(); - image.src=rea.visuel_detail[0]; - - detail += '
    '; - detail += '
'; + totalWidth = 0; + for( var i=0; i'; + } - preloadSlides(); + detail += '
'; + detail += '
'; - $(".bloc").find('.project-photo').removeClass("gray"); - if( $( "#detail" ).length > 0) { - $( "#detail" ).slideUp( "slow", function() { - $('#detail').remove(); + $( "#detail" ).slideUp( 500, function() { + + $('#detailContent').remove(); + $(cible.parent()).before(detail); + + $("html, body").animate({ scrollTop: $('#detailContent').offset().top-100 }, 1000); + $('.close').css("top", $('#detailContent').offset().top); + + $( "#detail" ).slideDown( "slow", function() { isAnim = false; addCloseAction(); currentSlide = 1; autoSlide = true; - switchTimer = window.setTimeout( nextSlide, 5000); + initSlideShow(); + }).animate( - { opacity: 1 }, + { opacity: 1 }, { queue: false, duration: 'slow' } ); - + }).animate( - { opacity: 0 }, + { opacity: 1 }, { queue: false, duration: 'slow' } ); }else{ $(cible.parent()).before(detail); + + $("html, body").animate({ scrollTop: $('#detailContent').offset().top-100 }, 1000); + $('.close').css("top", $('#detailContent').offset().top); + $( "#detail" ).slideDown( "slow", function() { + isAnim = false; addCloseAction(); currentSlide = 1; autoSlide = true; - switchTimer = window.setTimeout( nextSlide, 5000); + initSlideShow(); }).animate( { opacity: 1 }, { queue: false, duration: 'slow' } @@ -112,7 +139,9 @@ function load_realisations() { var id = $(this).parent().attr("data-pos"); if( id != currentRea ) { $(this).addClass("gray"); - } + }else{ + $(this).removeClass("gray"); + } }); } @@ -120,20 +149,22 @@ function load_realisations() { } + currentOpen = currentRea; }); } function addCloseAction() { $(".close").click(function() { + $("html, body").animate({ scrollTop: 0 }, 1000); $( "#detail" ).slideUp( "slow", function() { - $('#detail').remove(); + $('#detailContent').remove(); currentOpen = 0; $(".project-photo").each( function() { $(this).removeClass("gray"); }); }).animate( - { opacity: 0 }, + { opacity: 1 }, { queue: false, duration: 'slow' } ); }); @@ -158,66 +189,54 @@ function initTagsLink() { $(".tag:first").addClass('active'); } - //displayStudies(); - //alert(showIds); }); } - -function preloadSlides() { - /* - var i=0; +function initSlideShow() { - $('.slide[data-image]').each(function(){ - var slide=this; - var image=new Image(); - image.src=$(this).attr('data-image'); - - if(image.complete){ - $(this).html(""); - } - - $(image).load(function(){ - $(slide).html(""); - }); - - i++; - });*/ -} + var mouse_move=false; + function move(e) { + if(mouse_move) { + if(document.documentElement.clientWidth>0) { + + position = e.pageX-document.documentElement.scrollLeft; + } else { + position = e.pageX-document.body.scrollLeft; + } + } + } + document.onmousemove=move; -function nextSlide() { - - var maxSlides = currentOpenValues.visuel_detail.length; - if(maxSlides == 1) autoSlide = false; - - if( autoSlide ) { + $(".slides").mouseover(function(e){ - if( currentSlide < maxSlides ) { - currentSlide++; - }else{ - currentSlide=1; - } + mouse_move = true; + le_div = '.' + 'slides'; - $( "#visuel_detail" ).fadeOut( "slow", function() { - $("#visuel_detail").attr("src", currentOpenValues.visuel_detail[currentSlide-1]); - $( "#visuel_detail" ).fadeIn(); - }); + if($(le_div + " ul li").length > 1){ - switchTimer = window.setTimeout( nextSlide, 5000); - } -} + var total_lenght = totalWidth; -function displayRealisation( rea ) { - - //$(rea); - - var url = $(rea).attr("data-url"); - - -} + var t= setInterval(function(){ -function resize() { - -} + var offset = $(le_div).offset(); + + if((position - offset.left) < ($("#detailContent").width()/2) ){ + if($(le_div + " ul").css('marginLeft').replace("px", "") > - (total_lenght - lastWidth)){ + $(le_div + " ul").animate({marginLeft:"-=2px"},0); + } + }else{ + if($(le_div + " ul").css('marginLeft').replace("px", "") <= 0){ + $(le_div + " ul").animate({marginLeft:"+=2px"},0); + } + } + },5); + $(le_div).mouseout(function(){ + clearInterval(t); + mouse_move=false; + }); + } + }); + +} \ No newline at end of file diff --git a/less/realisations.less b/less/realisations.less index 6c70247..c1a8648 100644 --- a/less/realisations.less +++ b/less/realisations.less @@ -4,11 +4,10 @@ margin: 0 auto; padding: 0 0 20px 0; - ul { list-style: none; } - + li { font-size: 14px; color: #6f6f6f; @@ -40,11 +39,12 @@ max-width: 980px; margin: 0 auto; padding: 0 0 50px 0; - overflow: hidden; + // overflow: hidden; .bloc { width:230px; - float:left; + //float:left; + display:inline-block; } a,a:hover { @@ -64,10 +64,21 @@ -moz-filter: grayscale(100%); -o-filter: grayscale(100%); -ms-filter: grayscale(100%); - filter: url("data:image/svg+xml;utf8,#grayscale"); /* Firefox 10+, Firefox on Android */ + filter: url("data:image/svg+xml;utf8,#grayscale"); /* Firefox 10+, Firefox on Android */ filter: gray; /* IE6-9 */ + } + .bloc { + filter: grayscale(0%); + -webkit-filter: grayscale(0%); + -moz-filter: grayscale(0%); + -o-filter: grayscale(0%); + -ms-filter: grayscale(0%); + filter: url("data:image/svg+xml;utf8,#grayscale"); + //filter: none; /* IE6-9 */ + transition: all 500ms; + } .bloc .project-title { @@ -91,15 +102,39 @@ clear: both; display:none; margin-bottom: 15px; - opacity: 0; - filter:alpha(opacity=0); - -moz-opacity:0; + width:10000px; + white-space: nowrap; } + #detailContent { + overflow: visible; + width: 100%; + height: auto; + + .close { + position:absolute; + right: 0; + //top: 0; + background-image: url('../images/rea_close.jpg'); + width: 62px; + height: 62px; + cursor: pointer; + } + } + + #detail .detailLeft { - float:left; - width:250px; + vertical-align: top; + display:inline-block; + width:230px; + min-width: 230px; + max-width: 230px; padding-right:15px; + white-space: normal; + + div { + max-width: 220px; + } .titre { font-size: 32px; @@ -137,24 +172,37 @@ } #detail .detailRight { - //float:left; - position: absolute; - right: 0; + display:inline-block; + vertical-align:top; + //position: absolute; + //right: 0; + + + .slides { overflow: hidden; - width: 1000px; + width: 10000px; } - .close { - position:absolute; - right: 0; - top: 0; - background-image: url('../images/rea_close.jpg'); - width: 62px; - height: 62px; - cursor: pointer; + + .slides ul{ + position:relative; + list-style-type:none; + margin: 0px; + padding: 0px; + width:9999px; } + + .slides li{ + padding:0px; + margin:0px; + list-style:none; + display: inline-block; + } + + + }