Skip to content
This repository was archived by the owner on Aug 3, 2021. It is now read-only.

Commit 7c0ec1e

Browse files
committed
better cabinet toggling
1 parent 4c14939 commit 7c0ec1e

File tree

1 file changed

+36
-64
lines changed

1 file changed

+36
-64
lines changed

src/components/Map.vue

Lines changed: 36 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@
3838
<gmap-polygon :options="polygonOptions" :paths="paths"></gmap-polygon>
3939
</GmapMap>
4040
<!-- "top: 0; right: 0; width: calc(100% - 100px); position: absolute; z-index: 100" -->
41-
<div
42-
v-if="!hamburger"
43-
style="position: absolute; top: 70px; z-index: 999;"
44-
class="w-full"
45-
>
41+
<div v-if="!hamburger" style="position: absolute; top: 70px; z-index: 999;" class="w-full">
4642
<label>
4743
<gmap-autocomplete
4844
placeholder="Type an address Ex. Filellinon 10, Athens, Greece"
@@ -55,74 +51,62 @@
5551
@click="addButton"
5652
>
5753
Add
58-
</button> -->
54+
</button>-->
5955
</label>
6056
</div>
61-
<div class="relative h-full w-full">
62-
<div
63-
class="absolute bottom-0 right-0 h-64 w-48"
64-
style="text-align: left;"
65-
>
57+
<div class="relative h-full w-full" v-if="!hamburger">
58+
<div class="absolute bottom-0 right-0 h-64 w-16" style="text-align: left;">
6659
<button
6760
@click="
6861
buttons.ote.isOn = !buttons.ote.isOn;
69-
showCabinets('ote');
70-
"
71-
:class="
72-
buttons.ote.isOn
62+
showCabinets('ote'); buttons.ote.isOn
7363
? (buttons.ote.text = '✔ OTE')
7464
: (buttons.ote.text = 'OTE')
7565
"
76-
type="button"
66+
:class="buttons.ote.isOn ? 'bg-blue-300': 'bg-blue-700'"
7767
style="position: fixed; z-index: 999; bottom: 600px;"
78-
class="bg-blue-700 hover:bg-blue-500 text-white font-bold py-2 px-4 rounded"
68+
class="hover:bg-blue-500 text-white font-bold py-2 px-4 rounded"
7969
>
80-
{{ buttons.ote.text }}
70+
<img :src="markerIcons.OTE" />
8171
</button>
8272
<button
8373
@click="
8474
buttons.wind.isOn = !buttons.wind.isOn;
85-
showCabinets('wind');
86-
"
87-
:class="
88-
buttons.wind.isOn
75+
showCabinets('wind'); buttons.wind.isOn
8976
? (buttons.wind.text = '✔ WIND')
9077
: (buttons.wind.text = 'WIND')
9178
"
79+
:class="buttons.wind.isOn ? 'bg-blue-400': 'bg-blue-500'"
9280
style="position: fixed; z-index: 999; bottom: 550px;"
93-
class="bg-blue-500 hover:bg-blue-400 text-white font-bold py-2 px-4 rounded"
81+
class="hover:bg-blue-400 text-white font-bold py-2 px-4 rounded"
9482
>
95-
{{ buttons.wind.text }}
83+
<img :src="markerIcons.WIND" />
9684
</button>
9785
<button
9886
@click="
9987
buttons.vf.isOn = !buttons.vf.isOn;
100-
showCabinets('vf');
101-
"
102-
:class="
103-
buttons.vf.isOn
88+
showCabinets('vf'); buttons.vf.isOn
10489
? (buttons.vf.text = '✔ Vodafone')
10590
: (buttons.vf.text = 'Vodafone')
10691
"
92+
:class="buttons.vf.isOn ? 'bg-red-300': 'bg-red-700'"
10793
style="position: fixed; z-index: 999; bottom: 500px;"
108-
class="bg-red-700 hover:bg-red-500 text-white font-bold py-2 px-4 rounded"
94+
class="hover:bg-red-500 text-white font-bold py-2 px-4 rounded"
10995
>
110-
{{ buttons.vf.text }}
96+
<img :src="markerIcons.Vodafone" />
11197
</button>
11298
<button
11399
@click="
114100
buttons.rurcon.isOn = !buttons.rurcon.isOn;
115-
showCabinets('rurcon');
116-
"
117-
:class="
118-
buttons.rurcon.isOn
119-
? (buttons.rurcon.text = '✔ Rural Connect')
120-
: (buttons.rurcon.text = 'Rural Connect')
101+
showCabinets('rurcon'); buttons.rurcon.isOn
102+
? (buttons.rurcon.text = '✔')
103+
: (buttons.rurcon.text = '')
121104
"
105+
:class="buttons.rurcon.isOn ? 'bg-orange-300': 'bg-orange-800'"
122106
style="position: fixed; z-index: 999; bottom: 450px;"
123-
class="bg-orange-800 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded"
107+
class="hover:bg-orange-700 text-white font-bold py-2 px-4 rounded"
124108
>
125-
{{ buttons.rurcon.text }}
109+
<img :src="markerIcons.RURALCONNECT" />
126110
</button>
127111
</div>
128112
</div>
@@ -148,35 +132,29 @@
148132
class="rounded relative h-48 w-36 left-2 invisible lg:visible xl:visible"
149133
style="position: relative; top: 250px; z-index: 999;"
150134
>
151-
<div
152-
class="rounded bg-white shadow-md h-48 w-36 p-6 flex flex-col justify-around"
153-
>
135+
<div class="rounded bg-white shadow-md h-48 w-36 p-6 flex flex-col justify-around">
154136
<div>
155137
<p class="text-base text-gray-600">Cabinets</p>
156138
</div>
157139
<div>
158140
<p class="text-2xl text-gray-700 font-bold">
159-
<animated-number
160-
:value="numberOfCabinets"
161-
:duration="3000"
162-
round="1"
163-
/>
141+
<animated-number :value="numberOfCabinets" :duration="3000" round="1" />
164142
</p>
165143
</div>
166144
<div>
167145
<p class="text-base text-gray-600">Centers</p>
168146
</div>
169147
<div>
170148
<p class="text-2xl text-gray-700 font-bold">
171-
<animated-number
172-
:value="numberOfCenters"
173-
:duration="5000"
174-
round="1"
175-
/>
149+
<animated-number :value="numberOfCenters" :duration="5000" round="1" />
176150
</p>
177151
</div>
178152
</div>
179153
</div>
154+
<div
155+
style="position: absolute; bottom: 0px; z-index: 0;"
156+
class="w-full text-base text-white"
157+
>hello@fttx.gr</div>
180158
</div>
181159
</template>
182160
<script>
@@ -306,7 +284,7 @@ export default {
306284
const infowindow = new google.maps.InfoWindow({
307285
content: d.infoText,
308286
});
309-
marker.addListener("click", function() {
287+
marker.addListener("click", function () {
310288
this.showInfo;
311289
infowindow.open(this.map, marker);
312290
});
@@ -343,7 +321,7 @@ export default {
343321
});
344322
marker.setVisible(false);
345323
marker.db = d;
346-
marker.addListener("click", function() {
324+
marker.addListener("click", function () {
347325
ref.infoWindow(marker);
348326
});
349327
this.markers.push(marker);
@@ -392,15 +370,15 @@ export default {
392370
icon: this.markerIcons[format[cab]],
393371
});
394372
marker.db = d;
395-
marker.addListener("click", function() {
373+
marker.addListener("click", function () {
396374
ref.infoWindow(marker);
397375
});
398376
this.markers.push(marker);
399377
temp.push(marker);
400378
});
401379
}
402380
this.markerCluster.addMarkers(temp);
403-
this.$toast.success(`Loaded ${buttons[cab]} cabinets`);
381+
this.$toast.success(`Loaded ${format[cab]} cabinets`);
404382
// this.clusterMyMarkers();
405383
}
406384
if (!this.buttons[cab].isOn) {
@@ -409,7 +387,7 @@ export default {
409387
ca.setVisible(false);
410388
});
411389
this.clusterMyMarkers("clear");
412-
this.$toast.warning(`Unloaded ${buttons[cab]} cabinets`);
390+
this.$toast.warning(`Unloaded ${format[cab]} cabinets`);
413391
}
414392
},
415393
infoWindow(marker) {
@@ -589,14 +567,8 @@ export default {
589567
}
590568
591569
return {
592-
lat: this.map
593-
.getCenter()
594-
.lat()
595-
.toFixed(4),
596-
lng: this.map
597-
.getCenter()
598-
.lng()
599-
.toFixed(4),
570+
lat: this.map.getCenter().lat().toFixed(4),
571+
lng: this.map.getCenter().lng().toFixed(4),
600572
};
601573
},
602574
},

0 commit comments

Comments
 (0)