From bd97939062e4bb1cf806c06578d286361b98c820 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 23 May 2020 14:08:35 +0200 Subject: [PATCH] Move homepage "register here" CTA to bottom of screen. The CTA breaks the layout when the new cart sidebar is open. I can't see a nice way to keep it at the top without making a mess. --- .../darkswarm/directives/page_alert.js.coffee | 4 ++-- .../directives/smooth_scroll_to.js.coffee | 1 - .../stylesheets/darkswarm/page_alert.css.scss | 17 ++++++++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee b/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee index a3858444ae..666daaec64 100644 --- a/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee @@ -14,8 +14,8 @@ Darkswarm.directive "ofnPageAlert", ($timeout) -> # Wait a moment after page load before showing the alert. Otherwise we often miss the # start of the animation. $timeout -> - container_elems.addClass("move-down") + container_elems.addClass("move-up") , 1000 scope.close = -> - container_elems.removeClass("move-down") + container_elems.removeClass("move-up") diff --git a/app/assets/javascripts/darkswarm/directives/smooth_scroll_to.js.coffee b/app/assets/javascripts/darkswarm/directives/smooth_scroll_to.js.coffee index c3bcc9590d..34552016c4 100644 --- a/app/assets/javascripts/darkswarm/directives/smooth_scroll_to.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/smooth_scroll_to.js.coffee @@ -10,6 +10,5 @@ Darkswarm.directive "ofnSmoothScrollTo", ($location, $document)-> # Scrolling is confused by our position:fixed top bar and page alert bar # - add an offset to scroll to the correct location, plus 5px buffer offset = $("nav.top-bar").height() - offset += $(".page-alert.move-down").height() offset += 5 $document.scrollTo target, offset, 1000 diff --git a/app/assets/stylesheets/darkswarm/page_alert.css.scss b/app/assets/stylesheets/darkswarm/page_alert.css.scss index a9276ab56d..08f35944c9 100644 --- a/app/assets/stylesheets/darkswarm/page_alert.css.scss +++ b/app/assets/stylesheets/darkswarm/page_alert.css.scss @@ -55,19 +55,18 @@ $page-alert-height: 55px; .off-canvas-fixed nav.tab-bar, .off-canvas-fixed .page-alert { @include transition(all 1000ms ease-in-out); - - &.move-down { - margin-top: $page-alert-height; - } } .off-canvas-wrap .page-alert { - top: -1 * $page-alert-height; + bottom: -1 * $page-alert-height; + top: unset; z-index: 100; -} -.off-canvas-wrap.move-right .inner-wrap.move-down { - .left-off-canvas-menu { - top: -1 * $page-alert-height; + &.move-up { + bottom: 0; + } + + .alert-box { + border-bottom: 0; } }