]> _ Git - c6-wordpress.git/commitdiff
Pre-launch adjustments. WIP #2684 @2
authorStephen Cameron <stephen@cubedesigners.com>
Mon, 13 May 2019 09:28:57 +0000 (11:28 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Mon, 13 May 2019 09:28:57 +0000 (11:28 +0200)
wp-content/mu-plugins/cube/src/Elementor/Widgets/Timeline.php
wp-content/themes/c6/resources/assets/scripts/timeline.js
wp-content/themes/c6/resources/assets/styles/common/mixins.styl
wp-content/themes/c6/resources/assets/styles/common/variables.styl
wp-content/themes/c6/resources/assets/styles/widgets/timeline.styl

index 98c6c3741025e59167c0627ba27264dcafef02e9..0c61a958c0891d0d53727e9e7a20de8ae0c02957 100644 (file)
@@ -127,20 +127,17 @@ class Timeline extends Widget_Base
      */
     protected function render() {
 
+        $items = $this->get_settings('items');
+
         // Rendered content
         $res = '<div class="timeline-wrapper">';
-        $res .= '<div class="year">';
-        $items = $this->get_settings('items');
-        $res .= '<nav id="timeline-nav">';
+        $res .= '<nav class="timeline-nav" id="timeline-nav">';
         foreach ($items as $index => $item) {
-
             $arr = explode(' ', trim($item['year'])); // select the first word
-            $res .= '<a class="year-item" href="#year-' . $index . '">' . $arr[0] . '</a>';
-
+            $res .= '<a class="timeline-nav-item" href="#year-' . $index . '">' . $arr[0] . '</a>';
         }
         $res .= '</nav>';
-        $res .= '</div>'; // .year
-        $res .= '<div class="timeline">';
+        $res .= '<div class="timeline-content">';
 
         foreach ($items as $index => $item) {
 
index 92310558edf34f549b027de9a6c557762d0ddc84..6b2d2d5b872ce32c801c636017d0534ceced3042 100644 (file)
@@ -3,5 +3,5 @@ import scrollSpy from 'simple-scrollspy';
 scrollSpy('#timeline-nav', {
     offset: -200,
     sectionClass: '.timeline-item',
-    menuActiveTarget: '.year-item',
+    menuActiveTarget: '.timeline-nav-item',
 });
index 49271e356d8e3a5703d4114c5f0a706f68216e7a..596879779cd005587bbce5807165cdde78543de1 100644 (file)
@@ -12,6 +12,15 @@ constrain(property, value = $horizontal-gutter, max-width = $content-max-width)
       {property}: $max
     }
   }
+
+  // Prevent vw / % units from getting too small
+  +below(750px) {
+    // Only do this if we are dealing with a percentage or vw unit
+    if (unit(value) is '%' || unit(value) is 'vw') {
+      $min = 750px * unit(value / 100, '') // Convert percentage to a decimal
+      {property}: $min
+    }
+  }
 }
 
 // Apply percentage based vertical padding - defaults to global gutter value if nothing passed
index c1b896e95205702e1fa9a134e45515fd9717fc2e..426499408193f98132e9c255903d2a11f035f9d0 100644 (file)
@@ -26,7 +26,7 @@ rupture.scale        = 0 400px   768px   1024px
 rupture.scale-names  = 'small' 'medium' 'large'
 rupture.anti-overlap = -1px // Results in +below(1000px) being max-width: 999px and +above(1000px) being min-width: 1000px
 $breakpoint-columns  = 900px
-$breakpoint-menu     = 768px
+$breakpoint-menu     = 850px
 
 // Lost Grid setup (mostly used for Products)
 @lost gutter 5%
index db03155a031cfe4976eb7e16d7bdf543a53e970a..90183e4605f3b4ea03a36b7c074301616d8534de 100644 (file)
@@ -4,34 +4,49 @@
   display: flex
   justify-content: center
 
-.year
-  position: sticky
-  align-self flex-start
-  top: 149px
-  width: 144px
-  @media (max-width: 425px)
-    display: none
-  &-item
-    display: block
-    margin-bottom: 1.5em
-    &.active
-      font-size: $font-size.medium
-      color: $colors.orange
-
 .timeline
-  padding-right: 144px
-  @media (max-width: 1080px)
-    padding-right 0
+  &-nav
+    position: sticky
+    align-self: flex-start
+    top: 149px
+    flex: 0 0 144px
+
+    +below(1080px)
+      flex-basis: 100px
+
+    +below(650px)
+      display: none
+
+    &-item
+      display: block
+      margin-bottom: 1.5em
+      &:hover
+        color: $colors.orange
+      //&.active
+      //  font-size: $font-size.medium
+      //  color: $colors.orange
+
+  &-content
+    padding-right: 144px
+    +below(1080px)
+      padding-right: 0
   &-item
-    margin-bottom: 96px
+    constrain(margin-bottom, 5vw)
     max-width: 960px
     &-year
       margin-bottom: 0.8888em
+      +below('medium')
+        font-size: 40px
+
     &-title
       font-size: $font-size.large
       margin-bottom: 1.333em
+      +below('medium')
+        font-size: 28px
+
     &-img
-      margin-bottom: 48px
+      display: block
+      constrain(margin-bottom, 2.5vw)
     &-body
       p
         margin-bottom: 3em
         font-size: $font-size.medium
         font-weight: lighter
         margin-bottom: 1em
-        margin-top: 2em
+        constrain(margin-top, 2.5vw)
       h3
         font-size: $font-size.large
         font-weight: lighter
         margin-bottom 1.33em
+        +below('medium')
+          font-size: 28px
+
       ul
         list-style none
         margin-left: 0.35em