Roulette

Developer
Size
2,417 Kb
Views
28,336

How do I make an roulette?

What is a roulette? How do you make a roulette? This script and codes were developed by Theun on 02 November 2022, Wednesday.

Roulette Previews

Roulette - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>roulette</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="roulette"></div>
<button id='start'> start </button>
<button id='stop'> stop </button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Roulette - Script Codes CSS Codes

* { margin: 0; padding: 0; border: 0;
}
#roulette {
width: 100%;
}
body { background: #666; font: 30px Verdana;
}
button{ padding: 5px; border: 2px;
}

Roulette - Script Codes JS Codes

var preloads = [], images = [ 'http://fc01.deviantart.net/fs71/f/2011/097/2/c/melody_roulette_wheel_by_wheelgenius-d3dflqw.jpg', 'http://khaosok-smiley.com/wp-content/gallery/miscellaneous/green_smiley.png', 'http://www.jpl.nasa.gov/images/earth/earth2-browse.jpg', 'http://www.rivercitypizza.com/PepperoniPizza-full.jpg', 'http://www.dailyfork.com/Donut.gif', 'http://i00.twenga.com/games/stuurwiel-pc/logitech-g27-racing-wheel-p_542951vb.jpg' ];
function preload(img_path) { var $dfd = $.Deferred; $('<img />').attr('src', img_path).load(function() { $dfd.resolved(); });
}
for(var i = 0; i < images.length; ++i) { preloads.push(preload(images[i]));
}
$.when.apply($, preloads).done(function() { var roulette = new Roulette; $('#start').click(roulette.start); $('#stop').click(roulette.stop);
});
function Roulette() { var index = 0, image = new Image, speed = 50, isStarting = false, isStopping = false, isStop = false; init(); function init() { image.src = images[0]; image.width = 300; image.height = 300; $('#roulette').append(image); } function change() { if (index >= images.length) index = 0; image.src = images[index]; if (isStop === false) { index++; setTimeout(change, speed); } else { images.splice(index, 1); isStarting = false; } } function start() { if (isStarting === true) return; isStop = false; isStarting = true; change(); } function stop() { if (isStopping === true) return; isStopping = true; speed = 200; setTimeout(function() { speed = 500; }, 1000); setTimeout(function() { speed = 50; isStop = true; isStopping = false; }, 2500); } return { start: start, stop: stop };
}
Roulette - Script Codes
Roulette - Script Codes
Home Page Home
Developer Theun
Username tjoen
Uploaded November 02, 2022
Rating 3
Size 2,417 Kb
Views 28,336
Do you need developer help for Roulette?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Theun (tjoen) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!