Simulate a thunderstorm with the exact right amount of thunder/lightning. Thanks to the relaxing sound of heavy rain paired with thunder it helps you to relax, study, meditate and sleep.
Click here to try it out.
There are different parameters that will control your experience:
- amount of rain
- amount of lightning
- distance to thunderstorm
- image
- volume
- play state
This will control how loud the rain sound is and how strong you can see the rain in the image.
This will control how often lightning appears. Lightning will schedule thunder. (In real life thunder always appears after lightning)
This will control how much time needs to pass between the lightning and the effective thunder sound.
kilometers * 3 = amount of seconds from lightning to thunder sound
This is because sound travels one kilometer every three seconds.
Changes the images the rain animation is shown on.
Controls the overall volume.
Controls if rain/thunder sounds should play or not.
- Different Parameters are controllable by the user
- Current configuration is saved to make it possible to have the same configuration across sessions (localStorage)
- Responsiveness (even for very small screens)
All browsers that support the Web Audio API, which are all modern browsers.
For other features like the fetch
function I included a polyfill.
There are some performance problems with the Mobile Safari browser.
To run it locally you need to open the index.html
page.
So that the sounds also play you need to supply the sound files yourself because I only got the permission from the sound creators to use the sound files on my website but not for uploading them onto GitHub.
You need to supply the files here:
root
/audio
/rainloop
rain.wav -> this is the file for the rain sound
/thunder
thunder-1.wav -> these are the seven different thunder sounds used
thunder-2.wav
thunder-3.wav
thunder-4.wav
thunder-5.wav
thunder-6.wav
thunder-7.wav
Yes. Feel free to use them for what ever you want as I made them myself. Some of them are also on Unsplash