spin-wheel
Version:
An easy to use, themeable component for randomising choices and prizes.
45 lines (36 loc) • 950 B
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Spin Wheel Example - IIFE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="icon" href="data:image/x-icon;," type="image/x-icon">
<link rel="stylesheet" href="./css/index.css"/>
<script src="../../dist/spin-wheel-iife.js"></script>
<script>
window.onload = () => {
const props = {
items: [
{
label: 'one',
},
{
label: 'two',
},
{
label: 'three',
},
]
};
const container = document.querySelector('.wheel-wrapper');
window.wheel = new spinWheel.Wheel(container, props);
}
</script>
</head>
<body>
<div class="gui-wrapper">
<p>Click-drag (or flick) to spin the wheel.</p>
</div>
<div class="wheel-wrapper"></div>
</body>
</html>