]> _ Git - usines-reunies.git/commitdiff
WIP #4064 @11
authorStephen Cameron <stephen@cubedesigners.com>
Thu, 24 Dec 2020 19:12:57 +0000 (20:12 +0100)
committerStephen Cameron <stephen@cubedesigners.com>
Thu, 24 Dec 2020 19:12:57 +0000 (20:12 +0100)
12 files changed:
web/app/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php
web/app/themes/Usines/app/helpers.php
web/app/themes/Usines/index.php
web/app/themes/Usines/resources/assets/styles/common/global.styl
web/app/themes/Usines/resources/assets/styles/common/layout.styl
web/app/themes/Usines/resources/assets/styles/components/buttons.styl [new file with mode: 0644]
web/app/themes/Usines/resources/assets/styles/components/sections.styl
web/app/themes/Usines/resources/views/archive-realisation.blade.php [new file with mode: 0644]
web/app/themes/Usines/resources/views/index.blade.php
web/app/themes/Usines/resources/views/partials/header.blade.php
web/app/themes/Usines/resources/views/widgets/intro-carousel.blade.php
web/app/themes/Usines/webpack.mix.js

index d42e2a6f534319802ca142088f1e798e8c0652e7..26cfb22124ca7cd2c4d2c25faa2234d938c87af4 100644 (file)
@@ -267,9 +267,9 @@ class TextBlock extends _Base {
         $this->add_inline_editing_attributes('cta_text', 'none');
 
         // CSS Classes for elements
-        $this->add_render_attribute('title', 'class', ["text-block-title $title_size"]);
+        $this->add_render_attribute('title', 'class', ["text-block-title font-semibold $title_size"]);
         $this->add_render_attribute('body', 'class', ['text-block-body']);
-        $this->add_render_attribute('cta_text', 'class', ['text-block-cta btn inline-block bg-red text-white py-2 px-4 rounded-full hover:bg-blue hover:text-white']);
+        $this->add_render_attribute('cta_text', 'class', ['text-block-cta btn']);
 
         // Rendered content
         echo '<div class="text-block">';
@@ -297,7 +297,7 @@ class TextBlock extends _Base {
 
         var title_size = (settings.title_size == '') ? 'text-xl' : settings.title_size;
 
-        view.addRenderAttribute( 'title', 'class', ['text-block-title '+ title_size]);
+        view.addRenderAttribute( 'title', 'class', ['text-block-title font-semibold '+ title_size]);
         view.addRenderAttribute( 'body', 'class', ['text-block-body']);
         view.addRenderAttribute( 'cta_text', 'class', ['text-block-cta btn']);
 
index 0583e0dc07db6ce6ae492a5f440eb1c9424cc66e..891ada26fd90f458f580e42867500033ac6b2e36 100644 (file)
@@ -9,11 +9,30 @@ namespace App;
 // Grid overlay helper, activated when DEBUG_GRID is defined as true
 if (env('DEBUG_GRID') || isset($_GET['debug-grid'])) {
     add_action('wp_footer', function () {
-        $css  = 'background-size: 2.5vw 2.5vw;';
-        $css .= 'background-image: linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px);';
-        $css .= 'opacity: 0.3;';
-        $css .= 'pointer-events: none; position: fixed; top: 0; left: 0; height: 100%; width: 100%; z-index: 9990;';
-        echo "<div id='debugGrid' style='$css'></div>";
+        echo "<div id='debugGrid'></div>";
+        echo '<style>
+                #debugGrid { 
+                    background-size: 2.5vw 2.5vw;
+                    background-image: linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px);
+                    opacity: 0.3;
+                    pointer-events: none;
+                    position: fixed;
+                    top: 0;
+                    left: 0;
+                    height: 100%;
+                    width: 100%;
+                    z-index: 9990; 
+                }
+
+                @media (min-width: 1920px) { 
+                    #debugGrid { 
+                        background-size: 48px 48px;
+                        max-width: 1921px;
+                        left: 50%;
+                        transform: translateX(-50%); 
+                    } 
+                }
+              </style>';
     });
 }
 
index 5028d8f6e862c30db4ac52c04e418c5d5746c39a..355582571b35f83011df265177eb818a8b78c67c 100644 (file)
@@ -10,7 +10,7 @@
     <link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;1,400&display=swap" rel="stylesheet">
   </head>
 
-  <body <?php body_class('font-body text-dark'); ?>>
+  <body <?php body_class('font-body text-dark overflow-x-hidden'); ?>>
     <?php wp_body_open(); ?>
     <?php do_action('get_header'); ?>
 
index 04176e662bb99a77cf44b9bf110e51c8eddb03f4..b5dc881a0489f9f098d617bb6727728fcfff10eb 100644 (file)
@@ -7,6 +7,9 @@ body
 a
   @apply transition-colors unquote('hover:text-red')
 
+img
+  .rounded-full & // So this can be applied to parent element and also to override Elementor default CSS
+    border-radius: 999px
 
 p:not(:last-child)
   margin-bottom: 1.5em
index 577091d41e70d5e3e721c9b56fc8ea5813d32c44..4e48a1890565eb0ebea3830c3fb846bf0db803f5 100644 (file)
@@ -7,7 +7,10 @@
   height: 100%
   align-content: center
 
-.container,
+.container
+  center($base-width)
+
+.container-content,
 .elementor-section-boxed > .elementor-container
   center($content-max-width)
 
diff --git a/web/app/themes/Usines/resources/assets/styles/components/buttons.styl b/web/app/themes/Usines/resources/assets/styles/components/buttons.styl
new file mode 100644 (file)
index 0000000..ec3a80c
--- /dev/null
@@ -0,0 +1,36 @@
+// Buttons
+
+.btn,
+.elementor-widget-button a.elementor-button
+  @apply relative inline-block overflow-hidden
+  @apply bg-red text-white rounded-full
+  @apply px-4 py-2
+  font-smoothing()
+  transition: background-color 0.25s
+
+  &:hover
+    @apply bg-blue text-white
+
+  // Button sizes
+  &.elementor-size-sm
+    @apply text-sm
+  &.elementor-size-md
+    @apply text-base
+  &.elementor-size-lg
+    @apply text-lg
+  &.elementor-size-xl
+    @apply text-xl
+
+// Button styles
+.elementor-element.elementor-button-info .elementor-button
+  @apply bg-teal
+
+// Icons inside buttons
+.elementor-button-content-wrapper
+  @apply flex items-center
+
+.elementor-button-icon
+  svg
+    width: auto
+    height: 1em
+
index bb8da72f8098b32e3415ca34cfb7f757ab19866e..9e28c96f72c76c11eead8aadd860bec9ced4b4ef 100644 (file)
 //--- Reversed layout
 // Handle column swapping when layout reversed toggle is set
 .layout-reversed
-  .elementor-row
+  .elementor-container
     flex-direction: row-reverse
+
+
+//--- Layered Backgrounds
+// When the columns fold, layered backgrounds fill full section (applicable to coloured backgrounds)
++below($breakpoint-columns)
+  .layered-backgrounds > *
+    width: 100% !important
+    top: 0 !important
+    left: 0 !important
+    right: 0 !important
+    bottom: 0 !important
+    margin: 0 !important
+    transform: none !important
diff --git a/web/app/themes/Usines/resources/views/archive-realisation.blade.php b/web/app/themes/Usines/resources/views/archive-realisation.blade.php
new file mode 100644 (file)
index 0000000..a2cb98b
--- /dev/null
@@ -0,0 +1,31 @@
+@extends('layouts.app')
+
+@section('content')
+
+
+  <div class="container-content py-2v px-1v">
+
+    {{-- TODO !
+
+      @if (! have_posts())
+        @alert(['type' => 'warning'])
+        {{ __('Sorry, no results were found.', 'sage') }}
+        @endalert
+
+        {!! get_search_form(false) !!}
+      @endif
+
+      @while (have_posts()) @php(the_post())
+      @includeFirst(['partials.content-'.get_post_type(), 'partials.content'])
+      @endwhile
+
+      {!! get_the_posts_navigation() !!}
+
+      --}}
+
+  </div>
+@endsection
+
+@section('sidebar')
+  @include('partials.sidebar')
+@endsection
index 4e0e06537130365f82a8da9589d3ed9562339602..506ba6bcfea3fa6a549e9e06620ab0a2612e5129 100644 (file)
@@ -1,21 +1,29 @@
 @extends('layouts.app')
 
 @section('content')
-  @include('partials.page-header')
 
-  @if (! have_posts())
-    <x-alert type="warning">
-      {!! __('Sorry, no results were found.', 'sage') !!}
-    </x-alert>
+  <div class="container-content py-2v px-1v">
 
-    {!! get_search_form(false) !!}
-  @endif
+    {{-- TODO !
 
-  @while(have_posts()) @php(the_post())
-    @includeFirst(['partials.content-' . get_post_type(), 'partials.content'])
-  @endwhile
+    @if (! have_posts())
+      <x-alert type="warning">
+        {!! __('Sorry, no results were found.', 'sage') !!}
+      </x-alert>
+
+      {!! get_search_form(false) !!}
+    @endif
+
+    @while(have_posts()) @php(the_post())
+      @includeFirst(['partials.content-' . get_post_type(), 'partials.content'])
+    @endwhile
+
+    {!! get_the_posts_navigation() !!}
+
+    --}}
+
+  </div>
 
-  {!! get_the_posts_navigation() !!}
 @endsection
 
 @section('sidebar')
index b6db07beaeab655b6018cdf60e8188c1504eba0e..1047c5a6a7c2b49878948ad64ddb4931cdbff4f2 100644 (file)
@@ -1,4 +1,4 @@
-<header class="relative flex items-end justify-center mx-1v pt-6">
+<header class="container w-full relative flex items-end justify-center px-1v pt-6">
 
   {{-- Primary nav (left) --}}
   <div class="flex-1 flex justify-end mb-4">
@@ -41,7 +41,7 @@
     </div>
   </div>
 
-  <a href="{{ $contact_phone_link }}" class="absolute right-0 top-1/2 transform -translate-y-1/2 flex items-center pb-12 sm:hidden">
+  <a href="{{ $contact_phone_link }}" class="absolute right-0 mr-1v top-1/2 transform -translate-y-1/2 flex items-center pb-12 sm:hidden">
     <span class="font-semibold text-right text-sm">
       {{ get_option('contact_header_text') }}<br/>
       <span class="text-lg">{{ $contact_phone }}</span>
index 657355e220e0c910e0ddbd7d4a1ba8f7fef138e6..008bb5d34a6865ce0151a9efa19182f6816a64d0 100644 (file)
@@ -8,14 +8,14 @@
         <span class="absolute block bg-beige" style="top: -0.1em; bottom: -0.15em; left: -0.325em; width: 36%; z-index: -1"></span>
       </h1>
       <div class="leading-loose">{{ $body }}</div>
-      <a href="{{ $cta_link }}" class="btn inline-block bg-red text-white py-2 px-4 mt-6 rounded-full hover:bg-blue hover:text-white">{{ $cta_text }}</a>
+      <a href="{{ $cta_link }}" class="btn">{{ $cta_text }}</a>
     </div>
   </div>
 
   <div class="intro-carousel-slides" style="flex-basis: 60%">
     <div class="intro-carousel-slides-sizer relative ml-1v" style="padding-bottom: 71.287%">
       @foreach ($slides as $slide)
-        <div class="intro-carousel-slide absolute top-0 left-0 w-full h-full @if($loop->first)hidden @endif">
+        <div class="intro-carousel-slide absolute top-0 left-0 w-full h-full @if(!$loop->first)hidden @endif">
           <img src="{{ $slide['background_image']['url'] }}" class="absolute top-0 right-0">
           <img src="{{ $slide['image']['url'] }}" class="absolute" style="border-radius: 999px; max-width: 69.475%; top: 2.35%; right: 4.575%">
           <div class="intro-carousel-slide-caption">{{ $caption }}</div>
index 3feb3496f37a50bc2f16a0f43d6df958ff660e18..8510310052f9611e0e1dfb799b0fdc36a63a5a60 100644 (file)
@@ -36,6 +36,7 @@ mix.stylus('resources/assets/styles/editor.styl', 'styles');
 // Javascript
 mix
   .js('resources/assets/scripts/app.js', 'scripts')
+  .js('resources/assets/scripts/intro-carousel.js', 'scripts')
   .js('resources/assets/scripts/customizer.js', 'scripts')
   .blocks('resources/assets/scripts/editor.js', 'scripts')
   .extract();