From 6c69c821b3565a4be55d69eb4432cbc242ff8770 Mon Sep 17 00:00:00 2001 From: Andrew Selzer Date: Tue, 15 May 2018 16:15:38 -0400 Subject: [PATCH] Refactoring homepage to be mobile friendly --- assets/static/beeware.css | 58 ++++++++++++++++++++++++--- templates/home.html | 84 +++++++++++++++++++++++++++++++++++++-- templates/layout.html | 20 +++++++--- 3 files changed, 147 insertions(+), 15 deletions(-) diff --git a/assets/static/beeware.css b/assets/static/beeware.css index 490f4b6..08f8dc1 100644 --- a/assets/static/beeware.css +++ b/assets/static/beeware.css @@ -50,6 +50,9 @@ /* Small devices (landscape phones, less than 48em) */ @media (max-width: 768px) { + .content { + margin-bottom: 5em; + } .display-1 { font-size: 400%; } @@ -68,17 +71,58 @@ } /* Extra small devices (portrait phones, less than 34em) */ @media (max-width: 544px) { + + .beeware-logo { + display: block; + margin: 15px auto 35px; + width: 50%; + } + + .content { + margin-top: 3em; + margin-bottom: 7em; + } + .display-1 { font-size: 270%; + /* TODO: Once Bootstrap is upgraded, instead use class text-xs-center */ + text-align: center; } .display-2 { - font-size: 125%; + font-size: 105%; + /* TODO: Once Bootstrap is upgraded, instead use class text-xs-center */ + text-align: center; + } + + .footer .copyright { + margin-bottom: 0.5rem; + text-align: center; + } + + .footer-social { + margin-bottom: 0.5rem; + } + + .footer-social, .footer-sitemap { + text-align: center; + } + + .jumbotron { + margin-bottom: 0; } .jumbotron .btn-lg { font-size: 1rem; } + .jumbotron p { + margin: 1.5rem 0; + } + + .jumbotron-buttons a { + width: 100%; + } + .video { width: 300px; height: 225px; @@ -101,11 +145,6 @@ Main styles --------------------------------------------------- */ -.content { - margin-top: 3em; - margin-bottom: 5em; -} - h1 { font-family: 'Cutive', serif; margin-top: 1em; @@ -177,6 +216,9 @@ h6:first-child { margin-top: 0.8rem; } +a i { + padding-right: 0.25em; +} nav { font-family: 'Cutive', serif; } @@ -289,6 +331,10 @@ body { background-color: #f5f5f5; } +.footer a { + margin: 0 0.75em; +} + /*---------------------------------------------------- Carousels in gutter diff --git a/templates/home.html b/templates/home.html index d4d009d..94d5d12 100644 --- a/templates/home.html +++ b/templates/home.html @@ -19,12 +19,14 @@
-
-
+
+ +
+

BeeWare

{{ this.title }}

{{ this.description }}

-

+

{% for blk in this.header.blocks %} {{ blk }} {% endfor %} @@ -36,6 +38,8 @@ {% endblock %} {% block body %} + +

{% for blk in this.body.blocks %} @@ -54,7 +58,7 @@
-
+
+ + +
+
+ {{ this.gutter_top }} + + +
+ +

{{ t_latest_news }}

+ {% set blog = site.query('/news/buzz', alt=this.alt).all() %} +

{{ blog[0].pub_date.strftime("%d %b")}}: {{ blog[0].title }}

+ +
+ + {% set events = site.query('/news/events', alt=this.alt).filter(F.upcoming==True) %} + {% if events %} +

{{ t_meet_team }}

+ + + +
+ {% endif %} +

{{ t_projects }}

+ {% set project_types = site.query('/project/projects', alt=this.alt) %} + {% for project_type in project_types %} + {% for project in site.query(project_type.path, alt=this.alt).filter(F.showcase==True) %} +
+

{{ project.name }} {{ project.name }}

+ {{ project.short_description|string|wordwrap(width=40, wrapstring='
')|safe }} +
+ {% endfor %} + {% endfor %} + {{ this.gutter_bottom }} +
+
{% endblock %} diff --git a/templates/layout.html b/templates/layout.html index 0663a02..41a41e9 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -180,11 +180,21 @@ ga('send', 'pageview');