Repository navigation
Expand file tree
/
Copy pathmaps.css
More file actions
111 lines (96 loc) · 2.78 KB
/
Copy pathmaps.css
File metadata and controls
111 lines (96 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
html, body {
margin: 0;
padding: 5;
height: 100%;
width: 100%;
display: flex;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
flex-flow: column;
}
#map {
position: relative;
width: 75%; /* Adjust width to your desired size */
height: 75%; /* Adjust height to your desired size */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional: subtle shadow for effect */
border-radius: 8px; /* Optional: rounded corners */
}
#map svg {
position: absolute; /* Position the SVG absolutely within the map container */
z-index: 1; /* Ensure the SVG is on top of other elements */
width: 100%; /* Make the SVG fill the width of the map container */
height: 100%; /* Make the SVG fill the height of the map container */
pointer-events: none;
z-index: 1;
}
#map svg circle {
fill: steelblue; /* Set the fill color to steelblue */
fill-opacity: 0.6; /* Set the fill opacity to 60% */
stroke: white; /* Set the stroke color to white */
stroke-width: 2; /* Set the stroke width */
pointer-events: auto;
--color-departures: steelblue;
--color-arrivals: darkorange;
--color: color-mix(
in oklch,
var(--color-departures) calc(100% * var(--departure-ratio)),
var(--color-arrivals)
);
fill: var(--color);
}
header {
display: flex;
gap: 1em;
align-items: baseline;
}
#time-display {
display: block;
}
#time-display em {
color: #aaa;
font-style: italic;
}
#time-filter {
width: 200px;
}
#time-display {
display: block;
}
#any-time {
color: #888; /* lighter color */
font-style: italic;
}
:root {
--color-departures: steelblue; /* Color for more departures */
--color-arrivals: orange; /* Color for more arrivals */
--color-balanced: purple; /* Color for balanced */
--color-balanced: hsl(270, 50%, 50%); /* Color for balanced */
--color: black; /* Example color for text */
}
/* Apply the color variables to both #map circle and .legend > div */
#map circle {
color: var(--color);
}
/* Style the legend container with flexbox and margin-block */
.legend {
display: flex;
justify-content: space-around; /* Align items horizontally with space around them */
margin-block: 1rem; /* Add space above and below the legend */
}
/* Style each legend item based on the --departure-ratio */
.legend > div {
position: relative;
padding: 0.5rem;
border: 1px solid var(--color);
width: 30%; /* Adjust the width as needed */
text-align: center; /* Center the text */
}
.legend > div:nth-child(1) {
background-color: var(--color-departures); /* More departures */
}
.legend > div:nth-child(2) {
background-color: var(--color-balanced); /* Balanced */
}
.legend > div:nth-child(3) {
background-color: var(--color-arrivals); /* More arrivals */
}