]> _ Git - cubedesigners-v7.git/commitdiff
WIP #2033 @5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 21 Mar 2019 16:02:00 +0000 (16:02 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 21 Mar 2019 16:02:00 +0000 (16:02 +0000)
framework/application/views/helpers/CasestudiesList.php
framework/application/views/helpers/FooterActualites.php
framework/application/views/helpers/FooterContact.php
framework/application/views/helpers/LinkArrow.php
framework/application/views/scripts/studies/index.phtml
framework/application/views/scripts/templates/casestudies.phtml
less/casestudies.less
less/common.less
less/link-arrow.less [new file with mode: 0644]

index 3ae435d1fa280f040a6ab6023dd0a60095901896..3c4b068f1ca8cc705e7f37c545fb6eecba99af64 100644 (file)
@@ -167,6 +167,7 @@ class Cubedesigners_View_Helper_CasestudiesList extends CubeIT_View_Helper_Abstr
 
         $c = '<div class="img-wrapper" style="'. $hover_style .'">';
         $c.= $image;
+        $c.= '<span class="arrows-animation animating"></span>';
         $c.= '</div>';
                $c.= '<h2>' . $s->titre . '</h2>';
                //$c.='<h3>' . $s->description . '</h3>';
index 1339080ad252af213da2585fb6707f37c816e766..c34563bfcbc4d38676e855001b0e9dc277619e71 100644 (file)
@@ -25,7 +25,7 @@ class Cubedesigners_View_Helper_FooterActualites extends CubeIT_View_Helper_Abst
             $res .= '</article>';
         }
 
-               $res .= $this->linkInternal(__('Voir plus d\'actualité') . $this->view->linkArrow(), 'news', array('class' => 'arrow-link'));
+               $res .= $this->linkInternal($this->view->linkArrow(__('Voir plus d\'actualité')), 'news', array('class' => 'animated-arrow'));
 
                $res .= '</section>';
 
index be85f375485b8a9c8f76dbf8ee10853308aa034e..57cdb9227b097b22a4ffe36f740584d153835e33 100644 (file)
@@ -33,7 +33,7 @@ class Cubedesigners_View_Helper_FooterContact extends Zend_View_Helper_Abstract
 
                        $res .= '<div class="geoloc">';
                        $event = array('category' => 'map', 'action' => 'click', 'label' => $bureau['coordonnees']['ville']);
-                       $res .= $this->view->linkGeo(__("Voir le plan") . $this->view->linkArrow(), $bureau['coordonnees']['adresse'] . ',' . $bureau['coordonnees']['ville'] . ',' . Zend_Locale::getTranslation($bureau['coordonnees']['pays'], 'territory'), array('class' => 'arrow-link', 'data-event' => $event));
+                       $res .= $this->view->linkGeo($this->view->linkArrow(__("Voir le plan")), $bureau['coordonnees']['adresse'] . ',' . $bureau['coordonnees']['ville'] . ',' . Zend_Locale::getTranslation($bureau['coordonnees']['pays'], 'territory'), array('class' => 'animated-arrow', 'data-event' => $event));
                        $res .= '</div>';
 
                        $res .= '</div>';
index 42724ef950bd8fa00a0acaebb56a12c7808d81b9..a36ca76c42d0fec71a28e1498a9118796157a8cc 100644 (file)
@@ -2,13 +2,24 @@
 
 class Cubedesigners_View_Helper_LinkArrow extends CubeIT_View_Helper_Abstract {
 
-    public function linkArrow() {
-
-        return '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-             viewBox="0 0 25 10.6" style="enable-background:new 0 0 25 10.6;" xml:space="preserve">
-        <path d="M25,5.5C25,5.4,25,5.2,25,5.1c0-0.1-0.1-0.1-0.1-0.2l-4.8-4.8c-0.2-0.2-0.5-0.2-0.7,0s-0.2,0.5,0,0.7l3.9,3.9H0.5
-            C0.2,4.8,0,5,0,5.3s0.2,0.5,0.5,0.5h22.8l-3.9,3.9c-0.2,0.2-0.2,0.5,0,0.7c0.1,0.1,0.2,0.1,0.4,0.1s0.3,0,0.4-0.1l4.8-4.8
-            C24.9,5.6,24.9,5.6,25,5.5z"/>
-        </svg>';
+    public function linkArrow($text = '') {
+
+        // HTML structure for link content. This doesn't include the link itself
+        // because it's more flexible to be able to provide the link contents to
+        // existing link helpers
+        //
+        // Based on: https://codepen.io/nicoencarnacion/pen/XpaRQV
+
+        $this->headScript()->addScriptAndStyle('link-arrow');
+
+        return '<span class="the-arrow -left">
+                    <span class="shaft"></span>
+                </span>
+                <span class="main">
+                  <span class="text">'. $text .'</span>
+                  <span class="the-arrow -right">
+                    <span class="shaft"></span>
+                  </span>
+                </span>';
     }
 }
index 3c2a76d417497b563dccbeba95dc25bf900ad8e4..0b56ca8583a76b113ce7b07bd9340e33348c5436 100644 (file)
@@ -10,7 +10,7 @@ echo $this->CasestudiesDetail($this->studie);
     <?php echo $this->caseStudiesGrid(3, $this->studie->id); ?>
 
     <p class="casestudies-archive-link">
-        <?php echo $this->linkInternal(__('Voir tous les projets') . $this->linkArrow(), 'casestudies', array('class' => 'arrow-link')); ?>
+        <?php echo $this->linkInternal($this->linkArrow(__('Voir tous les projets')), 'casestudies', array('class' => 'animated-arrow')); ?>
     </p>
 
 </div>
index 19253bfdd6c6db1a8d98b996d80c5d3f7fe284f4..aa2e3fbe39abf4c9e25a1d01dc3c11d31a8279ce 100644 (file)
@@ -20,7 +20,7 @@ $this->headScript()->addScriptAndStyle('casestudies');
        </div>
 
     <p class="casestudies-archive-link">
-        <?php echo $this->linkInternal(__('Voir les archives') . $this->linkArrow(), 'Portfolio', array('class' => 'arrow-link')); ?>
+        <?php echo $this->linkInternal($this->linkArrow(__('Voir les archives')), 'Portfolio', array('class' => 'animated-arrow')); ?>
     </p>
 
 </div>
index 16372cb6e2be4963bea51f823916495265cacce2..341d07508670c74b180cc8d266a164fdf6e2f1b2 100644 (file)
@@ -32,7 +32,8 @@
           width: 100%;
           height: 100%;
           background-color: currentColor; // Inherit from .img-wrapper
-          background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAMAAADUivDaAAABp1BMVEUAAAD2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH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E1ustqNMRKBTsF1OZCxbptQDLFCwZVyLnNDMUzHFPEX5vT8pFZTnoIZeWscwGuYccaOQoNxDcanm5KlCpkTm4pW7upMtUeYRHtMqmbLKUmIRjRSZV9xULCob06ijna2kGUlnmVTO8QRPKRHPlG2XzHPJGtFnQBtryRUVjecAXvCnGiMAlvhTjZcAYq/cNOJC4fUkylrpoiF+p29gCOrOG+JJ9LfYFaCC+p+8HRW+kLNGoiAWFt6hAvX06C5Mncv0ZPkaTPiDXkSXUCVAD+pRbeUsXVuNYY+gny6tvYdgcICu9I3Bor+PLgz9CRt/zdKxuTHYCv9Nh2b+gUTseJQORFtjkLuqsaaJJShdH9WppI+voBbfvyFK/bfeAic+fOymre7xKTi18enzHAVr61824E646+vi6rfuSET7tvp9uisMmR8A02/S/W9HBAAAAABJRU5ErkJggg==');
+        // Magnifying glass icon
+        //  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAMAAADUivDaAAABp1BMVEUAAAD2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH2rgH5x1H967/84Z/////+9d/714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9WppI+voBbfvyFK/bfeAic+fOymre7xKTi18enzHAVr61824E646+vi6rfuSET7tvp9uisMmR8A02/S/W9HBAAAAABJRU5ErkJggg==');
           background-position: center;
           background-repeat: no-repeat;
           position: absolute;
@@ -71,7 +72,6 @@
                h3 {
                        font-size: 16px;
                        line-height: 1.4;
-                       height: 18px;
                        color: #545454;
                        margin-top: -3px;
 
 
     a:hover {
 
-      .img-wrapper {
-
-        &:before {
-          opacity: 1;
-          background-size: 66px;
-        }
+      .arrows-animation, .img-wrapper:before {
+        opacity: 1;
       }
 
       img {
   margin-bottom: 4em;
   text-align: right;
 }
+
+// Animated arrows (>>)
+.arrows-animation {
+  font-size: 66px; // Controls size of animated arrows element
+  border: 2px solid #fff;
+  width: 1em;
+  height: 1em;
+  border-radius: 100%;
+  cursor: pointer;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 1;
+  opacity: 0; // Hidden until hovered
+  transition: opacity 0.2s ease-out;
+
+  &:before, &:after {
+    content: '';
+    position: absolute;
+    bottom: 0;
+    width: 0.3em;
+    height: 0.3em;
+    background-size: contain;
+    top: 0.35em;
+    left: 30%;
+    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23fff' d='M319.1 217l-190-190C109 6.8 76 7.1 55.5 27.6s-20.8 53.5-.7 73.7l152.5 152.5L54.8 406.2c-20.2 20.2-19.9 53.2.6 73.7s53.5 20.8 73.7.6l190-190c10.1-10.1 15.1-23.4 15-36.8.1-13.3-4.9-26.6-15-36.7z'/%3E%3C/svg%3E");
+  }
+
+  &:after {
+    margin-left: 0.2em;
+  }
+
+  &:hover, &.animating
+  {
+    &:before, &:after {
+      animation-name: bounceAlpha;
+      animation-duration:1.4s;
+      animation-iteration-count:infinite;
+      animation-timing-function:linear;
+    }
+    &:before {
+      animation-delay:0.2s;
+    }
+  }
+}
+
+@keyframes bounceAlpha {
+  0% {opacity: 1; transform: translateX(0) scale(1);}
+  25%{opacity: 0; transform:translateX(0.125em) scale(0.9);}
+  26%{opacity: 0; transform:translateX(-0.125em) scale(0.9);}
+  55% {opacity: 1; transform: translateX(0) scale(1);}
+}
index 836a2330a00b2a3f45f77cfc5e0b7043983eddf8..0a3010af8d9e75065ebf75d83a46bc0d3387e35c 100644 (file)
@@ -22,7 +22,7 @@ img.responsive {
 }
 
 body {
-       background-color: #e4e5ec;
+       background-color: #fafafa;
        font-family: @roboto;
        font-size: 18px;
        font-weight: 300;
diff --git a/less/link-arrow.less b/less/link-arrow.less
new file mode 100644 (file)
index 0000000..1c97668
--- /dev/null
@@ -0,0 +1,186 @@
+// Animated arrow links based on https://codepen.io/nicoencarnacion/pen/XpaRQV
+
+@import "00-constants";
+
+// Variables
+@black: #666;
+@hover-color: @yellow;
+
+@text-arrow-space: 10px;
+@shaft-width: 40px;
+@shaft-thickness: 1px;
+@arrow-head-width: 8px;
+@arrow-head-thickness: @shaft-thickness;
+
+
+// Todo: check why colour of right-hand arrow is glitchy on mouseout. See original codepen - maybe related to using currentColor...
+
+
+// The Arrow
+.the-arrow {
+  width: @shaft-width;
+  transition: all 0.2s;
+
+  &.-left {
+    position: absolute;
+    top: 60%;
+    left: 0;
+
+    > .shaft {
+      width: 0;
+      background-color: currentColor;
+
+      &:before,
+      &:after {
+        width: 0;
+        background-color: currentColor;
+      }
+
+      &:before {
+        transform: rotate(0);
+      }
+
+      &:after {
+        transform: rotate(0);
+      }
+    }
+  }
+
+  &.-right {
+    top: 3px;
+
+    > .shaft {
+      width: @shaft-width;
+      transition-delay: 0.2s;
+
+      &:before,
+      &:after {
+        width: @arrow-head-width;
+        transition-delay: 0.3s;
+        transition: all 0.5s;
+      }
+
+      &:before {
+        transform: rotate(40deg);
+      }
+
+      &:after {
+        transform: rotate(-40deg);
+      }
+    }
+  }
+
+  > .shaft {
+    background-color: currentColor;
+    display: block;
+    height: @shaft-thickness;
+    position: relative;
+    transition: all 0.2s;
+    transition-delay: 0;
+    will-change: transform;
+
+    &:before,
+    &:after {
+      background-color: currentColor;
+      content: '';
+      display: block;
+      height: @arrow-head-thickness;
+      position: absolute;
+      top: 0;
+      right: 0;
+      transition: all 0.2s;
+      transition-delay: 0;
+    }
+
+    &:before {
+      transform-origin: top right;
+    }
+
+    &:after {
+      transform-origin: bottom right;
+    }
+  }
+}
+
+
+
+// Animated Arrow Button
+
+.animated-arrow {
+  display: inline-block;
+  //color: currentColor;
+  //font-size: 1.25em;
+  //font-style: italic;
+  //text-decoration: none;
+  position: relative;
+  transition: all 0.2s;
+
+  &:hover {
+    color: @hover-color;
+
+    > .the-arrow.-left {
+      > .shaft {
+        width: @shaft-width;
+        transition-delay: 0.1s;
+        background-color: @hover-color;
+
+        &:before,
+        &:after {
+          width: @arrow-head-width;
+          transition-delay: 0.1s;
+          background-color: @hover-color;
+        }
+
+        &:before {
+          transform: rotate(40deg);
+        }
+
+        &:after {
+          transform: rotate(-40deg);
+        }
+      }
+    }
+
+    > .main {
+      transform: translateX(@shaft-width + @text-arrow-space);
+
+      > .the-arrow.-right {
+        > .shaft {
+          width: 0;
+          transform: translateX(200%);
+          transition-delay: 0;
+
+          &:before,
+          &:after {
+            width: 0;
+            transition-delay: 0;
+            transition: all 0.1s;
+          }
+
+          &:before {
+            transform: rotate(0);
+          }
+
+          &:after {
+            transform: rotate(0);
+          }
+        }
+      }
+    }
+  }
+
+  > .main {
+    display: flex;
+    align-items: center;
+    transition: all 0.2s;
+
+    > .text {
+      margin: 0 @text-arrow-space 0 0;
+      line-height: 1;
+    }
+
+    > .the-arrow {
+      position: relative;
+    }
+  }
+}