-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DanFitzgibbon/feature/birthday-card
Add Birthday Card for 2024
- Loading branch information
Showing
6 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Gift Website</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="gif-container"> | ||
<img id="gift-gif" src="gift.gif" alt="Gift GIF"> | ||
</div> | ||
<div class="present-container"> | ||
<img id="gift-image" src="" alt="Gift Image"> | ||
</div> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const gif = document.getElementById('gift-gif'); | ||
const presentContainer = document.querySelector('.present-container'); | ||
const giftImage = document.getElementById('gift-image'); | ||
|
||
gif.addEventListener('click', () => { | ||
gif.style.display = 'none'; | ||
presentContainer.style.display = 'block'; | ||
|
||
// Animation for opening the gift image | ||
setTimeout(() => { | ||
giftImage.src = 'opened-gift.gif'; | ||
}, 500); // delay for 0.5 seconds | ||
|
||
// Repeat the animation every second | ||
setInterval(() => { | ||
const newSrc = giftImage.src === 'opened-gift.gif' ? 'gift.gif' : 'opened-gift.gif'; | ||
giftImage.src = newSrc; | ||
}, 1000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.gif-container { | ||
text-align: center; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
|
||
#gift-gif, #gift-image { | ||
margin: 0 auto; | ||
} | ||
|
||
.present-container { | ||
text-align: center; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} |