Skip to content

Instantly share code, notes, and snippets.

@chrisrobison
Created January 24, 2021 18:21
Show Gist options
  • Save chrisrobison/efc341042602b9ac53b3acd03a19a7ba to your computer and use it in GitHub Desktop.
Save chrisrobison/efc341042602b9ac53b3acd03a19a7ba to your computer and use it in GitHub Desktop.
Roulette : Casino Game
<!-- originally from https://codepen.io/daniandl/pen/mMQmGV -->
<div class="roulette">
<div class="wheel spin">
<div class="arrow">
</div>
<img src="https://i.imgur.com/N01W3Ks.png">
</div>
</div>
perfecthalf = ((1 / 37) * 360) / 2;
let currentLength = perfecthalf;
$(".wheel img").css("transform", "rotate(" + perfecthalf + "deg)");
$(".spin").click(() => {
$(".wheel img").css("filter", "blur(8px)");
spininterval = getRandomInt(0, 37) * (360 / 37) + getRandomInt(3, 4) * 360;
currentLength += spininterval;
numofsecs = spininterval;
console.log(currentLength);
$(".wheel img").css("transform", "rotate(" + currentLength + "deg)");
setTimeout(function () {
$(".wheel img").css("filter", "blur(0px)");
}, numofsecs);
});
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
$(document).ready(function() {
$(".spin").click();
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.min.js"></script>
body {
margin: 0;
background: tomato;
}
.roulette {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
.wheel img {
transition: transform 10s cubic-bezier(0.3, 1, 0.7, 1),
10s filter cubic-bezier(0.1, 1, 0.8, 1),
10s -webkit-filter cubic-bezier(0.1, 1, 0.8, 1);
will-change: transform;
border-radius: 50%;
box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
width: 100%;
max-width: 600px;
/* border:4px dashed rgba(255,255,255, .5); */
}
.arrow {
width: 0;
height: 0;
border: 80px solid transparent;
border-top: 110px solid tomato;
position: fixed;
left: 50%;
transform: translate(-50%, -100px);
z-index: 20;
border-radius: 0.35em;
}
.arrow:after {
}
}
.spin {
cursor: crosshair;
}
@KubaNowakowski
Copy link

Roulette is such a classic casino game, and it's fascinating to see how its mechanics work behind the scenes. The blend of chance and strategy keeps it exciting every time you play. If you're a fan of games like roulette, you might want to check out the gaming website . It's a prediction platform with a wide variety of games, including slots, and is enjoyed by over a million players daily. The app is secure and provides a seamless, low-latency experience, making it great for gaming enthusiasts.

@helenkitina
Copy link

Online roulette Слотерман БГ is a great way to unwind and enjoy some relaxing entertainment. It offers an exciting experience with the thrill of chance, where you can place bets and watch the wheel spin from the comfort of your own home. The fast-paced nature of the game keeps you engaged, while also providing an opportunity to take a break from daily routines. Whether you’re playing for fun or aiming for a win, online roulette can be a fun and stress-free way to relax.

@Sperihat03
Copy link

That’s such a helpful comment

@kuaso34
Copy link

kuaso34 commented Oct 22, 2025

Hej, od kilku miesięcy próbowałem uzbierać na nowy telewizor, ale postęp był naprawdę żmudny. Po serii drobnych, nieudanych zakładów na innych platformach, postanowiłem dać szansę highflybet casino . To, co od razu przykuło moją uwagę, to niesamowita różnorodność slotów. Wybrałem jeden z tematycznych automatów i ku mojemu zaskoczeniu, już po kilku minutach trafiłem całkiem pokaźną wygraną. Dla graczy z Polski kasyno oferuje naprawdę hojne bonusy powitalne, które dają solidny zastrzyk gotówki na start. Wypłata środków została przetworzona ekspresowo, bez żadnych zbędnych formalności.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment