Skip to content

Commit a667094

Browse files
minORCray-oxd
authored andcommitted
DBC22-1486: Added styling and html structure for regional weather sidepanel
1 parent 7cfc9eb commit a667094

File tree

2 files changed

+166
-41
lines changed

2 files changed

+166
-41
lines changed

src/frontend/src/Components/map/mapPopup.js

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ import {
1212
faMountain,
1313
faDroplet,
1414
faSnowflake,
15-
faWind
15+
faWind,
16+
faEye,
17+
faArrowUpRightFromSquare
1618
} from '@fortawesome/free-solid-svg-icons';
19+
import {
20+
faSunCloud
21+
} from '@fortawesome/pro-solid-svg-icons';
1722

1823
import './mapPopup.scss';
1924

@@ -107,6 +112,7 @@ export function getFerryPopup(ferryFeature) {
107112
</div>
108113
</div>
109114

115+
// Road weather conditions html structure
110116
// <div className="popup popup--road-weather">
111117
// <div className="popup__title">
112118
// <div className="popup__title__icon">
@@ -178,5 +184,46 @@ export function getFerryPopup(ferryFeature) {
178184
// </div>
179185
// </div>
180186
// </div>
187+
188+
// Regional weather html structure
189+
// <div className="popup popup--regional-weather">
190+
// <div className="popup__title">
191+
// <div className="popup__title__icon">
192+
// <FontAwesomeIcon icon={faSunCloud} />
193+
// </div>
194+
// <p className="name">Regional Weather</p>
195+
// </div>
196+
// <div className="popup__content">
197+
// <div className="popup__content__title">
198+
// <p className="name">Cummins Lakes Park</p>
199+
// <FriendlyTime date='2024-03-01T00:00:00-08:00' />
200+
// </div>
201+
// <div className="popup__content__description">
202+
// <FontAwesomeIcon className="weather-icon" icon={faSunCloud} />
203+
// <p className="weather">Partly cloudy</p>
204+
// <p className="temperature">24&#x2103;</p>
205+
// <div className="data-card">
206+
// <div className="data-card__row">
207+
// <div className="data-icon">
208+
// <FontAwesomeIcon className="icon" icon={faEye} />
209+
// </div>
210+
// <p className="label">Visibility</p>
211+
// <p className="data">42km</p>
212+
// </div>
213+
// <div className="data-card__row">
214+
// <div className="data-icon">
215+
// <FontAwesomeIcon className="icon" icon={faWind} />
216+
// </div>
217+
// <p className="label">Wind</p>
218+
// <p className="data">SW 27 gusts 44 km/h</p>
219+
// </div>
220+
// </div>
221+
// </div>
222+
// </div>
223+
// <div className="popup__additional">
224+
// <p className="label"><a alt="Past 24 Hours" target="_self" href="https://weather.gc.ca/past_conditions/index_e.html?station=yyj">Past 24 hours <FontAwesomeIcon icon={faArrowUpRightFromSquare} /></a></p>
225+
// <p className="label">Courtesy of <a alt="Environment Canada" target="_self" href="https://weather.gc.ca/canada_e.html">Environment Canada <FontAwesomeIcon icon={faArrowUpRightFromSquare} /></a></p>
226+
// </div>
227+
// </div>
181228
);
182229
}

src/frontend/src/Components/map/mapPopup.scss

Lines changed: 118 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -298,57 +298,135 @@
298298
}
299299
}
300300
}
301-
.data-card {
302-
margin-top: 0.75rem;
303-
padding: 0.75rem;
304-
border-radius: 8px;
305-
box-shadow: 0px 6.4px 14.4px 0px rgba(0, 0, 0, 0.13), 0px 1.2px 3.6px 0px rgba(0, 0, 0, 0.10);
306-
307-
&__row {
308-
display: flex;
309-
310-
& + .data-card__row {
311-
margin-top: 0.75rem;
312-
padding-top: 0.75rem;
313-
border-top: 1px solid $Divider;
314-
}
315-
316-
&:not(.group) {
317-
.data-icon {
318-
align-self: center;
319-
}
320-
}
301+
}
302+
}
303+
}
321304

322-
.data-icon {
323-
margin-right: 0.75rem;
324-
}
305+
//Regional Weather layer
306+
&--regional-weather {
307+
display: flex;
308+
flex-direction: column;
309+
height: 100%;
325310

326-
.data-group {
327-
flex: 1 0;
311+
.popup__title {
312+
background-color: #ECEAE8;
313+
border-top: 4px solid $Type-Primary;
314+
315+
.name {
316+
color: $Type-Primary;
317+
}
318+
319+
&__icon {
320+
background-color: $Type-Primary;
321+
color: white;
322+
}
323+
}
328324

329-
&__row {
330-
display: flex;
331-
}
332-
}
333-
}
325+
.popup__content {
326+
p {
327+
margin-bottom: 0;
328+
}
329+
&__title {
330+
.name {
331+
color: $Type-Primary;
332+
font-size: 2.25rem;
333+
text-align: center;
334+
margin-bottom: 0;
335+
}
334336

335-
.label, .data {
337+
.friendly-time {
338+
margin: 0 auto 1rem;
339+
&-text {
340+
color: $Type-Secondary;
336341
font-size: 0.875rem;
337342
}
338-
339-
.label {
340-
text-align: left;
341-
font-weight: 700;
342-
}
343+
}
344+
}
345+
&__description {
346+
text-align: center;
347+
.weather-icon {
348+
font-size: 4rem;
349+
}
350+
.weather {
351+
font-size: 0.875rem;
352+
}
353+
.temperature {
354+
font-size: 4rem;
355+
font-weight: 700;
356+
}
357+
}
358+
}
343359

344-
.data {
345-
text-align: right;
346-
margin-left: auto;
347-
min-width: 80px;
360+
.popup__additional {
361+
padding: 0.5rem 1rem;
362+
display: flex;
363+
flex-direction: column;
364+
flex-grow: 1;
365+
justify-content: space-between;
366+
367+
p {
368+
text-align: center;
369+
color: $Type-Secondary;
370+
a {
371+
svg {
372+
color: $Type-Secondary;
348373
}
349374
}
350375
}
351376
}
352377
}
378+
379+
//common styles for Road weather and Regional weather
380+
.data-card {
381+
margin: 0.75rem 0;
382+
padding: 0.75rem;
383+
border-radius: 8px;
384+
box-shadow: 0px 6.4px 14.4px 0px rgba(0, 0, 0, 0.13), 0px 1.2px 3.6px 0px rgba(0, 0, 0, 0.10);
385+
386+
&__row {
387+
display: flex;
388+
389+
& + .data-card__row {
390+
margin-top: 0.75rem;
391+
padding-top: 0.75rem;
392+
border-top: 1px solid $Divider;
393+
}
394+
395+
&:not(.group) {
396+
.data-icon {
397+
align-self: center;
398+
}
399+
}
400+
401+
.data-icon {
402+
margin-right: 0.75rem;
403+
}
404+
405+
.data-group {
406+
flex: 1 0;
407+
408+
&__row {
409+
display: flex;
410+
}
411+
}
412+
}
413+
414+
.label, .data {
415+
font-size: 0.875rem;
416+
margin-bottom: 0;
417+
}
418+
419+
.label {
420+
text-align: left;
421+
font-weight: 700;
422+
}
423+
424+
.data {
425+
text-align: right;
426+
margin-left: auto;
427+
min-width: 80px;
428+
color: $Type-Secondary;
429+
}
430+
}
353431
}
354432

0 commit comments

Comments
 (0)