Skip to content

Commit 34eb0b8

Browse files
committed
fix overlapping + refactoring
1 parent a5aa137 commit 34eb0b8

File tree

2 files changed

+38
-190
lines changed

2 files changed

+38
-190
lines changed

src/App.svelte

Lines changed: 0 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<script>
22
import { onMount } from 'svelte';
3-
import Options from './Options.svelte';
4-
import Time from './Time.svelte';
5-
import Legend from './Legend.svelte';
63
import MapBox from './MapBox.svelte';
7-
import Graph from './Graph.svelte';
84
95
import {
106
sensorMap,
@@ -387,150 +383,6 @@
387383
</script>
388384

389385
<style>
390-
.options-container {
391-
position: absolute;
392-
top: 110px;
393-
left: 10px;
394-
max-width: 210px;
395-
z-index: 1001;
396-
background-color: rgba(255, 255, 255, 0.9);
397-
padding: 10px 10px;
398-
box-sizing: border-box;
399-
transition: all 0.1s ease-in;
400-
}
401-
402-
.legend-container {
403-
position: absolute;
404-
top: 315px;
405-
left: 10px;
406-
z-index: 1000;
407-
display: flex;
408-
flex-direction: column;
409-
align-items: center;
410-
justify-content: center;
411-
transition: all 0.1s ease-in;
412-
height: 35%;
413-
}
414-
415-
/* .graph-container {
416-
position: absolute;
417-
z-index: 1001;
418-
bottom: 24px;
419-
right: 10px;
420-
background-color: rgba(255, 255, 255, 0.9);
421-
padding: 5px 5px;
422-
box-sizing: border-box;
423-
transition: opacity 0.3s ease-in-out;
424-
visibility: hidden;
425-
opacity: 0;
426-
}
427-
428-
.graph-container.show {
429-
visibility: visible;
430-
opacity: 1;
431-
}
432-
433-
.hide-graph-button-anchor {
434-
position: relative;
435-
}
436-
437-
.hide-graph-button {
438-
position: absolute;
439-
top: 0;
440-
left: 0;
441-
width: 14px;
442-
height: 14px;
443-
color: #333;
444-
font-size: 12px;
445-
display: flex;
446-
justify-content: center;
447-
align-items: center;
448-
cursor: pointer;
449-
background-color: transparent;
450-
padding: 0;
451-
border: 0;
452-
transition: opacity 0.1s ease-in;
453-
opacity: 0.7;
454-
}
455-
456-
.hide-graph-button:hover {
457-
opacity: 1;
458-
}
459-
460-
.graph-toggole-button-container {
461-
position: absolute;
462-
float: right;
463-
z-index: 1001;
464-
bottom: 24px;
465-
right: 10px;
466-
background-color: rgba(255, 255, 255, 0.9);
467-
padding: 5px 5px;
468-
box-sizing: border-box;
469-
}
470-
471-
.graph-toggle-button {
472-
width: 85px;
473-
height: 40px;
474-
font-size: 14px;
475-
cursor: pointer;
476-
color: #333;
477-
background-color: transparent;
478-
padding: 0;
479-
border: 0;
480-
transition: all 0.1s ease-in;
481-
position: relative;
482-
}
483-
484-
.graph-toggle-button:hover {
485-
background-color: #eee;
486-
}
487-
488-
button.graph-toggle-button .button-tooltip {
489-
visibility: hidden;
490-
width: 120px;
491-
border-style: solid;
492-
border-width: 1px;
493-
border-color: #666;
494-
background-color: #fff;
495-
color: #333;
496-
font-weight: 400;
497-
font-size: 14px;
498-
line-height: 14px;
499-
text-align: center;
500-
border-radius: 6px;
501-
padding: 5px 5px;
502-
position: absolute;
503-
z-index: 1;
504-
top: 0px;
505-
right: 120%;
506-
}
507-
508-
button.graph-toggle-button .button-tooltip::after {
509-
content: '';
510-
position: absolute;
511-
top: 50%;
512-
left: 100%;
513-
margin-top: -5px;
514-
border-width: 5px;
515-
border-style: solid;
516-
border-color: transparent transparent transparent #666;
517-
}
518-
519-
button.graph-toggle-button:hover .button-tooltip {
520-
visibility: visible;
521-
}
522-
523-
.time-container {
524-
position: absolute;
525-
bottom: 24px;
526-
left: 10px;
527-
z-index: 1002;
528-
background-color: rgba(255, 255, 255, 0.9);
529-
padding: 30px 10px;
530-
box-sizing: border-box;
531-
transition: all 0.1s ease-in;
532-
} */
533-
534386
.error-message-container {
535387
position: absolute;
536388
top: 0;
@@ -549,42 +401,3 @@
549401
{/if}
550402

551403
<MapBox {isIE} {graphShowStatus} {toggleGraphShowStatus} />
552-
553-
<div class="options-container">
554-
<Options {isIE} />
555-
</div>
556-
557-
<div class="legend-container">
558-
<Legend />
559-
</div>
560-
561-
<!-- <div class="time-container">
562-
<Time />
563-
</div> -->
564-
565-
<!-- {#if $mapFirstLoaded && !graphShowStatus}
566-
<div class="graph-toggole-button-container">
567-
<button
568-
title={isIE !== undefined ? 'Show time series' : ''}
569-
class="graph-toggle-button"
570-
aria-label="show time series"
571-
on:click={event => toggleGraphShowStatus(false)}>
572-
<span class="button-tooltip">Show time series</span>
573-
<b>View Time Graph</b>
574-
</button>
575-
</div>
576-
{/if}
577-
578-
<div class="graph-container {$mapFirstLoaded && graphShowStatus ? 'show' : ''}">
579-
<div class="hide-graph-button-anchor">
580-
<button
581-
title="Hide time series"
582-
aria-label="Hide time series"
583-
on:click={toggleGraphShowStatus}
584-
class="hide-graph-button">
585-
&#10005;
586-
</button>
587-
</div>
588-
589-
<Graph />
590-
</div> -->

src/MapBox.svelte

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import { defaultRegionOnStartup, getTextColorBasedOnBackground } from './util.js';
66
import { DIRECTION_THEME, MAP_THEME } from './theme.js';
77
import AutoComplete from 'simple-svelte-autocomplete';
8+
import Options from './Options.svelte';
9+
import Legend from './Legend.svelte';
810
import Time from './Time.svelte';
911
import Graph from './Graph.svelte';
1012
@@ -987,9 +989,34 @@
987989
width: 90%;
988990
}
989991
992+
.options-container {
993+
position: absolute;
994+
top: 12px;
995+
left: 10px;
996+
max-width: 210px;
997+
z-index: 1001;
998+
background-color: rgba(255, 255, 255, 0.9);
999+
padding: 10px 10px;
1000+
box-sizing: border-box;
1001+
transition: all 0.1s ease-in;
1002+
}
1003+
1004+
.legend-container {
1005+
position: absolute;
1006+
top: 220px;
1007+
left: 10px;
1008+
z-index: 1000;
1009+
display: flex;
1010+
flex-direction: column;
1011+
align-items: center;
1012+
justify-content: center;
1013+
transition: all 0.1s ease-in;
1014+
height: 40%;
1015+
}
1016+
9901017
.time-container {
9911018
position: absolute;
992-
bottom: 24px;
1019+
bottom: 12px;
9931020
left: 10px;
9941021
z-index: 1002;
9951022
background-color: rgba(255, 255, 255, 0.9);
@@ -1001,7 +1028,7 @@
10011028
.graph-container {
10021029
position: absolute;
10031030
z-index: 1001;
1004-
bottom: 24px;
1031+
bottom: 12px;
10051032
right: 10px;
10061033
background-color: rgba(255, 255, 255, 0.9);
10071034
padding: 5px 5px;
@@ -1047,7 +1074,7 @@
10471074
position: absolute;
10481075
float: right;
10491076
z-index: 1001;
1050-
bottom: 24px;
1077+
bottom: 12px;
10511078
right: 10px;
10521079
background-color: rgba(255, 255, 255, 0.9);
10531080
padding: 5px 5px;
@@ -1171,6 +1198,14 @@
11711198
</div>
11721199
{/if}
11731200
<div bind:this={container} class="map-container">
1201+
<div class="options-container">
1202+
<Options {isIE} />
1203+
</div>
1204+
1205+
<div class="legend-container">
1206+
<Legend />
1207+
</div>
1208+
11741209
<div class="state-buttons-holder">
11751210
<button
11761211
aria-label="show entire map"

0 commit comments

Comments
 (0)