Skip to content

Commit 575d88c

Browse files
committed
feature: add about icon and popup for project information
1 parent 03b2128 commit 575d88c

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
<div class="settings-icon">
1515
<i class="fas fa-cog"></i>
1616
</div>
17+
<!-- Added about icon next to settings icon -->
18+
<div class="about-icon">
19+
<i class="fas fa-info-circle"></i>
20+
</div>
1721
<div class="config">
18-
<span class="page-title">WishSim</span>
22+
<span class="page-title">WishSim<sup>v4</sup></span>
1923
<div class="banners">
2024
<button id="venti-button">Venti</button>
2125
<button id="standard-button">Standard</button>
@@ -37,12 +41,17 @@
3741
<option value="custom">Custom</option>
3842
</select>
3943
</div>
40-
<!-- New custom URL input container -->
4144
<div id="custom-url-container" class="input-container" style="display: none;">
4245
<input type="text" id="custom-url-input" placeholder="Enter image URL">
4346
<button id="save-custom-url">Save</button>
4447
</div>
4548
</div>
49+
50+
<div id="about-popup" class="popup" style="display: none;">
51+
<span class="close-button">&times;</span>
52+
<h2>About This Project</h2>
53+
<p>Yes this is the FOURTH time I've built this project. Each time I've learnt something new, which is probably normal and good :D <br/><br/>Anyway, here's the <a href="https://github.com/sunrayyourdev/wish-simulator" target="_blank">repo</a>. Ingat!</p>
54+
</div>
4655
<script src="script.js"></script>
4756
</body>
4857
</html>

script.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ document.querySelector('.popup .close-button').addEventListener('click', functio
2525
document.getElementById('settings-popup').style.display = 'none';
2626
});
2727

28+
document.querySelector('.about-icon').addEventListener('click', function(event) {
29+
event.stopPropagation();
30+
const aboutPopup = document.getElementById('about-popup');
31+
aboutPopup.style.display = aboutPopup.style.display === 'none' || aboutPopup.style.display === '' ? 'flex' : 'none';
32+
});
33+
34+
document.querySelector('#about-popup .close-button').addEventListener('click', function() {
35+
document.getElementById('about-popup').style.display = 'none';
36+
});
37+
2838
window.addEventListener('click', function(event) {
2939
const popup = document.getElementById('settings-popup');
3040
if (!popup.contains(event.target)) {

style.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ body {
2929
font-size: 2em;
3030
}
3131

32+
.page-title sup {
33+
font-size: 0.5em; /* reduces sup size to 50% of parent */
34+
}
35+
3236
.page-subtitle {
3337
font-size: 1.8em;
3438
}
@@ -82,6 +86,16 @@ button {
8286
cursor: pointer;
8387
}
8488

89+
/* New styling for the about icon */
90+
.about-icon {
91+
position: absolute;
92+
top: 10px;
93+
left: 3rem; /* positioned next to settings icon */
94+
font-size: 1.5em;
95+
cursor: pointer;
96+
color: white;
97+
}
98+
8599
.popup {
86100
display: none;
87101
flex-direction: column;

0 commit comments

Comments
 (0)