Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

id rename name change #759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
89 changes: 45 additions & 44 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<audio id="shieldSound" src="shield.wav"></audio>
<audio id="healthBoostSound" src="health-boost-sound.m4a"></audio>
<audio id="speedBoostSound" src="speed-boost.m4a"></audio>
<audio id="shieldSound" src="shield.m4a"></audio>
<audio id="shieldSound2" src="shield.m4a"></audio>
<audio id="congratsSound" src="congrats.wav"></audio>

<style>
Expand Down Expand Up @@ -397,9 +397,9 @@
/* Rounded edges for a smoother look */
}
</style>
<!-- on scroll progress bar -->
<!-- on scroll progress bar -->
<div class="progress-bar-container">
<div class="progress-bar" id="progress-bar"></div>
<div class="progress-bar" id="progress-bar"></div>
</div>

<div id="popup-nl" class="popup-nl">
Expand Down Expand Up @@ -454,14 +454,14 @@ <h2 class="uppercase">What power-up do you find most helpful?</h2>
</div>

<script>
window.onscroll = function () {
const totalHeight = document.documentElement.scrollHeight - window.innerHeight;
const scrollPosition = window.pageYOffset;
const scrollPercentage = (scrollPosition / totalHeight) * 100;
document.getElementById(
"progress-bar"
).style.width = `${scrollPercentage}%`;

window.onscroll = function () {
const totalHeight = document.documentElement.scrollHeight - window.innerHeight;
const scrollPosition = window.pageYOffset;
const scrollPercentage = (scrollPosition / totalHeight) * 100;
document.getElementById(
"progress-bar"
).style.width = `${scrollPercentage}%`;
};


Expand Down Expand Up @@ -564,9 +564,9 @@ <h2 class="uppercase">What power-up do you find most helpful?</h2>
<!-- <img src="assets/images/logo1-.png" alt="logo" height="80px" class="image"> -->
<div class="title5">
<a href="about.html" class="home">
<h1 class="site-name">Alien Invasion Defense</h1>
<h1 class="site-name">Alien Invasion Defense</h1>

<i class="fa-solid fa-paintbrush" style="margin: 25px 0 0 0;"></i>
<i class="fa-solid fa-paintbrush" style="margin: 25px 0 0 0;"></i>
</div>
<!-- <div class="nav-links">
<a href="index.html">Home</a>
Expand Down Expand Up @@ -627,13 +627,13 @@ <h2 class="primary-btn" id="logoutButton" style="display: none;">
</div>
<div id="faqbtn">
<a href="./login.html">
<button class="primary-btn" id="signupButton" window.location.href="/Login and Signup/index.html">
Signup/Register
</button>
</a>
</div>
<button class="primary-btn" id="signupButton" window.location.href="/Login and Signup/index.html">
Signup/Register
</button>
</a>
</div>

<!-- <div class="theme-switch-wrapper">
<!-- <div class="theme-switch-wrapper">


<div id="faqbtn">
Expand Down Expand Up @@ -712,14 +712,14 @@ <h2 class="primary-btn" id="logoutButton" style="display: none;">
<!-- Congratulatory Popup -->
<div id="congratsPopup" style="display: none;">
<div class="popupContent">
<h2>Congratulations!</h2>
<p>You've beat your high score!</p>
<p>Your new high score is: <span id="newHighScore"></span></p>
<button id="closePopupBtn">Close</button>
<h2>Congratulations!</h2>
<p>You've beat your high score!</p>
<p>Your new high score is: <span id="newHighScore"></span></p>
<button id="closePopupBtn">Close</button>
</div>
</div>
</div>



<header>

Expand Down Expand Up @@ -790,28 +790,29 @@ <h2>Congratulations!</h2>
<div id="liveLife">LIVE LIFE: <span id="lives">3</span></div>

<!-- Profile Icon -->

<a href="./profile.html" class="profile-link" style="display: flex; align-items: center; text-decoration: none;">
<img id="homeProfileImage" src="https://i.postimg.cc/NFFmtc9K/xnz-Mst5-V-400x400.jpg"
alt="Profile Icon"
style="width: 50px; height: 50px; border-radius: 50%; margin-top: -57px; margin-left: 220px;">
</a>

<a href="./profile.html" class="profile-link"
style="display: flex; align-items: center; text-decoration: none;">
<img id="homeProfileImage" src="https://i.postimg.cc/NFFmtc9K/xnz-Mst5-V-400x400.jpg"
alt="Profile Icon"
style="width: 50px; height: 50px; border-radius: 50%; margin-top: -57px; margin-left: 220px;">
</a>
</li>

<script>

document.addEventListener("DOMContentLoaded", function() {
// Retrieve the saved avatar from localStorage
const savedAvatar = localStorage.getItem("selectedAvatar");

// If an avatar is saved, update the profile image
if (savedAvatar) {
const homeProfileImage = document.getElementById("homeProfileImage");
if (homeProfileImage) {
homeProfileImage.src = savedAvatar;

document.addEventListener("DOMContentLoaded", function () {
// Retrieve the saved avatar from localStorage
const savedAvatar = localStorage.getItem("selectedAvatar");

// If an avatar is saved, update the profile image
if (savedAvatar) {
const homeProfileImage = document.getElementById("homeProfileImage");
if (homeProfileImage) {
homeProfileImage.src = savedAvatar;
}
}
}
});
});

</script>

Expand Down