Skip to content

Commit 6961b5e

Browse files
Add resetButton (#10)
Add reset map button
1 parent 40981c5 commit 6961b5e

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717

1818
<div id="map_container"></div>
1919

20+
<div id="buttonGroup">
21+
<button id="reset_button" onclick="resetButton()">Sıfırla</button>
22+
<a id="github_logo" href="https://github.com/ozanyerli" target="_blank" rel="noopener noreferrer"><img src="images/GitHub-Mark-32px.png" alt="Github page link"></a>
23+
</div>
2024
<button id="download_button" onclick="downloadMap()">Haritayı İndir</button>
2125

22-
<a id="github_logo" href="https://github.com/ozanyerli" target="_blank" rel="noopener noreferrer"><img src="images/GitHub-Mark-32px.png" alt="Github page link"></a>
23-
2426
<div id="city_count_text">Seçilen il sayısı:&nbsp;<span id="city_count">0</span>/81</div>
2527

2628
<script src="turkeyvisited.js"></script>
2729

2830
</body>
2931

30-
</html>
32+
</html>

styles.css

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ html {
4444

4545
#download_button {
4646
margin-left: 335px;
47-
margin-top: 1em;
47+
margin-top: 0.5em;
4848
padding: 0.5em 1.7em;
4949
border: 0.16em solid rgb(255, 255, 255);
5050
border-radius: 2em;
@@ -56,6 +56,7 @@ html {
5656
text-shadow: 0 0.04em 0.04em rgba(255, 255, 255, 0.253);
5757
text-align: center;
5858
transition: all 0.2s;
59+
cursor: pointer;
5960
}
6061

6162
#download_button:hover {
@@ -66,4 +67,29 @@ html {
6667
#github_logo {
6768
margin-left: 1000px;
6869
opacity: 0.5;
69-
}
70+
}
71+
72+
#reset_button {
73+
padding: 0.5em 1.7em;
74+
border: 0.16em solid rgb(255, 255, 255);
75+
border-radius: 2em;
76+
box-sizing: border-box;
77+
text-decoration: none;
78+
font-family: "Roboto", sans-serif;
79+
font-weight: 300;
80+
color: #000000;
81+
text-shadow: 0 0.04em 0.04em rgba(255, 255, 255, 0.253);
82+
text-align: center;
83+
transition: all 0.2s;
84+
cursor: pointer;
85+
}
86+
87+
#reset_button:hover {
88+
color: black;
89+
background-color: #EFAE88;
90+
}
91+
92+
#buttonGroup {
93+
margin-left: 335px;
94+
margin-top: 1em;
95+
}

turkeyvisited.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,9 @@ function downloadMap() {
133133
});
134134
});
135135
}
136+
137+
function resetButton() {
138+
localStorage.removeItem("selectedCities")
139+
cityCount = 0; document.getElementById("city_count").innerHTML = cityCount;
140+
location.reload()
141+
}

0 commit comments

Comments
 (0)