https://github.com/strakerbit/secret-santa-game
This project is a simple web-based "Secret Santa" game implemented using HTML, CSS, and JavaScript. It allows users to add names to a list, randomly draw a name from the list, and remove the drawn name once selected. The game is designed for fun and to help organize holiday gift exchanges among friends and family.
https://github.com/strakerbit/secret-santa-game
Last synced: 3 months ago
JSON representation
This project is a simple web-based "Secret Santa" game implemented using HTML, CSS, and JavaScript. It allows users to add names to a list, randomly draw a name from the list, and remove the drawn name once selected. The game is designed for fun and to help organize holiday gift exchanges among friends and family.
- Host: GitHub
- URL: https://github.com/strakerbit/secret-santa-game
- Owner: strakerbit
- License: mit
- Created: 2025-03-03T22:37:48.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T22:41:10.000Z (3 months ago)
- Last Synced: 2025-03-03T23:28:12.866Z (3 months ago)
- Language: CSS
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Secret Santa
This project is a simple implementation of a "Secret Santa" game, where users can add names to a list, randomly draw a friend from the list, and remove that friend once they have been drawn. It is developed in JavaScript and HTML and can be run directly in a browser.
## Description
The project allows users to:
- Add friends to a list.
- View the list of added friends.
- Randomly draw a friend from the list.
- Remove the drawn friend from the list after they have been selected.## Features
- Validation to avoid duplicate names.
- Alert messages when the list is empty or when there is only one friend in the list.
- The winner of the draw is displayed in the interface and removed from the friend list.## Installation
1. Clone this repository or download the code to your local machine.
```bash
git clone https://github.com/strakerbit/secret-santa-game.git
```
2. Open the `index.html` file in a web browser to run the application.**Note:** No external dependencies are required for this project. You only need a browser that supports JavaScript.
## Usage
1. **Add friends**:
- Enter a name in the text field and click "Add".
- If the name already exists in the list, an error message will be displayed.2. **Draw a friend**:
- After adding at least two friends, click "Draw a friend".
- A random friend will be selected and displayed in the results section.
- The drawn friend will be removed from the friend list.3. **View the friend list**:
- The friend list updates automatically after adding a new name or drawing a friend.## Technologies Used
  
- **HTML**: Structure of the website.
- **CSS**: Web styling
- **JavaScript**: Logic of the application (managing the friend list, drawing friends, etc.).## Common Issues
- **The list is empty**: If you try to draw a friend when there are no names in the list, an alert will show indicating the list is empty.
- **There is only one friend in the list**: If you try to draw a friend when there is only one, an alert will show that at least two friends are required to draw.## Contributing
If you wish to contribute to this project, feel free to fork it and submit a pull request with your improvements.
## License
This project is open source and distributed under the MIT License.
Built with ❤️ by Straker