Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 94c6eb49

Přidáno uživatelem Martin Sebela před více než 3 roky(ů)

Re #8159 - frontend HTML, JS syntax bugfixes, CSS improvements

Zobrazit rozdíly:

website/public/css/style.css
224 224
  }
225 225
}
226 226

  
227
@media (max-width: 991.98px) {
228
  header.map .nav-item .btn {
229
    width: 100%;
230
  }
231
}
232

  
233 227
h1 {
234 228
  text-transform: uppercase;
235 229
  font-size: 21px;
......
1189 1183
  align-items: center;
1190 1184
}
1191 1185

  
1192
header.map .nav-item .btn-secondary:after {
1193
  padding-bottom: 4px;
1194
  content: '↺';
1195
  font-weight: 400;
1196
  font-size: 30px;
1197
  transform: rotateZ(0);
1198
  transition: all 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
1199
}
1200

  
1201
header.map .nav-item .btn-secondary:hover:after {
1202
  transform: rotateZ(-90deg);
1203
  transition: all 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
1204
}
1205

  
1206 1186
@media (max-width: 991.98px) {
1207 1187
  header.map .nav-item .btn-secondary {
1188
    width: 100%;
1208 1189
    border-radius: .25rem;
1209 1190
    margin-left: 0px;
1210 1191
    margin-top: 10px;
......
1212 1193
  }
1213 1194
}
1214 1195

  
1196
header.map .nav-item .btn-secondary:after {
1197
  padding-bottom: 4px;
1198
  content: '↺';
1199
  font-weight: 400;
1200
  font-size: 30px;
1201
  transform: rotateZ(0);
1202
  transition: all 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
1203
}
1204

  
1215 1205
header.map .nav-item .btn-secondary:hover {
1216 1206
  color: #0048A9;
1217 1207
  background: white !important;
......
1220 1210
  box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.22);
1221 1211
}
1222 1212

  
1213
header.map .nav-item .btn-secondary:hover:after {
1214
  transform: rotateZ(-90deg);
1215
  transition: all 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
1216
}
1217

  
1223 1218
header.map .nav-item .btn-secondary:active, header.map .nav-item .btn-secondary:focus {
1224 1219
  background: #f0f0f0 !important;
1225 1220
  color: #0048A9 !important;
......
1274 1269
  text-align: left;
1275 1270
  letter-spacing: .4px;
1276 1271
  color: #ffffff;
1272
  background: #0048A9;
1277 1273
}
1278 1274

  
1279 1275
.dropdown .btn:hover {
......
1286 1282
  overflow-y: auto;
1287 1283
}
1288 1284

  
1285
.dropdown .dropdown-item label {
1286
  width: 100% !important;
1287
  cursor: pointer;
1288
}
1289

  
1289 1290
.dropdown #dataset-dropdown-time .dropdown-item:nth-of-type(even) {
1290 1291
  background: rgba(0, 0, 0, 0.05);
1291 1292
}
website/public/css/style.scss
214 214
          max-width: none;
215 215
        }
216 216
      }
217

  
218
      @include media-breakpoint-down(md) {
219
        .btn {
220
          width: 100%;
221
        }
222
      }
223 217
    }
224 218
  }
225 219
}
......
1095 1089
    display: flex;
1096 1090
    justify-content: center;
1097 1091
    align-items: center;
1092

  
1093
    @include media-breakpoint-down(md) {
1094
      width: 100%;
1095
      border-radius: .25rem;
1096
      margin-left: 0px;
1097
      margin-top: 10px;
1098
      margin-bottom: -10px;
1099
    }
1100

  
1098 1101
    &:after{
1099 1102
      padding-bottom: 4px;
1100 1103
      content: '↺';
......
1103 1106
      transform: rotateZ(0);
1104 1107
      transition: all 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
1105 1108
    }
1106
    &:hover{
1107
      &:after {
1108
        transform: rotateZ(-90deg);
1109
        transition: all 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
1110
      }
1111
    }
1112 1109

  
1113
    @media (max-width: 991.98px) {
1114
      border-radius: .25rem;
1115
      margin-left: 0px;
1116
      margin-top: 10px;
1117
      margin-bottom: -10px;
1118
    }
1119
    
1120 1110
    &:hover {
1121 1111
      color: $primary-bg-color;
1122 1112
      background: rgba(255, 255, 255, 1) !important;
1123 1113
      -webkit-box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.22);
1124 1114
      -moz-box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.22);
1125 1115
      box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.22);
1116

  
1117
      &:after {
1118
        transform: rotateZ(-90deg);
1119
        transition: all 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
1120
      }
1126 1121
    }
1127 1122

  
1128 1123
    &:active, &:focus {
......
1182 1177
    text-align: left;
1183 1178
    letter-spacing: .4px;
1184 1179
    color: $primary-text-color;
1180
    background: $primary-bg-color;
1185 1181

  
1186 1182
    &:hover {
1187 1183
      background: #336dba;
......
1194 1190
    overflow-y: auto;
1195 1191
  }
1196 1192

  
1193
  .dropdown-item label {
1194
    width: 100% !important;
1195
    cursor: pointer;
1196
  }
1197

  
1197 1198
  #dataset-dropdown-time .dropdown-item:nth-of-type(even) {
1198 1199
    background: rgba(0,0,0,.05);
1199 1200

  
website/public/js/zcu-heatmap.js
126 126

  
127 127
  $('#dataset-dropdown-time input[type="radio"]').each(function () {
128 128
    $(this).change(function () {
129
      currentTime = $(this).val()
129
      currentTime = parseInt($(this).val())
130 130
      updateHeaderControls()
131 131
      setTimeline()
132 132
      drawHeatmap(data[currentTime])
......
493 493
    }
494 494
  })
495 495

  
496
  $('#submit-btn').prop('disabled', !leastOneOptionEnabled)
496
  $('#btn-update-heatmap').prop('disabled', !leastOneOptionEnabled)
497 497
}
498 498

  
499 499
function formatDate (date) {
......
560 560
    e.stopPropagation()
561 561
  })
562 562

  
563
  $('#submit-btn').prop('name', '')
563
  $('#btn-update-heatmap').prop('name', '')
564 564
  onValueChangeRegister()
565 565
}
566 566
const loadCheckboxDatasetNameData = () => {
website/templates/heatmap.html.twig
1 1
{% extends 'base.html.twig' %}
2
  
2

  
3 3
{% block title %}Heatmap.ZČU{% endblock %}
4 4
{% block stylesheets %}
5 5
  <link rel="stylesheet" href="{{ asset('css/leaflet.css') }}">
......
36 36
                    'maxlength' : '10',
37 37
                    'placeholder' : 'YYYY-MM-DD',
38 38
                    'autocomplete' : 'off',
39
                    'onChange' : 'checkDataSetsAvailability("' ~ path('available') ~ '")'
39
                    'onchange' : 'checkDataSetsAvailability("' ~ path('available') ~ '")'
40 40
                  }
41 41
                })
42 42
              }}
......
48 48
                  {{ current_time }}
49 49
                </button>
50 50
                <div id="dataset-dropdown-time" class="dropdown-menu" aria-labelledby="dropdownMenuButtonTime">
51
                  {% for oneTime in form.time.children %}
52
                  <label class="dropdown-item custom-dropdown-item">
53
                    {{ form_widget(oneTime, {attr: {class: 'd-none'}}) }}
54
                    {{ form_label(oneTime, null) }}
55
                  </label>
51
                  {% for hour in form.time.children %}
52
                  <div class="dropdown-item custom-dropdown-item">
53
                    {{ form_widget(hour, {attr: {class: 'd-none'}}) }}
54
                    {{ form_label(hour, null) }}
55
                  </div>
56 56
                  {% endfor %}
57 57
                </div>
58 58
              </div>
......
63 63
                  Vyberte datovou sadu
64 64
                </button>
65 65
                <div id="dataset-dropdown" class="dropdown-menu" aria-labelledby="dropdownMenuButtonDataset">
66
                  {% for oneDataset in form.type.children %}
66
                  {% for dataset in form.type.children %}
67 67
                  <div class="dropdown-item custom-dropdown-item">
68
                    <div class="custom-control custom-checkbox custom-checkbox-{{oneDataset.vars.value}}">
69
                      {{ form_widget(oneDataset, {
68
                    <div class="custom-control custom-checkbox custom-checkbox-{{dataset.vars.value}}">
69
                      {{ form_widget(dataset, {
70 70
                        attr: {
71
                          'class': "custom-control-input custom-control-input-#{oneDataset.vars.value}",
72
                          'data-dataset-display-name': "#{oneDataset.vars.label}"
71
                          'class': "custom-control-input custom-control-input-#{dataset.vars.value}",
72
                          'data-dataset-display-name': "#{dataset.vars.label}"
73 73
                          }
74 74
                      }) }}
75
                      {{ form_label(oneDataset, null, {
75
                      {{ form_label(dataset, null, {
76 76
                        'label_attr': {'class': 'custom-control-label'}
77 77
                      }) }}
78 78
                    </div>
......
87 87
                  'name' : '',
88 88
                  'label' : '',
89 89
                  'type' : 'submit',
90
                  'id' : 'submit-btn',
90
                  'id' : 'btn-update-heatmap',
91 91
                  'attr' : {
92 92
                    'class': 'btn btn-secondary'
93 93
                  }
......
118 118

  
119 119
    <div class="datetime">
120 120
    
121
    {% if form.vars.value.date %}
121
      {% if form.vars.value.date %}
122 122
      <div class="date" id="player-date" onclick="openDatepicker()">{{ form.vars.value.date|date('j. n. Y') }}</div>
123
    {% endif %}
124

  
125
    <div class="timeline">
126
      <div class="time hour-0" id="timeline">0:00</div>
127

  
128
      <div class="hour"></div>
129
      <div class="hour"></div>
130
      <div class="hour"></div>
131
      <div class="hour"></div>
132
      <div class="hour"></div>
133
      <div class="hour"></div>
134
      <div class="hour"></div>
135
      <div class="hour"></div>
136
      <div class="hour"></div>
137
      <div class="hour"></div>
138
      <div class="hour"></div>
139
      <div class="hour"></div>
140
      <div class="hour"></div>
141
      <div class="hour"></div>
142
      <div class="hour"></div>
143
      <div class="hour"></div>
144
      <div class="hour"></div>
145
      <div class="hour"></div>
146
      <div class="hour"></div>
147
      <div class="hour"></div>
148
      <div class="hour"></div>
149
      <div class="hour"></div>
150
      <div class="hour"></div>
151
      <div class="hour"></div>
152
      <div class="end-dot"></div>
153
    </div>
123
      {% endif %}
124

  
125
      <div class="timeline">
126
        <div class="time hour-0" id="timeline">0:00</div>
127

  
128
        {% for i in 0..23 %}
129
        <div class="hour"></div>
130
        {% endfor %}
131
        <div class="end-dot"></div>
132
      </div>
154 133
    </div>
155 134
  </div>
156 135

  
157 136
  <div id="heatmap"></div>
158
  
137

  
159 138
{% endblock %}
160 139

  
161 140
{% block javascripts %}
......
163 142
    <script src="{{ asset('js/vendor/jquery-3.4.1.min.js') }}"></script>
164 143
    <script src="{{ asset('js/vendor/bootstrap.min.js') }}"></script>
165 144
    <script src="{{ asset('js/vendor/bootstrap-datepicker.min.js') }}"></script>
166
    <script src="{{ asset('js/vendor/bootstrap-datepicker.cs.min.js') }}" charset="UTF-8"></script>
145
    <script src="{{ asset('js/vendor/bootstrap-datepicker.cs.min.js') }}"></script>
167 146
    <script src="{{ asset('js/vendor/leaflet.js') }}"></script>
168 147
    <script src="{{ asset('js/vendor/leaflet-heat.js') }}"></script>
169 148
    <script src="{{ asset('js/zcu-heatmap.js') }}"></script>
170 149
    <script>
171 150
        initDatepicker("{{ path('dates') }}");
172 151
        initLocationsMenu();
173
        initMap();        
152
        initMap();
153

  
174 154
        $(document).ready(function() {
175 155
          onDocumentReady();
176 156
          checkDataSetsAvailability("{{ path('available') }}")
......
178 158
          loadCurrentTimeHeatmap("{{ path('opendata') }}", "{{ path('positions') }}");
179 159
          {% endif %}
180 160
        });
161
        
181 162
        $(window).resize(function() {
182 163
          initLocationsMenu();
183 164
        });
......
186 167
{% endblock %}
187 168

  
188 169
{% block style %}
189
  <style>
190
    {% for key, item in dataset_colors %}
191
      .custom-control-input-{{key}}:focus~.custom-control-label::before {
192
        border-color: {{item}} !important;
170
  <style type="text/css">
171
    {% for dataset_name, dataset_color in dataset_colors %}
172
      .custom-control-input-{{ dataset_name }}:focus~.custom-control-label::before {
173
        border-color: {{ dataset_color }} !important;
193 174
        box-shadow: 0 0 0 0.2rem rgba(192,192,192, 0.4) !important;
194 175
      }
195 176

  
196
      .custom-control-input-{{key}}:checked~.custom-control-label::before {
197
        border-color: {{item}} !important;
198
        background-color: {{item}} !important;
177
      .custom-control-input-{{ dataset_name }}:checked~.custom-control-label::before {
178
        border-color: {{ dataset_color }} !important;
179
        background-color: {{ dataset_color }} !important;
199 180
      }
200 181

  
201
      .custom-control-input-{{key}}:focus:not(:checked)~.custom-control-label::before {
202
        border-color: {{item}} !important;
182
      .custom-control-input-{{ dataset_name }}:focus:not(:checked)~.custom-control-label::before {
183
        border-color: {{ dataset_color }} !important;
203 184
      }
204 185

  
205
      .custom-control-input-{{key}}:not(:disabled):active~.custom-control-label::before {
206
        background-color: {{item}} !important;
207
        border-color: {{item}} !important;
186
      .custom-control-input-{{ dataset_name }}:not(:disabled):active~.custom-control-label::before {
187
        background-color: {{ dataset_color }} !important;
188
        border-color: {{ dataset_color }} !important;
208 189
      }
209 190

  
210
      .popup-{{key}} > .leaflet-popup-content-wrapper, .popup-{{key}} .leaflet-popup-tip {
211
        background-color: {{item}} !important;
191
      .popup-{{ dataset_name }} > .leaflet-popup-content-wrapper, .popup-{{ dataset_name }} .leaflet-popup-tip {
192
        background-color: {{ dataset_color }} !important;
212 193
      }
213 194
    {% endfor %}
214 195
  </style>
website/templates/index.html.twig
18 18
    </div>
19 19

  
20 20
    <nav class="navbar navbar-expand-lg">
21
      <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type[]=JIS" class="navbar-brand shifted">
21
      <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type=JIS" class="navbar-brand shifted">
22 22
        <h1>Heatmap.ZČU</h1>
23 23
      </a>
24 24

  
......
45 45
          </li>
46 46
          <li class="nav-item button">
47 47
            <h2>
48
              <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type[]=JIS" class="nav-link">Zobrazit heatmapu</a>
48
              <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type=JIS" class="nav-link">Zobrazit heatmapu</a>
49 49
            </h2>
50 50
          </li>
51 51
        </ul>
......
62 62
            <h3>Život na ZČU během dne</h3>
63 63
            <hr>
64 64
            <p>Zobrazte si heatmapu života univerzity hodinu po hodině během jednoho dne. Od ranního probouzení, kdy studenti a&nbsp;zaměstnanci přicházejí do laboratoří, přes polední špičku v&nbsp;menze až do samotného večera, kdy končí poslední z&nbsp;přednášek a&nbsp;cvičení.</p>
65
            <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type[]=JIS" class="btn btn-primary" role="button">Vyzkoušet heatmapu</a>
65
            <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type=JIS" class="btn btn-primary" role="button">Vyzkoušet heatmapu</a>
66 66
          </div>
67 67
        </div>
68 68

  
......
92 92
            <h3>Hledání anomálií</h3>
93 93
            <hr>
94 94
            <p>Heatmapa vám také dává možnost prozkoumávat data vlastním způsobem &ndash; stačí jen zvolit konkrétní datum a&nbsp;čas, pro které chcete data zobrazit. Můžete tak objevit i&nbsp;různé anomálie, například narazit na noční návštěvníky kampusu nebo odhalit návraty na studentské koleje v&nbsp;brzkých ranních hodinách&hellip;</p>
95
            <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type[]=JIS" class="btn btn-primary" role="button">Vyzkoušet heatmapu</a>
95
            <a href="/heatmap/?date=2019-04-11&amp;time=9&amp;type=JIS" class="btn btn-primary" role="button">Vyzkoušet heatmapu</a>
96 96
          </div>
97 97
        </div>
98 98

  

Také k dispozici: Unified diff