diff options
author | ng0 <ng0@n0.is> | 2019-11-17 15:39:52 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-11-17 15:39:52 +0000 |
commit | f03141ac42d6c80084161cc5e595bc492e85b4f1 (patch) | |
tree | 9f7556b3f7f68913ebdd53d807d1feee1208274e | |
parent | 7b4bb87512d0296db97b6bee88ac03fcdd7a09e8 (diff) | |
download | www-f03141ac42d6c80084161cc5e595bc492e85b4f1.tar.gz www-f03141ac42d6c80084161cc5e595bc492e85b4f1.zip |
remove sticky attribute of navbar, add first rough "jump to top" button (needs improvement!)
-rw-r--r-- | GNUmakefile | 2 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | common/base.j2 | 6 | ||||
-rw-r--r-- | common/footer.j2.inc | 5 | ||||
-rw-r--r-- | common/header.j2.inc | 5 | ||||
-rw-r--r-- | common/navigation.j2.inc | 2 | ||||
-rw-r--r-- | common/news.j2 | 3 | ||||
-rw-r--r-- | static/scroll.css | 49 | ||||
-rw-r--r-- | static/scroll.js | 12 |
9 files changed, 82 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile index 7265c5e6..ffe9c281 100644 --- a/GNUmakefile +++ b/GNUmakefile | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | include config.mk | 20 | include config.mk |
21 | 21 | ||
22 | all: css locale template | 22 | all: locale template |
23 | ($(cp) rendered/static/robots.txt rendered/robots.txt) | 23 | ($(cp) rendered/static/robots.txt rendered/robots.txt) |
24 | ($(cp) rendered/static/stage.robots.txt rendered/stage.robots.txt) | 24 | ($(cp) rendered/static/stage.robots.txt rendered/stage.robots.txt) |
25 | ($(cp) rendered/static/robots.txt rendered/dist/robots.txt) | 25 | ($(cp) rendered/static/robots.txt rendered/dist/robots.txt) |
@@ -20,7 +20,7 @@ _DIRLIST= dist static | |||
20 | 20 | ||
21 | # All: build HTML pages in all languages and compile the | 21 | # All: build HTML pages in all languages and compile the |
22 | # TypeScript logic in web-common. | 22 | # TypeScript logic in web-common. |
23 | all: css locale template | 23 | all: locale template |
24 | .for _lang in ${_LOCALELIST} | 24 | .for _lang in ${_LOCALELIST} |
25 | ($(cp) rendered/static/robots.txt rendered/${_lang}) | 25 | ($(cp) rendered/static/robots.txt rendered/${_lang}) |
26 | ($(cp) rendered/static/stage.robots.txt rendered/${_lang}) | 26 | ($(cp) rendered/static/stage.robots.txt rendered/${_lang}) |
diff --git a/common/base.j2 b/common/base.j2 index 70034222..f82e4f27 100644 --- a/common/base.j2 +++ b/common/base.j2 | |||
@@ -10,7 +10,11 @@ | |||
10 | <body id="mybody"> | 10 | <body id="mybody"> |
11 | {% include "common/navigation.j2.inc" %} | 11 | {% include "common/navigation.j2.inc" %} |
12 | <div id="body_content" class="bg-near-white"> | 12 | <div id="body_content" class="bg-near-white"> |
13 | {% block body_content %}{% endblock %} | 13 | <!-- jump to top, TODO: the link does not cover all of the button --> |
14 | <a href="#" id="jump-top" role="button"> | ||
15 | <i class="fas fa-chevron-up"></i> | ||
16 | </a> | ||
17 | {% block body_content %}{% endblock %} | ||
14 | </div> | 18 | </div> |
15 | {% include "common/footer.j2.inc" %} | 19 | {% include "common/footer.j2.inc" %} |
16 | </body> | 20 | </body> |
diff --git a/common/footer.j2.inc b/common/footer.j2.inc index 6d4614b3..68a3b6de 100644 --- a/common/footer.j2.inc +++ b/common/footer.j2.inc | |||
@@ -31,5 +31,10 @@ | |||
31 | <a href="https://git.gnunet.org/www.git">{{ _("Source code of this site.") }}</a> | 31 | <a href="https://git.gnunet.org/www.git">{{ _("Source code of this site.") }}</a> |
32 | <a href="{{ url_localized('contact.html') }}">{{ _("Report issues with this website.") }}</a> | 32 | <a href="{{ url_localized('contact.html') }}">{{ _("Report issues with this website.") }}</a> |
33 | </p> | 33 | </p> |
34 | <noscript> | ||
35 | <p> | ||
36 | <a href="#">back to top</a> | ||
37 | </p> | ||
38 | </noscript> | ||
34 | </div> | 39 | </div> |
35 | </footer> | 40 | </footer> |
diff --git a/common/header.j2.inc b/common/header.j2.inc index 9301948c..2f809854 100644 --- a/common/header.j2.inc +++ b/common/header.j2.inc | |||
@@ -44,6 +44,11 @@ | |||
44 | <script src="{{ url_dist('js/bootstrap.min.js') }}"></script> | 44 | <script src="{{ url_dist('js/bootstrap.min.js') }}"></script> |
45 | <link href="{{ url_static('navbar.css') }}" rel="stylesheet"> | 45 | <link href="{{ url_static('navbar.css') }}" rel="stylesheet"> |
46 | 46 | ||
47 | <link href="{{ url_dist('font-awesome/css/all.css') }}" rel="stylesheet"> | ||
48 | |||
49 | <link href="{{ url_static('scroll.css') }}" rel="stylesheet"> | ||
50 | <script src="{{ url_static('scroll.js') }}"></script> | ||
51 | |||
47 | <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | 52 | <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> |
48 | <!--[if lt IE 9]> | 53 | <!--[if lt IE 9]> |
49 | <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | 54 | <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> |
diff --git a/common/navigation.j2.inc b/common/navigation.j2.inc index a353fd13..dd7bb86d 100644 --- a/common/navigation.j2.inc +++ b/common/navigation.j2.inc | |||
@@ -15,7 +15,7 @@ | |||
15 | } | 15 | } |
16 | </style> | 16 | </style> |
17 | </noscript> | 17 | </noscript> |
18 | <nav class="navbar sticky-top navbar-expand-md bg-near-black"> | 18 | <nav class="navbar top navbar-expand-md bg-near-black"> |
19 | <a class="navbar-brand" href="{{ url_localized('index.html') }}"> | 19 | <a class="navbar-brand" href="{{ url_localized('index.html') }}"> |
20 | <img src="{{ url_static('images/gnunet-logo-dark-only-text.png') }}" alt="GNUnet" height="25px" /> | 20 | <img src="{{ url_static('images/gnunet-logo-dark-only-text.png') }}" alt="GNUnet" height="25px" /> |
21 | </a> | 21 | </a> |
diff --git a/common/news.j2 b/common/news.j2 index 9cdb06f2..71400760 100644 --- a/common/news.j2 +++ b/common/news.j2 | |||
@@ -10,6 +10,9 @@ | |||
10 | <body id="mybody"> | 10 | <body id="mybody"> |
11 | {% include "common/navigation.j2.inc" %} | 11 | {% include "common/navigation.j2.inc" %} |
12 | <div id="body_content" class="bg-near-white"> | 12 | <div id="body_content" class="bg-near-white"> |
13 | <a href="#" id="jump-top" role="button"> | ||
14 | <i class="fas fa-chevron-up"></i> | ||
15 | </a> | ||
13 | <div class="container-fluid"> | 16 | <div class="container-fluid"> |
14 | <div class="container text-center"> | 17 | <div class="container text-center"> |
15 | <h1>News</h1> | 18 | <h1>News</h1> |
diff --git a/static/scroll.css b/static/scroll.css new file mode 100644 index 00000000..b36c841f --- /dev/null +++ b/static/scroll.css | |||
@@ -0,0 +1,49 @@ | |||
1 | #jump-top { | ||
2 | position: fixed; | ||
3 | bottom: 20px; | ||
4 | right: 20px; | ||
5 | background: rgb(0, 0, 0); | ||
6 | background: rgba(0, 0, 0, 0.7); | ||
7 | width: 50px; | ||
8 | height: 50px; | ||
9 | display: block; | ||
10 | text-decoration: none; | ||
11 | -webkit-border-radius: 35px; | ||
12 | -moz-border-radius: 35px; | ||
13 | border-radius: 35px; | ||
14 | display: none; | ||
15 | -webkit-transition: all 0.3s linear; | ||
16 | -moz-transition: all 0.3s ease; | ||
17 | -ms-transition: all 0.3s ease; | ||
18 | -o-transition: all 0.3s ease; | ||
19 | transition: all 0.3s ease; | ||
20 | } | ||
21 | #jump-top i { | ||
22 | color: #fff; | ||
23 | margin: 0; | ||
24 | position: relative; | ||
25 | left: 16px; | ||
26 | top: 13px; | ||
27 | font-size: 19px; | ||
28 | -webkit-transition: all 0.3s ease; | ||
29 | -moz-transition: all 0.3s ease; | ||
30 | -ms-transition: all 0.3s ease; | ||
31 | -o-transition: all 0.3s ease; | ||
32 | transition: all 0.3s ease; | ||
33 | } | ||
34 | |||
35 | #jump-top:hover { | ||
36 | background: rgba(0, 0, 0, 0.9); | ||
37 | } | ||
38 | #jump-top:hover i { | ||
39 | color: #fff; | ||
40 | top: 5px; | ||
41 | } | ||
42 | /* | ||
43 | .jump-top { | ||
44 | position: fixed; | ||
45 | bottom: 35px; | ||
46 | right: 35px; | ||
47 | display: none; | ||
48 | } | ||
49 | */ | ||
diff --git a/static/scroll.js b/static/scroll.js new file mode 100644 index 00000000..1180588a --- /dev/null +++ b/static/scroll.js | |||
@@ -0,0 +1,12 @@ | |||
1 | $(window).scroll(function() { | ||
2 | if ($(this).scrollTop() >= 50) { | ||
3 | $('#jump-top').fadeIn(200); | ||
4 | } else { | ||
5 | $('#jump-top').fadeOut(200); | ||
6 | } | ||
7 | }); | ||
8 | $('#jump-top').click(function() { | ||
9 | $('html').animate({ | ||
10 | scrollTop : 0 | ||
11 | }, 500); | ||
12 | }); | ||