reddit-wallpapers (beta)
Reddit API and loop setting them.
Script to help in fetching wallpapers fromLive Demo
Install:
NPM: to bundle it however you like:
- To install it:
npm i reddit-wallpapers --save
- To import it:
// ES5const RedditWallpapers = default // ES6
Browser:
- You can get the latest bundle from here
- Example:
Reddit Wallpapers !
Options:
selfoptions = // default options, if not provided id: optionsid || '.reddit' // id or css class of element to wallpaper to category: optionscategory || selfcategories // Array of categories to choose from randomly duration: optionsduration || 10000 // duration of 5 seconds aDuration: optionsaDuration * 1000 || 1000 // transsition animation duration limit: optionslimit || 30 // limit of json items timeout: optionstimeout * 1000 || 5000 // request timeout in seconds overlay: optionsoverlay || 'rgba(0,0,0,0.7)' // black transparnt overlay color isOverlayed: optionsisOverlayed || 'true' // to add overlay to the wallpaper isFixed: optionsisFixed || 'false' // to set wallpaper to fixed position isMixed: optionsisMixed || 'false' // to make sure wallpapers selected from mixed categories isAnimated: optionsisAnimated || 'true' // to use jQuery animation
Support:
Should work with anything newer than Internet Explorer 10
and NodeJS 10
.
Interface:
Function | Describtion |
---|---|
WManager.next() |
set the next wallpaper |
WManager.previous() |
set the previous wallpaper |
WManager.stop() |
stop loop setting wallpapers |
WManager.restart() |
reset settings to default and restart intervals |