joeni

Add mobile-ready stylesheet updates to SCSS

With just a couple of edge cases, the stylesheets are now completely ready for all screen sizes. They all scale correctly, mobile pages get a hamburger menu (which is the same header element), and the hamburger menu SVG has a fallback to "☰" so it's always visible.
Also: The cards, when hovered, now only underline the contained text. Another color is not necessary in my opinion at this time.

Author
Maarten Vangeneugden
Date
April 16, 2018, 1:07 p.m.
Hash
c5c379e0e034f20795d2329442a356a63380e467
Parent
416c65ee58cdca6e047c14ba69509218ab04dc13
Modified files
joeni/templates/joeni/base.djhtml
joeni/templates/joeni/header.djhtml
static/css/classes.scss
static/css/footer.scss
static/css/header.scss

joeni/templates/joeni/base.djhtml

2 additions and 1 deletion.

View changes Hide changes
1
1
{% load i18n %}
2
2
{% get_current_language as LANGUAGE_CODE %}
3
3
{% get_language_info for LANGUAGE_CODE as lang %}
4
4
{% load static %}
5
5
{% get_media_prefix as media %}
6
6
7
7
8
8
9
9
    
10
10
        </pre></td>
        </tr>
        
        
        <tr class="nochange">
            <td id="joeni/templates/joeni/base.djhtml-A11" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-A11" class="accent-on-hover-only"><pre>11</pre>
            <td id="joeni/templates/joeni/base.djhtml-B11" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-B11" class="accent-on-hover-only"><pre>11</pre>
            </a></td>
        
            <td style="padding-left: 1em;"><pre>            {% block title %}</pre></td>
        </tr>
        
        
        <tr class="nochange">
            <td id="joeni/templates/joeni/base.djhtml-A12" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-A12" class="accent-on-hover-only"><pre>12</pre>
            <td id="joeni/templates/joeni/base.djhtml-B12" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-B12" class="accent-on-hover-only"><pre>12</pre>
            </a></td>
        
            <td style="padding-left: 1em;"><pre>                {#◀ Joeni /▶ | ▶▶ UHasselt#}</pre></td>
        </tr>
        
        
        <tr class="nochange">
            <td id="joeni/templates/joeni/base.djhtml-A13" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-A13" class="accent-on-hover-only"><pre>13</pre>
            <td id="joeni/templates/joeni/base.djhtml-B13" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-B13" class="accent-on-hover-only"><pre>13</pre>
            </a></td>
        
            <td style="padding-left: 1em;"><pre>                ▶▶ UHasselt</pre></td>
        </tr>
        
        
        <tr class="nochange">
            <td id="joeni/templates/joeni/base.djhtml-A14" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-A14" class="accent-on-hover-only"><pre>14</pre>
            <td id="joeni/templates/joeni/base.djhtml-B14" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-B14" class="accent-on-hover-only"><pre>14</pre>
            </a></td>
        
            <td style="padding-left: 1em;"><pre>            {% endblock title %}</pre></td>
        </tr>
        
        
        <tr class="nochange">
            <td id="joeni/templates/joeni/base.djhtml-A15" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-A15" class="accent-on-hover-only"><pre>15</pre>
            <td id="joeni/templates/joeni/base.djhtml-B15" class="line-number">
                <a href="#joeni/templates/joeni/base.djhtml-B15" class="accent-on-hover-only"><pre>15</pre>
            </a></td>
        
            <td style="padding-left: 1em;"><pre>        
16
16
17
17
        {% block stylesheets %}
18
18
            {% comment %}
19
19
            
20
20
            
21
21
            {% endcomment %}
22
22
            
23
23
            
28
28
        {% endblock stylesheets %}
29
29
30
30
        {% block metaflags %}
31
31
            {# This is standard for all web pages and doesn't require changing. #}
32
32
            {# UTF-8, always #}
33
33
            
34
34
            {##}
35
35
            {# Indicates this page is suited for mobile devices #}
36
36
            
37
37
            
38
38
                name="description"
39
39
                content="{% block description %}
40
40
                    {% trans "The digital platform of Hasselt University" %}
41
41
                {% endblock description %}" />
42
42
        {% endblock metaflags %}
43
43
        
52
52
    
53
53
54
54
    
55
55
        
+
56
        
+
57
        
56
58
                {% block header %}
57
59
                    {% include "joeni/header.djhtml" %}
58
60
                {% endblock header %}
59
61
        
60
62
61
-
        
62
63
            {% block main %}
63
64
            {% endblock main %}
64
65
        
65
66
66
67
        
67
68
            {% block footer %}
68
69
                {% include "joeni/footer.djhtml" %}
69
70
            {% endblock footer %}
70
71
        
71
72
72
73
    
73
74
    {% block JavaScript %}
74
75
    {% comment "JavaScript" %}
75
76
    My website does not require JavaScript for basic actions. However, it may be
76
77
    used to make certain things look better, or to spice up some actions for the
77
78
    user. Should it be necessary, add the appropriate JavaScript code in this
78
79
    block.
79
80
    The reason this block is at the bottom?
80
81
	Remember to always put JavaScript on the bottom to reduce load time.
81
82
    Otherwise it just errors like a fucktard, which is really the only thing
82
83
    you can always expect from JavaScript.
83
84
    {% endcomment %}
84
85
    {% endblock JavaScript %}
85
86

joeni/templates/joeni/header.djhtml

0 additions and 1 deletion.

View changes Hide changes
1
1
{% load static %}
2
2
{% get_media_prefix as media %}
3
3
4
-
◀ Joeni /▶
5
4
6
5
    
    7
    6
            
  • Agora
  • 8
    7
                
      9
      8
                  
      10
      9
              
      11
      10
      12
      11
              
    • {% trans "Administration" %}
    • 13
      12
                  
        14
        13
                        
      • {% trans "Personal settings" %}
      • 15
        14
                        
      • {% trans "Curricula" %}
      • 16
        15
                        
      • {% trans "Forms" %}
      • 17
        16
                        
      • {% trans "Rooms" %}
      • 18
        17
                        
      • {% trans "Jobs" %}
      • 19
        18
                        
      • {% trans "Personal Roster" %}
      • 20
        19
                        
      • {% trans "Bulletin board" %}
      • 21
        20
                    
        22
        21
                
        23
        22
        24
        23
                
      • {% trans "Courses" %}
      • 25
        24
                    
          26
          25
                          {% for course in user.user_data.current_courses %}
          27
          26
                              
        • {{ course.name }}
        • 28
          27
                          {% endfor %}
          29
          28
                      
          30
          29
                  
          31
          30
              
          32
          31
          33
          32
          {# PingPing: €{{ money }} #}
          34
          33
          35
          34
          36
          35

          static/css/classes.scss

          0 additions and 1 deletion.

          View changes Hide changes
          1
          1
          div.flex-container {
          2
          2
              display: flex;
          3
          3
              flex-direction: row;
          4
          4
              flex-wrap: wrap;
          5
          5
              justify-content: space-between; // Not too sure about this one, experiment if you want to
          6
          6
              align-items: stretch;
          7
          7
              //align-content: space-around;
          8
          8
          }
          9
          9
          10
          10
          .flex-items {
          11
          11
              color: white;
          12
          12
              font-family: ubuntu;
          13
          13
              text-decoration: none;
          14
          14
              flex-grow: 1;
          15
          15
              margin: .2em;
          16
          16
              text-decoration-style: none;
          17
          17
              padding: 1em;
          18
          18
          19
          19
              &:hover {
          20
          20
                  text-decoration: underline solid white;
          21
          21
                  color: red;
          22
          22
              }
          23
          -
          }
          24
          23

          static/css/footer.scss

          3 additions and 1 deletion.

          View changes Hide changes
          1
          1
              margin-left: ($header-padding * 2) + $header-width;
          2
          2
              padding: 0.5em;
          3
          3
              background-color: $uhasselt-color;
          4
          4
              color: white;
          5
          5
              width: 78%;
          6
          6
              position: fixed;
          7
          7
              bottom: 0;
          8
          8
              img {
          9
          9
                  vertical-align: middle;
          10
          10
                  height: 2em;
          11
          11
              }
          12
          12
          13
          13
              @media screen
          14
          14
              and (max-device-width: 440px)
          15
          15
              and (max-device-height: 800px) {
          16
          16
                  //and (-webkit-min-device-pixel-ratio: 2) {
          17
          17
                  position: relative;
          18
          18
                  width: 100%;
          +
          19
                  width: 100%;
          19
          20
                  img {
          20
          21
                      height: 1em;
          21
          -
                  }
          +
          22
                  }
          22
          23
          }
          +
          24
          }
          23
          25

          static/css/header.scss

          42 additions and 2 deletions.

          View changes Hide changes
          1
          1
              float: left;
          2
          2
              margin-right: 50px;
          3
          3
              position: fixed;
          4
          4
              //display: flow;
          5
          5
              //height: 100%;
          6
          6
              padding: $header-padding;
          +
          7
              padding: $header-padding;
          7
          8
              top: 0;
          8
          9
              width: $header-width;
          9
          10
              height: 100%;
          10
          11
              //background-color: $uhasselt-color;
          11
          12
              color: white;
          12
          13
              img {
          13
          14
                  width: 80%;
          14
          15
              }
          15
          16
              nav ul {
          16
          17
                  //list-style: none;
          +
          18
                  //list-style: none;
          17
          19
                  list-style: none;
          18
          20
                  }
          19
          21
              a {
          20
          22
                  text-decoration: none;
          21
          23
                  color: white;
          22
          24
                  &:hover {
          23
          25
                      text-decoration: underline solid white;
          24
          26
                      text-transform: uppercase;
          25
          27
                      font-weight: bold;
          26
          28
                  }
          27
          29
              }
          28
          30
          }
          +
          31
              div.menu-background {
          +
          32
                  display: none;
          +
          33
                  z-index: 1;
          +
          34
              }
          +
          35
          +
          36
              @media print {
          +
          37
                  display: none; // Header is pretty useless on printed sheets
          +
          38
              }
          +
          39
          }
          29
          40
          /*header ul {
          30
          41
              display: inline;
          31
          42
              float: right;
          32
          43
          }*/
          33
          44
          34
          45
          @media screen
          35
          46
          and (max-device-width: 440px)
          36
          47
          and (max-device-height: 800px) {
          37
          48
          //and (-webkit-min-device-pixel-ratio: 2) {
          +
          49
          //and (-webkit-min-device-pixel-ratio: 2) {
          38
          50
              main {
          39
          51
                  margin-left: 2%;
          40
          52
              }
          +
          53
              }
          41
          54
              input#header-mobile {
          +
          55
                  z-index: 4;
          +
          56
                  color: white;
          +
          57
                  position: absolute;
          +
          58
                  top: 1.5em;
          +
          59
                  left: 1em;
          +
          60
              }
          +
          61
          +
          62
              input#header-mobile {
          42
          63
                  display: none;
          43
          -
                  &:checked ~ header {
          +
          64
                  position: absolute;
          +
          65
                  top: 2em;
          +
          66
                  left: 1em;
          +
          67
                  opacity: 0;
          +
          68
                  /* XXX: Why not send the checkbox to -9999 top? Because some dumb mobile
          +
          69
                  phones don't allow clicking the label to check the box. */
          +
          70
          +
          71
                  &:checked ~ header {
          44
          72
                      display: block;
          45
          73
                  }
          +
          74
                      /* FIXME: Currently I set the height of the header to a ridiculous
          +
          75
                      300%, but it should be made that it overlaps the other elements. */
          +
          76
                      height: 300%;
          +
          77
                      top: 0;
          +
          78
                      width: 100%;
          +
          79
                      nav {
          +
          80
                          display: block;
          +
          81
                          position: relative;
          +
          82
                      }
          +
          83
                  }
          46
          84
              }
          +
          85
              }
          47
          86
          48
          87
              header {
          49
          88
                  position: relative;
          50
          89
                  margin-top: 0;
          +
          90
                  margin-top: 0;
          51
          91
                  margin-right: 0;
          52
          92
                  width: 100%;
          53
          93
                  height: 2em;
          54
          94
                  img {
          55
          95
                      height: 1em;
          56
          -
                  }
          +
          96
                  }
          57
          97
          58
          98
                  nav {
          59
          99
                      display: none;
          60
          100
                  }
          61
          101
              }
          62
          102
          }
          63
          103