Skip to content

Commit 0dd1eaa

Browse files
committed
Refactor button structure in search box and improve formatting in script.js
1 parent c86fc13 commit 0dd1eaa

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ <h1 class="text-3xl font-bold text-center text-blue-600 mb-4">Weather App</h1>
2727
<input type="text" placeholder="Enter City"
2828
class="flex-1 px-4 py-2 rounded-md border border-blue-300 focus:outline-none focus:ring-2 focus:ring-blue-500 transition" />
2929

30-
<button class="bg-blue-600 cursor-pointer text-white px-4 py-2 rounded-md hover:bg-blue-700 active:bg-blue-800 transition">
31-
Search
32-
</button>
30+
<button class="bg-blue-600 cursor-pointer text-white px-4 py-2 rounded-md hover:bg-blue-700 active:bg-blue-800 transition">Search</button>
3331

3432
<button id="geo-btn"
3533
class="bg-gray-600 cursor-pointer text-white px-4 py-2 rounded-md hover:bg-gray-700 active:bg-gray-800 transition">
36-
<i title="Use Current Location" class="fa-sharp fa-solid fa-location-dot text-2xl"></i> </button>
34+
<i title="Use Current Location" class="fa-sharp fa-solid fa-location-dot text-2xl"></i>
35+
</button>
3736
</div>
3837

3938

script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ document.getElementById("geo-btn").addEventListener("click", () => {
111111
const data = await response.json();
112112

113113
displayWeatherInfo(data);
114-
showWeatherInfoBox();
114+
showWeatherInfoBox();
115115
},
116116
function (error) {
117117
alert("Unable to retrieve your location.");
@@ -128,5 +128,5 @@ document.addEventListener("DOMContentLoaded", () => {
128128
})
129129

130130
function showWeatherInfoBox() {
131-
weatherInfoBox.style.display='flex';
131+
weatherInfoBox.style.display = 'flex';
132132
}

0 commit comments

Comments
 (0)