Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,105 @@ nav {
.prediction-desc {
font-size: 18px;
}
/* ... existing styles ... */

/* New styles for City Header and Bookmark Icon */
.city-header {
display: flex;
align-items: center;
gap: 15px; /* Spacing between city name and icon */
}

#bookmark-icon {
font-size: 24px;
cursor: pointer;
color: var(--PRIMARY-TEXT-COLOR); /* Default color */
transition: 0.2s all;
}

#bookmark-icon.bookmarked {
color: gold; /* Filled star color */
/* Use a filled star icon when bookmarked in JS: fa-solid fa-star */
}

/* Dark Mode adjustment for the bookmark icon */
.dark-mode .location #bookmark-icon {
color: var(--LIGHT-BG-COLOR);
}

.dark-mode .location #bookmark-icon.bookmarked {
color: gold;
}

/* || BOOKMARKED CITIES SECTION */
.bookmarked-cities {
margin-block: 20px;
padding: 10px;
}

.bookmarked-cities h3 {
font-size: 26px;
white-space: nowrap;
text-align: center;
padding-bottom: 10px;
border-bottom: 1px solid rgba(10, 35, 72, 0.1); /* Subtle separator */
}

#bookmarked-cities-list {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: 15px;
}

.bookmarked-city-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
border-radius: var(--STANDERED-RADIUS);
background-color: var(--LIGHT-BG-COLOR);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: background-color 0.2s, transform 0.1s;
}

.bookmarked-city-item:hover {
background-color: #e3e4e5; /* Slight hover effect */
transform: translateY(-1px);
}

.bookmarked-city-item .city-name {
font-weight: 600;
font-size: 16px;
}

.remove-bookmark-icon {
color: #d43114; /* Red color for remove icon */
font-size: 18px;
cursor: pointer;
padding: 5px; /* Increase click area */
}

/* Dark Mode styles for Bookmarked Cities */
.dark-mode .bookmarked-cities h3 {
color: var(--PRIMARY-TEXT-COLOR);
border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .bookmarked-city-item {
background-color: var(--SECONDARY-BG-COLOR);
color: var(--PRIMARY-TEXT-COLOR);
box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.dark-mode .bookmarked-city-item:hover {
background-color: #3f3f3f;
}

.dark-mode .bookmarked-city-item .city-name {
color: var(--PRIMARY-TEXT-COLOR);
}

/* || FOOTER */
/* footer {
Expand Down
84 changes: 15 additions & 69 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,13 @@
</head>

<body>
<!-- || LOCATION MODAL -->
<!-- The Modal -->
<div id="generic_modal" class="modal" data-open="open" data-closable="no">
<!-- Modal content -->
<div class="modal-content dynamic-bg">
<!-- close button -->
<!-- <span class="close">&times;</span> -->

<!-- contents inside modal -->
<h2>This app uses your current location</h2>
<p>
This app uses your location to provide better results. Please allow
location permission
<!-- end of contents inside modal -->
</p>
<!-- an IIFE is set to invoke the function on button call -->
</p>
<button class="ok-btn" onclick="(() => {
updateCurrentLocation()
closeModal(true)
Expand All @@ -38,14 +29,14 @@ <h2>This app uses your current location</h2>
</div>
</div>

<!-- || STARTING -->
<div class="container">
<!--|| MAIN WEATHER REPORT BOX (RIGHT-SIDE) -->
<div class="weather-report">
<!-- || NAVIGATION BAR -->
<nav>
<div class="location">
<h2 id="city">New Delhi</h2>
<div class="city-header">
<h2 id="city">New Delhi</h2>
<i id="bookmark-icon" class="fa-regular fa-star"></i>
</div>
<h3 id="country">
<i class="fa-sharp fa-solid fa-location-dot"></i>India
</h3>
Expand All @@ -60,7 +51,6 @@ <h3 id="country">
<span class="bar"></span>
</div>

<!-- Dark Mode button -->
<div class="dark-mode-toggle">
<label class="switch">
<input type="checkbox" id="darkModeToggle" />
Expand All @@ -70,9 +60,7 @@ <h3 id="country">
</div>
</nav>

<!-- || CURRENT WEATHER STATUS BOX -->
<div class="current-status">
<!-- BOX-1 MAIN WEATHER BOX-->
<div class="weather weather-box1">
<div class="weather-heading">
<div class="weather-icon">
Expand Down Expand Up @@ -111,8 +99,6 @@ <h3 id="humidity">87%</h3>
</div>
</div>

<!--|| Box-2 -->
<!-- Sunrise and Sunset-->
<div class="weather weather-box2">
<div class="more-details">
<div class="more-detail-box">
Expand All @@ -135,8 +121,6 @@ <h3 id="sunset-time">5:56 PM</h3>
</div>
</div>

<!-- and UVI Index -->

<div class="more-detail-box uvi-rays-area">
<img src="images/clear.png" alt="" />
<div class="uvi-mesurement">
Expand All @@ -154,7 +138,6 @@ <h3 id="sunset-time">5:56 PM</h3>
</div>
</div>

<!-- || 24 HOURS WEATHER UPDATES -->
<div class="hourly-temperature">
<div class="hourly-temperature-heading">
<h2>
Expand Down Expand Up @@ -310,9 +293,7 @@ <h2>
</div>
</div>

<!-- || SLIDEBAR -->
<div class="slidebar">
<!-- Time and Date -->
<div class="time-date">
<h2 class="time">12:03:40 AM</h2>
<p class="date">7 March 2023, Monday</p>
Expand All @@ -334,7 +315,15 @@ <h2 class="aqi-title">Air Quality</h2>
</div>
</div>

<!-- || Next 6 Days Weather report -->
<div class="bookmarked-cities">
<h3>Bookmarked Cities 📌</h3>
<div id="bookmarked-cities-list">
<div class="bookmarked-city-item" data-city-name="New York">
<span class="city-name">New York</span>
<i class="fa-solid fa-xmark remove-bookmark-icon"></i>
</div>
</div>
</div>
<div class="weather-prediction">
<h3>3 Days Forecast</h3>

Expand Down Expand Up @@ -374,53 +363,10 @@ <h3>3 Days Forecast</h3>
<div class="days-temp">26°c <span>/</span> 19°c</div>
</div>

<!-- <div class="days-box">
<div>
<img class="days-icon" src="images/clouds.png" alt="">
<div class="days">
<div class="prediction-day">Sunday 10</div>
<div class="prediction-desc">Cloudy</div>

</div>
</div>

<div class="days-temp">26°c <span>/</span> 19°c</div>
</div>

<div class="days-box">
<div>
<img class="days-icon" src="images/clouds.png" alt="">
<div class="days">
<div class="prediction-day">Sunday 10</div>
<div class="prediction-desc">Cloudy</div>

</div>
</div>

<div class="days-temp">26°c <span>/</span> 19°c</div>
</div>

<div class="days-box">
<div>
<img class="days-icon" src="images/clouds.png" alt="">
<div class="days">
<div class="prediction-day">Sunday 10</div>
<div class="prediction-desc">Cloudy</div>

</div>
</div>

<div class="days-temp">26°c <span>/</span> 19°c</div>
</div> -->
</div>
</div>
</div>
</div>

<!--|| FOOTER -->
<!-- <footer>
<div class="copyright">Copyrights <span style="font-size: 16px;">&copy;</span> <span id="copyright">2023</span></div>
</footer> -->

<div class="s-footer">
<footer class="footer">
<div class="waves">
Expand Down
Loading