From 8f5bc24fd155ab8c051746f79c3c8ec71f6858cf Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 30 Aug 2019 14:07:24 +0200 Subject: [PATCH 1/3] prevent out of bounds opacity values --- homepage/theme/static/scripts/fade.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homepage/theme/static/scripts/fade.js b/homepage/theme/static/scripts/fade.js index 70e7e13..d00999b 100644 --- a/homepage/theme/static/scripts/fade.js +++ b/homepage/theme/static/scripts/fade.js @@ -1,7 +1,8 @@ ;(function ($) { $(document).ready(function () { $(window).scroll(function () { - $('.brand-index').css('opacity', 0 + $(window).scrollTop() / 100) + var scrollProgress = parseInt($(window).scrollTop(), 10) + $('.brand-index').css('opacity', Math.min(scrollProgress / 100, 1)) }) }) })(window.jQuery) From a553147a9402583d5e8d87abb68859fde5cd6fb1 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 30 Aug 2019 15:00:27 +0200 Subject: [PATCH 2/3] use template inheritance for distinguishing layouts --- homepage/content/pages/index.md | 1 + homepage/theme/templates/auditorium.html | 15 ++ homepage/theme/templates/base.html | 173 +++++------------------ homepage/theme/templates/index.html | 107 ++++++++++++++ homepage/theme/templates/page.html | 14 +- 5 files changed, 163 insertions(+), 147 deletions(-) create mode 100644 homepage/theme/templates/auditorium.html create mode 100644 homepage/theme/templates/index.html diff --git a/homepage/content/pages/index.md b/homepage/content/pages/index.md index 956b887..6dc23dc 100644 --- a/homepage/content/pages/index.md +++ b/homepage/content/pages/index.md @@ -2,6 +2,7 @@ Title: Transparent web analytics | offen description: offen is a free and open source analytics software for websites and web applications that allows respectful handling of data. save_as: index.html href: / +template: index ## Summary diff --git a/homepage/theme/templates/auditorium.html b/homepage/theme/templates/auditorium.html new file mode 100644 index 0000000..ce81a54 --- /dev/null +++ b/homepage/theme/templates/auditorium.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block brand %} +
+ {{ super() }} +
+{% endblock %} + +{% block content %} +
+
+ {{ page.content }} +
+
+{% endblock %} diff --git a/homepage/theme/templates/base.html b/homepage/theme/templates/base.html index 698fbdf..4f06d91 100644 --- a/homepage/theme/templates/base.html +++ b/homepage/theme/templates/base.html @@ -1,7 +1,9 @@ - {% block title %}{% endblock %} + + {% block title %}{{ page.title }}{% endblock %} + @@ -18,24 +20,19 @@ {% assets filters="cssmin", output="css/style.min.css", "css/normalize.css", "css/fonts.css", "css/style.css" %} - + {% endassets %} {% if OFFEN_ACCOUNT_ID %} {% endif %} - + + + + - {% if page.href == "/" %} -
-
-
-
-
- offen logo -
-

- Transparent web analytics for operators and users -

-

- offen is a free and open source analytics software for websites and web applications that allows respectful handling of data. -

- -
-
+ {% block content %} +
+
+ {{ page.content }}
+ {% endblock %} -
-
+ {% block outro %} +
+

- Free & Open + Participate

- Anyone can audit our open source code to verify it works as intended. offen will always be available free of charge. + Development of offen has just started. Do not hesitate to make a contribution and help us handle data with respect.

+

- Fair & Secure + In the making

- Pay respect to your website visitors and gain insights as a user at the same time. All data is encrypted end-to-end. + This project is still in alpha. Discover what is already up and running and where we want to go in the coming months.

+

- Easy to use + Good cause

- Simply paste our code into the source of your website. Users can visit the auditorium to access their data. + We're working hard to ensure that offen is independent, cutting-edge and can be sustained for years to come.

+
- - -
-
-
-
-

- In the making -

-

- offen is still in alpha. Discover what is already up and running and where we want to go in the coming months. -

- -
-
-
-
- {% endif %} - - {% if page.href == "/" %} -
- {% else %} -
- {% endif %} - {% if page.href == "/auditorium/operator/" or page.href == "/auditorium/user/" %} -
- {% else %} -
- {% endif %} - {% block content %}{% endblock %} -
-
- - {% if page.href != "/" %} -
-
-
-
-
-

- Participate -

-

- Development of offen has just started. Do not hesitate to make a contribution and help us handle data with respect. -

- -
-
-

- In the making -

-

- This project is still in alpha. Discover what is already up and running and where we want to go in the coming months. -

- -
-
-

- Good cause -

-

- We're working hard to ensure that offen is independent, cutting-edge and can be sustained for years to come. -

- -
-
-
-
-
- {% else %} -
-
-
-
-

- Good cause -

-

- We're working hard to ensure that offen is independent, cutting-edge and can be sustained for years to come. -

- -
-
-
-
- {% endif %} + {% endblock %}
+ {% assets filters="rjsmin", output="scripts/packed.js", "scripts/jquery-3.4.1.min.js", "scripts/menu.js", "scripts/fade.js" %} - + {% endassets %} diff --git a/homepage/theme/templates/index.html b/homepage/theme/templates/index.html new file mode 100644 index 0000000..655042c --- /dev/null +++ b/homepage/theme/templates/index.html @@ -0,0 +1,107 @@ +{% extends "base.html" %} + +{% block brand %} +
+ {{ super() }} +
+{% endblock %} + +{% block content %} +
+
+
+
+
+ offen logo +
+

+ Transparent web analytics for operators and users +

+

+ offen is a free and open source analytics software for websites and web applications that allows respectful handling of data. +

+ +
+
+
+
+ +
+
+
+
+
+

+ Free & Open +

+

+ Anyone can audit our open source code to verify it works as intended. offen will always be available free of charge. +

+
+
+

+ Fair & Secure +

+

+ Pay respect to your website visitors and gain insights as a user at the same time. All data is encrypted end-to-end. +

+
+
+

+ Easy to use +

+

+ Simply paste our code into the source of your website. Users can visit the auditorium to access their data. +

+
+
+
+
+
+ + +
+
+
+
+

+ In the making +

+

+ offen is still in alpha. Discover what is already up and running and where we want to go in the coming months. +

+ +
+
+
+
+
+
+ {{ page.content }} +
+
+{% endblock %} + +{% block outro %} +
+
+
+
+

+ Good cause +

+

+ We're working hard to ensure that offen is independent, cutting-edge and can be sustained for years to come. +

+ +
+
+
+
+{% endblock %} diff --git a/homepage/theme/templates/page.html b/homepage/theme/templates/page.html index f44b590..251d15c 100644 --- a/homepage/theme/templates/page.html +++ b/homepage/theme/templates/page.html @@ -1,13 +1,7 @@ {% extends "base.html" %} - - -{% block content %} - {% block page_content %} - {{ page.content }} - {% endblock %} +{% block brand %} +
+ {{ super() }} +
{% endblock %} From b14493c91140e6e14797f3949b69b2ab18829612 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 30 Aug 2019 19:20:07 +0200 Subject: [PATCH 3/3] add body class for propagating chosen template --- homepage/theme/static/css/style.css | 5 ++--- homepage/theme/static/scripts/fade.js | 2 +- homepage/theme/templates/auditorium.html | 6 ------ homepage/theme/templates/base.html | 6 +++--- homepage/theme/templates/index.html | 6 ------ homepage/theme/templates/page.html | 6 ------ 6 files changed, 6 insertions(+), 25 deletions(-) diff --git a/homepage/theme/static/css/style.css b/homepage/theme/static/css/style.css index 49442d9..27e7e95 100644 --- a/homepage/theme/static/css/style.css +++ b/homepage/theme/static/css/style.css @@ -406,14 +406,13 @@ MENU .nav-bar { height: 70px; } -.brand, -.brand-index { +.brand { position: absolute; padding: 12px 0 0 20px; float: left; line-height: 70px; } -.brand-index { +body.index .brand { opacity: 0; } .nav-container { diff --git a/homepage/theme/static/scripts/fade.js b/homepage/theme/static/scripts/fade.js index d00999b..f4710a9 100644 --- a/homepage/theme/static/scripts/fade.js +++ b/homepage/theme/static/scripts/fade.js @@ -2,7 +2,7 @@ $(document).ready(function () { $(window).scroll(function () { var scrollProgress = parseInt($(window).scrollTop(), 10) - $('.brand-index').css('opacity', Math.min(scrollProgress / 100, 1)) + $('body.index .brand').css('opacity', Math.min(scrollProgress / 100, 1)) }) }) })(window.jQuery) diff --git a/homepage/theme/templates/auditorium.html b/homepage/theme/templates/auditorium.html index ce81a54..1462aa3 100644 --- a/homepage/theme/templates/auditorium.html +++ b/homepage/theme/templates/auditorium.html @@ -1,11 +1,5 @@ {% extends "base.html" %} -{% block brand %} -
- {{ super() }} -
-{% endblock %} - {% block content %}
diff --git a/homepage/theme/templates/base.html b/homepage/theme/templates/base.html index 4f06d91..a4f9247 100644 --- a/homepage/theme/templates/base.html +++ b/homepage/theme/templates/base.html @@ -26,13 +26,13 @@ {% endif %} - +