DynaWP is a JavaScript wallpaper library that adds effect like Parallax.js engine.
- Import the code:
<script src="DynaWP.js"></script> <!-- Preferred: Will work offline and much faster --->
<script src="https://github.com/Segilmez06/DynaWP/releases/latest/download/DynaWP.js"></script>
- Create a
div
and set attributes:
<div id="wallpaper" effectscale="0.25" reactscale="2" effectimg="wallpaper.webp"></div>
id
: To set a element as wallpaper, you need to change it'sid
towallpaper
.effectscale
: Time to react the mouse move in seconds. For example,0.25
means it'll take 0.25 second to complete requested animation.reactscale
: Moving value of image in screen size's percentage. For example,1
means it'll set image size as 102% and change image position between-1vh
/-1vw
and1vh
/1vw
.effectimg
: Background image URL for element.
Note: You must set all id
, effectscale
, reactscale
, effectimg
attributes to work properly.