reddit-wallpapers (beta)
Script to help in fetching wallpapers from Reddit API and loop setting them
Setup:
<head>
<script src='bundle.js' type='text/javascript'></script>
<script type='text/javascript'>
var WManager = redditWallpapers({
id: '.toChange'
})
</script>
</head>
<body>
<div class='.toChange'>
<h1>Reddit Wallpapers !</h1>
</div>
</body>
Options:
self.options = {
id: options.id || '.reddit',
category: options.category || self.categories,
duration: options.duration || 10000,
aDuration: options.aDuration * 1000 || 1000,
limit: options.limit || 30,
timeout: options.timeout * 1000 || 5000,
overlay: options.overlay || 'rgba(0,0,0,0.7)',
isOverlayed: options.isOverlayed || 'true',
isFixed: options.isFixed || 'false',
isMixed: options.isMixed || 'false',
isAnimated: options.isAnimated || 'true'
}
Functions:
To use any of the following functions, you have to get an instance of the constructor, which we did in the Setup section :
var WManager = redditWallpapers()
WManager.following_functions()
Function | Describtion |
---|
next() | set the next wallpaper |
previous() | set the previous wallpaper |
stop() | stop loop setting wallpapers |
restart() | reset settings to default and restart looping |
Dependencies: