中文 | English
A special way to wish someone happy birthday.
Preview: https://friendly-paprenjak-ad64b7.netlify.app/
- Carefully designed text animations and romantic floating balloon animations
- Customize all text content, images, background music and font styles by simply modifying the
customize.json
file - Click anywhere on the page to display gorgeous firework effects
- Auto-play beautiful background music to create a warm and romantic atmosphere
- Built with modern rspack for better performance
Used to wish happy birthday to someone special or your lover, creating a romantic atmosphere. For the story behind the project, you can read my Zhihu blog post: Thoughts on Website Background Music from Birthday Celebrations
Fork this project, modify the customize.json file by replacing its contents with your own, then deploy it on github pages or other hosting sites (like netlify).
You don't need to create PR to this repository
You can modify text, images, background music, fonts, etc., but there are some things to note:
- Only modify the customize.json file, do not modify other files, otherwise the page may not display properly.
- When replacing music, make sure to rename to the same music filename or modify the path in the json file, like
bgMusic.mp3
here - When replacing images, the birthday hat might be offset. It's recommended to crop images to the same size as the original for best viewing effect.
- For font replacement, just modify the font configuration in json. You can use local fonts or online fonts (like Google Fonts). The project has built-in
LXGW WenKai
font file ready to use. Note that font only supports one font configuration. Usage example:
"fonts": [
{
"name": "Ma Shan Zheng",
"path": "https://fonts.googleapis.com/css?family=Ma+Shan+Zheng&display=swap"
},
//or use local font, but can only use one font at a time
// {
// "name": "LXGW WenKai",
// "path":"./fonts/LXGWWenKai-Regular.ttf"
// }
]
The project uses npm as package manager. Make sure you have node environment configured locally, otherwise please install it yourself. Verify node environment as follows:
$ node -v
v22.2.1
Then install dependencies:
npm install
Run:
npm run start
The overall implementation uses pure HTML, CSS and JavaScript, along with GSAP for animations.
Thanks to the original project author for open sourcing. This project is modified based on happy-birthday.
If you like this project, you can give it a star ⭐ to encourage me, thank you!
- Use rspack to build project
- Add font configuration support
- Add firework effects
- Optimize music playback interaction
- More configurable options
- Added music playback effect
- Added guide page
- Chinese localization
- Optimized some details