From 7e2906b0a0d0867399e749b4d6245352359b5ba1 Mon Sep 17 00:00:00 2001 From: misha Date: Wed, 27 Mar 2019 00:16:40 +0100 Subject: [PATCH 1/3] logo link to home and footer with back to top button --- pyconbalkan/core/static/css/components/page.css | 3 ++- pyconbalkan/core/static/css/main.css | 5 +++++ pyconbalkan/core/templates/base.html | 6 +++++- pyconbalkan/core/templates/includes/event_sidebar.html | 2 +- pyconbalkan/core/templates/includes/footer.html | 5 +++++ pyconbalkan/info/templates/info.html | 7 ------- pyconbalkan/speaker/templates/speakers.html | 3 +++ 7 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 pyconbalkan/core/templates/includes/footer.html diff --git a/pyconbalkan/core/static/css/components/page.css b/pyconbalkan/core/static/css/components/page.css index 5acc2b0e..049cd083 100644 --- a/pyconbalkan/core/static/css/components/page.css +++ b/pyconbalkan/core/static/css/components/page.css @@ -7,7 +7,8 @@ grid-template-areas: ". logo ." "menu menu menu" - "sidebar main main"; + "sidebar main main" + "footer"; grid-template-rows: 240px 60px auto; grid-template-columns: 1fr 1fr 1fr; grid-gap: 20px; diff --git a/pyconbalkan/core/static/css/main.css b/pyconbalkan/core/static/css/main.css index d5829a57..7b3012f9 100644 --- a/pyconbalkan/core/static/css/main.css +++ b/pyconbalkan/core/static/css/main.css @@ -61,6 +61,7 @@ ul li { background-size: contain; background-repeat: no-repeat; background-position: center; + z-index: 1000; } .coming-soon { @@ -83,6 +84,10 @@ ul li { overflow: hidden; } +footer { + grid-area: footer; +} + #bgVideo { position: fixed; right: 0; diff --git a/pyconbalkan/core/templates/base.html b/pyconbalkan/core/templates/base.html index b80280b3..c64dde21 100644 --- a/pyconbalkan/core/templates/base.html +++ b/pyconbalkan/core/templates/base.html @@ -83,9 +83,13 @@ {% block main_content %}{% endblock %} + {% include 'includes/footer.html' %} + - {% block scripts %}{% endblock %} + {% block scripts %} + + {% endblock %} diff --git a/pyconbalkan/core/templates/includes/event_sidebar.html b/pyconbalkan/core/templates/includes/event_sidebar.html index ec35b416..9a71b2cc 100644 --- a/pyconbalkan/core/templates/includes/event_sidebar.html +++ b/pyconbalkan/core/templates/includes/event_sidebar.html @@ -30,6 +30,6 @@

#{{ request.conference.number }}

Supported by

{% for sidebar_sponsor in sidebar_sponsors %} -
+
{% endfor %} diff --git a/pyconbalkan/core/templates/includes/footer.html b/pyconbalkan/core/templates/includes/footer.html new file mode 100644 index 00000000..e8564bc2 --- /dev/null +++ b/pyconbalkan/core/templates/includes/footer.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/pyconbalkan/info/templates/info.html b/pyconbalkan/info/templates/info.html index 93b77140..d2940808 100644 --- a/pyconbalkan/info/templates/info.html +++ b/pyconbalkan/info/templates/info.html @@ -133,14 +133,7 @@

Nikola Tesla Museum

-
- Back to top -
{% endblock %} - -{% block scripts %} - -{% endblock %} diff --git a/pyconbalkan/speaker/templates/speakers.html b/pyconbalkan/speaker/templates/speakers.html index ac2d4c2d..67daacb5 100644 --- a/pyconbalkan/speaker/templates/speakers.html +++ b/pyconbalkan/speaker/templates/speakers.html @@ -44,6 +44,9 @@

{{ presentation.title }}

{% endfor %} +
+ Back to top +
{% else %}

Coming Soon From 7be1b476b9eff12bd51f35a28fe087b0a7400199 Mon Sep 17 00:00:00 2001 From: misha Date: Thu, 28 Mar 2019 00:07:31 +0100 Subject: [PATCH 2/3] fix grid template areas --- pyconbalkan/core/static/css/components/page.css | 4 ++-- pyconbalkan/core/static/css/main.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyconbalkan/core/static/css/components/page.css b/pyconbalkan/core/static/css/components/page.css index 049cd083..b07832f6 100644 --- a/pyconbalkan/core/static/css/components/page.css +++ b/pyconbalkan/core/static/css/components/page.css @@ -6,9 +6,9 @@ margin: 0 auto; grid-template-areas: ". logo ." - "menu menu menu" + "menu menu menu" "sidebar main main" - "footer"; + ". footer ."; grid-template-rows: 240px 60px auto; grid-template-columns: 1fr 1fr 1fr; grid-gap: 20px; diff --git a/pyconbalkan/core/static/css/main.css b/pyconbalkan/core/static/css/main.css index 7b3012f9..c0c7e184 100644 --- a/pyconbalkan/core/static/css/main.css +++ b/pyconbalkan/core/static/css/main.css @@ -61,7 +61,7 @@ ul li { background-size: contain; background-repeat: no-repeat; background-position: center; - z-index: 1000; + /*z-index: 1000;*/ } .coming-soon { From 93753f091d940f7924f16fa5e55b34e9ec79af60 Mon Sep 17 00:00:00 2001 From: misha Date: Thu, 28 Mar 2019 23:35:46 +0100 Subject: [PATCH 3/3] hide button when on top --- pyconbalkan/core/static/css/main.css | 14 ++++++++++++++ pyconbalkan/core/static/js/go_to_top.js | 13 ++++++++++++- pyconbalkan/core/templates/includes/footer.html | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pyconbalkan/core/static/css/main.css b/pyconbalkan/core/static/css/main.css index c0c7e184..6ffdc2d4 100644 --- a/pyconbalkan/core/static/css/main.css +++ b/pyconbalkan/core/static/css/main.css @@ -86,6 +86,20 @@ ul li { footer { grid-area: footer; + /*width: 100%;*/ +} + +#totop { + display: none; +} + +.hide { + opacity:0; + left:-100%; +} +.show { + opacity:1; + left:0; } #bgVideo { diff --git a/pyconbalkan/core/static/js/go_to_top.js b/pyconbalkan/core/static/js/go_to_top.js index 808dff9d..af472074 100644 --- a/pyconbalkan/core/static/js/go_to_top.js +++ b/pyconbalkan/core/static/js/go_to_top.js @@ -1,4 +1,15 @@ function topFunction() { document.body.scrollTop = 0; document.documentElement.scrollTop = 0; -} \ No newline at end of file +} + +// When the user scrolls down 20px from the top of the document, show the button +window.onscroll = function() {scrollFunction()}; + +function scrollFunction() { + if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { + document.getElementById("totop").style.display = "inline-block"; + } else { + document.getElementById("totop").style.display = "none"; + } +} diff --git a/pyconbalkan/core/templates/includes/footer.html b/pyconbalkan/core/templates/includes/footer.html index e8564bc2..0fd4caf1 100644 --- a/pyconbalkan/core/templates/includes/footer.html +++ b/pyconbalkan/core/templates/includes/footer.html @@ -1,5 +1,5 @@ \ No newline at end of file