Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto spin basic wheel #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/auto_basic_wheel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Spin Wheel

Sound from https://freesound.org/people/JustinBW/sounds/80921/

WinWheel from https://github.com/zarocknz/javascript-winwheel

Bootstrap 4.3 https://getbootstrap.com
81 changes: 81 additions & 0 deletions examples/auto_basic_wheel/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
Description:
Contains all the styles for the winning wheel page.

Verison History:
2012-01-28, Douglas McKechie
- Created based off earlier version.

2015-09-26, Douglas McKechie
- Minor updates for the 2.0 winwheel example.
*/

body
{
font-family: arial;
}

/* Sets the background image for the wheel */
td.the_wheel
{
background-image: url(../img/wheel_back.png);
background-position: center;
background-repeat: none;
}

/* Do some css reset on selected elements */
h1, p
{
margin: 0;
}

div.power_controls
{
margin-right:70px;
}

div.html5_logo
{
margin-left:70px;
}

/* Styles for the power selection controls */
table.power
{
background-color: #cccccc;
cursor: pointer;
border:1px solid #333333;
}

table.power th
{
background-color: white;
cursor: default;
}

td.pw1
{
background-color: #6fe8f0;
}

td.pw2
{
background-color: #86ef6f;
}

td.pw3
{
background-color: #ef6f6f;
}

/* Style applied to the spin button once a power has been selected */
.clickable
{
cursor: pointer;
}

/* Other misc styles */
.margin_bottom
{
margin-bottom: 5px;
}
Binary file added examples/auto_basic_wheel/img/wheel_back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions examples/auto_basic_wheel/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<html>

<head>
<title>Wheel</title>
<link rel="stylesheet" href="./css/main.css" type="text/css" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>

<body>
<div class="container">
<br><br><br>
<div class="row">
<div class="col-md-6">
<div class="jumbotron">
<h3>Çark Ayarları</h3>
<br>
<div class="form-group">
<label for="type">Çark Tipi</label>
<select class="form-control" name="type" id="type">
<option value="manuel">Manuel</option>
<option value="auto">Otomatik</option>
</select>
</div>
<div class="form-group">
<label for="repeataftertime">Otomatik Tekrar Zamanlaması (sn)</label>
<input type="number" class="form-control" id="repeataftertime" value="10" />
</div>
<div class="form-group">
<label for="type">Hız Kademesi</label>
<select class="form-control" name="speed" id="speed">
<option selected value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
</select>
</div>
<button class="btn btn-success" id="start">Başlat</button>
<button class="btn btn-success" id="reset">Sıfırla ve Durdur</button>
</div>
</div>
<div class="col-md-6">
<div class="jumbotron">
<h3>Alan Ayarları</h3>
<br>
<div class="form-group" id="fieldscontainer">
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">
<input type="checkbox" id="field" aria-label="Checkbox for following text input">
</div>
</div>
<input type="text" class="form-control" id="fieldvalue"
aria-label="Text input with checkbox">
</div>
</div>
<button class="btn btn-success" id="addfield">Alan Ekle</button>
<button class="btn btn-success" id="setfield">Çarka Uygula</button>
</div>
</div>
</div>
</div>

<div align="center">
<h2 id="wheelSelectionResult"></h2>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="438" height="582" class="the_wheel" align="center" valign="center">
<canvas id="canvas" width="434" height="434">
<p style="{color: white}" align="center">Sorry, your browser doesn't support canvas. Please try
another.</p>
</canvas>
</td>
</tr>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
<script src="./js/Wheel.js"></script>
<script src="./js/main.js"></script>

</body>

</html>
Loading