Skip to content
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
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,91 @@ You’re free to use, remix, and improve β€” just give credit where it’s due
Built with passion by **[Courage Paul (CourageCodeJourney)](https://github.com/CourageCodeJourney)**

> β€œCreativity begins when you turn logic into art.” 🌌
## ✨ Shining Stars Animation

This animation adds a beautiful shining stars effect to the background of the webpage, creating a galactic theme for the project.

### πŸͺ Preview
![Stars Animation Preview](https://media.giphy.com/media/3oEjI6SIIHBdRxXI40/giphy.gif)

### πŸ’» How It Works
The effect uses CSS animations with multiple layers of moving star textures to simulate a galaxy-like motion.

```html
<!-- Shining Stars Animation -->
<div class="stars"></div>
<div class="twinkling"></div>

<style>
.stars, .twinkling {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
z-index: -1;
}

.stars {
background: url('https://www.script-tutorials.com/demos/360/images/stars.png') repeat;
animation: moveStars 200s linear infinite;
}

.twinkling {
background: url('https://www.script-tutorials.com/demos/360/images/twinkling.png') repeat;
animation: moveTwinkling 200s linear infinite;
}

@keyframes moveStars {
from {background-position: 0 0;}
to {background-position: -10000px 5000px;}
}

@keyframes moveTwinkling {
from {background-position: 0 0;}
to {background-position: 10000px 5000px;}
}
</style>

---

## 🎡 Galaxy Music / Sound Toggle

This feature adds background galaxy music that users can toggle on or off using a floating button in the webpage.

### 🎧 Preview
![Galaxy Music Toggle Demo](https://github.com/sania28/hacktoberfest-code-galaxy/assets/your-github-username/demo-music-toggle.gif)

*(Replace with your actual preview GIF or screenshot if available.)*

### βš™οΈ How It Works
- A background music file (royalty-free) is embedded in the webpage using the HTML `<audio>` tag.
- A JavaScript toggle button lets users **play or pause** the sound.
- The button is styled to match the **galactic theme** of the project.

### 🧠 Code Snippet

```html
<audio id="bgMusic" loop>
<source src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" type="audio/mpeg">
</audio>
<button id="musicToggle">πŸ”Š Play Music</button>
<script>
const music = document.getElementById("bgMusic");
const toggleBtn = document.getElementById("musicToggle");
let isPlaying = false;
toggleBtn.addEventListener("click", () => {
if (isPlaying) {
music.pause();
toggleBtn.textContent = "πŸ”‡ Play Music";
} else {
music.play();
toggleBtn.textContent = "πŸ”Š Pause Music";
}
isPlaying = !isPlaying;
});
</script>