-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
86 lines (79 loc) · 2 KB
/
Copy pathstyle.css
File metadata and controls
86 lines (79 loc) · 2 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
/*
Basic styling for the pixel world map game.
This file defines the layout for the map, pixel canvas and colour palette.
*/
html,
body {
height: 100%;
margin: 0;
overflow: hidden;
font-family: Arial, sans-serif;
}
/*
The palette sits at the top of the page. It contains small swatches
representing the available colours. When a colour is selected the
swatch receives a border.
*/
#palette {
height: 60px;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 6px;
padding: 5px;
background-color: #f5f5f5;
border-bottom: 1px solid #ccc;
}
.color-swatch {
width: 30px;
height: 30px;
border: 2px solid transparent;
cursor: pointer;
box-sizing: border-box;
}
.color-swatch.selected {
border-color: #333;
}
/*
The map container occupies the remainder of the viewport below the palette.
It holds the Leaflet map and a canvas overlay for our pixel grid.
*/
/*
The map container holds the world map image and pixel overlay. It occupies
all available vertical space beneath the palette and scrolls if the
content exceeds the viewport height. A relative position enables us
to absolutely position the canvas overlay inside it.
*/
#map-container {
position: relative;
width: 100%;
height: calc(100vh - 60px);
overflow: auto;
}
/*
The Leaflet map takes up the full space of its container.
*/
/* Remove the Leaflet map styles now that we are using a static image. */
/*
Our pixel canvas sits above the map but does not intercept pointer events.
This allows the user to pan/zoom the map normally. The canvas is used
solely for drawing coloured squares corresponding to the pixel grid.
*/
#pixelCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
pointer-events: none;
}
/* The world map image should scale to the width of its container while
maintaining aspect ratio. Setting display:block removes the default
inline spacing. */
#worldMap {
width: 100%;
height: auto;
display: block;
}