Skip to content

Commit 51e4f39

Browse files
authored
added color mappings to availability map (#325)
* updated svelte * fixed compass error * added color mappings to the availability map
1 parent 0c23543 commit 51e4f39

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/components/availabilitymapday1.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
);
1010
const responseData = await response.json();
1111

12-
responseData.day1.forEach((spot: { id: string; occupied: any }) => {
12+
responseData.day1.forEach((spot: { id: string; occupied: string }) => {
1313
const spotId = "spot-" + spot.id;
1414
var elem = document.getElementById(spotId);
15-
if (elem !== null && spot.occupied) {
15+
if (elem !== null && spot.occupied == "red") {
1616
elem.style.fill = "#ef403d";
17+
} else if (elem !== null && spot.occupied == "orange") {
18+
elem.style.fill = "#f99548";
1719
}
1820
});
1921

src/components/availabilitymapday2.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
);
1010
const responseData = await response.json();
1111

12-
responseData.day2.forEach((spot: { id: string; occupied: any }) => {
12+
responseData.day2.forEach((spot: { id: string; occupied: string }) => {
1313
const spotId = "day2-spot-" + spot.id;
1414
var elem = document.getElementById(spotId);
15-
if (elem !== null && spot.occupied) {
15+
if (elem !== null && spot.occupied == "red") {
1616
elem.style.fill = "#ef403d";
17+
} else if (elem !== null && spot.occupied == "orange") {
18+
elem.style.fill = "#f99548";
1719
}
1820
});
1921
</script>

src/pages/availability.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ import Layout from "~/layouts/Layout.astro";
1818
about securing a spot.
1919
<br />
2020
A green dot means that the spot is available to reserve, a red that it is not.
21-
A golden dot means it is reserved for the luxury package. It is optional to
22-
reserve a spot, otherwise your company will be placed at an appropriate place.
21+
An orange spot is a preliminary reserved spot, however, it is still possible
22+
to pay the reservation fee to reserve the spot. A golden dot means that the
23+
luxury package is needed to be able to reserve it. It is optional to reserve
24+
a spot, otherwise your company will be placed at an appropriate place.
2325
<div class="text-center">
2426
<div class="font-bold text-lg">Day 1</div>
2527
<Availabilitymapday1 />

0 commit comments

Comments
 (0)