From 046685149ad70299ce048a3ae5a40f57acaa320d Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Fri, 11 Feb 2022 12:38:22 +0000 Subject: [PATCH] Add new version fo Wagtail Space docs banner. Fix #6089 (#7956) * Add new version fo Wagtail Space docs banner. Fix #6089 * Fix closing date Co-authored-by: Matt Westcott --- docs/_static/css/custom.css | 39 ++++++++++++++----------------------- docs/_static/js/banner.js | 27 ++++++++++++------------- docs/_templates/layout.html | 1 + docs/conf.py | 1 - 4 files changed, 30 insertions(+), 38 deletions(-) diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css index 041feafcbb..bab8d0d2e9 100644 --- a/docs/_static/css/custom.css +++ b/docs/_static/css/custom.css @@ -53,12 +53,11 @@ details { } /* Wagtail Space */ -a.wagtailspace { +.wagtailspace { background: #00676a; color: white; - padding: 15px; border-radius: 6px; - margin-bottom: 1.25em; + margin-bottom: 2em; display: flex; justify-content: space-between; align-items: flex-start; @@ -69,34 +68,31 @@ a.wagtailspace { width: 56px; } -.wagtailspace div { +.wagtailspace a { + display: flex; + color: inherit; + padding: 15px; text-align: left; flex-grow: 2; + border: 0; } .wagtailspace strong { font-size: 1.25em; } -.wagtailspace .close { - margin-left: 1em; - margin-bottom: 1em; +.wagtailspace .wagtailspace-close { + padding: 10px; + width: 56px; cursor: pointer; font-weight: bold; - font-size: 1.25em; + font-size: 1.5em; + color: inherit; + border: 0; + background: none; } /* Bounce the UFO on hover */ -@-webkit-keyframes bounce { - 0%, - 100% { - -webkit-transform: translateY(0); - } - 50% { - -webkit-transform: translateY(-5px); - } -} - @keyframes bounce { 0%, 100% { @@ -107,15 +103,10 @@ a.wagtailspace { } } -a.wagtailspace:hover svg { - -webkit-animation-duration: 0.5s; +.wagtailspace a:hover svg { animation-duration: 0.5s; - -webkit-animation-fill-mode: both; animation-fill-mode: both; - -webkit-animation-timing-function: linear; animation-timing-function: linear; animation-iteration-count: infinite; - -webkit-animation-iteration-count: infinite; - -webkit-animation-name: bounce; animation-name: bounce; } diff --git a/docs/_static/js/banner.js b/docs/_static/js/banner.js index 3f9da613c2..3bbf0ebcc1 100644 --- a/docs/_static/js/banner.js +++ b/docs/_static/js/banner.js @@ -14,23 +14,24 @@ function hasCookie(name, value) { } $(() => { - const $wagtailspace = $( - '' + - ' ' + - '
' + - ' Wagtail Space
13 – 15 March 2019 Arnhem, The Netherlands' + - '
' + - ' ×' + - '
', - ); + const $wagtailspace = $(` + + `); if ( !hasCookie('wagtailspaceClosed', 'true') && - new Date() < new Date(2019, 2, 15) + new Date() < new Date(2022, 2, 26) ) { - $('.wy-nav-content').prepend($wagtailspace); - $wagtailspace.find('.close').click((e) => { - e.preventDefault(); + $('main').prepend($wagtailspace); + $wagtailspace.find('.wagtailspace-close').click(() => { setCookie('wagtailspaceClosed', 'true', 30); $wagtailspace.detach(); }); diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 22e6132856..44881ff3df 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -6,6 +6,7 @@ {% block extrahead %} + {% endblock %} {% block search %} diff --git a/docs/conf.py b/docs/conf.py index 6f4a5c1e23..ef4e5d614c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -309,7 +309,6 @@ texinfo_documents = [ def setup(app): - app.add_css_file('css/custom.css') app.add_js_file('js/banner.js') github_doc_root = 'https://github.com/wagtail/wagtail/tree/main/docs/'