Kelompok_13/public/game.php
Aloneinsky e0623117d7 footer
2025-12-01 11:19:26 +07:00

248 lines
5.7 KiB
PHP

<!doctype html>
<html lang="id">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Hit or Run</title>
<style>
:root{
--card-w:110px;
--card-h:154px;
--deck-x: 800px;
--deck-y: 100px;
}
*{box-sizing:border-box}
body{
margin:0;
min-height:100vh;
display:flex;
align-items:center;
justify-content:center;
font-family:Inter,system-ui,Arial;
background:#071827
}
.stage{
width:960px;
height:540px;
border-radius:12px;
overflow:hidden;
position:relative;
box-shadow:0 18px 50px rgba(0,0,0,.6)
}
.bg{
position:absolute;
inset:0; background:#153f28
}
.overlay{
position:absolute; inset:0;
background:linear-gradient(180deg, rgba(11,31,20,.45), rgba(8,24,16,.65));
display:flex; flex-direction:column; padding:18px
}
.header{
color:#dff6e9;
font-weight:700;
display:flex;
justify-content:space-between
}
.table-area{
flex:1; display:flex;
align-items:center;
justify-content:center;
position:relative
}
.deck {
position: absolute;
left: var(--deck-x);
top: var(--deck-y);
width: 82px;
height: 120px;
border-radius: 10px;
background: #113625;
box-shadow: 0 0 0 2px #0d291c inset, 0 10px 20px rgba(0,0,0,0.55);
display:flex; align-items:center; justify-content:center;
color:#b9e4d0;
font-weight:900;
font-size:14px;
letter-spacing:2px;
z-index:500;
}
.player-zone{
position:absolute;
left:37%;
bottom:18px;
transform:translateX(-50%);
width:78%;
display:flex;
flex-direction:column;
align-items:center
}
.cards-wrapper{
position:relative;
width:580px;
height:170px;
display:flex;
justify-content:center;
align-items:center;
}
.dealer-zone{
position:absolute;
left:50%;
top:18px;
transform:translateX(-50%);
width:78%;
display:flex;
flex-direction:column;
align-items:center;
gap:8px;
color:#dff6e9;
font-weight:700
}
.dealer-cards{
position:relative;
width:580px;
height:170px
}
.card-wrapper {
position: absolute;
width: var(--card-w);
height: var(--card-h);
transition: transform .4s cubic-bezier(.68,-0.55,.27,1.55);
align-items: center;
transform-origin: center;
z-index: 100;
}
.card{
width:var(--card-w);
height:var(--card-h);
border-radius:10px;
background:#fff;
display:flex;
flex-direction:column;
justify-content:space-between;
padding:10px;
font-weight:800;
box-shadow:0 10px 22px rgba(0,0,0,.45);
position:absolute;
transition: transform .4s cubic-bezier(.68,-0.55,.27,1.55), opacity .3s ease, filter .3s ease;
backface-visibility:hidden;
transform-origin:center center;
color: #000;
}
.card.is-moving {
filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}
.card.red{
color:#c42b2b
}
.card .corner{
font-size:18px
}
.card .center{
font-size:40px;
display:flex;
align-items:center;
justify-content:center;
}
.back-card{
background:#122f21;
display:flex;
align-items:center;
justify-content:center;
font-size:20px;
color:#bddfcf;
letter-spacing:4px;
font-weight:900;
border-radius:10px;
}
.controls{
display:flex;
gap:12px;
margin-top:8px
}
button{
background:#0f5436;
color:#e6fff2;
border:0;
padding:10px 16px;
border-radius:8px;
cursor:pointer;
font-weight:700
}
button:disabled{
background:#2d2d2d;
opacity:.5;
cursor:not-allowed
}
.end-screen {
position: absolute;
inset: 0;
background: rgba(0,0,0,0.7);
backdrop-filter: blur(6px);
display: none;
align-items: center;
justify-content: center;
flex-direction: column;
color: white;
font-weight: 800;
font-size: 48px;
letter-spacing: 2px;
text-align: center;
z-index: 999;
}
.end-screen button {
margin-top: 22px;
font-size: 20px;
padding: 12px 26px;
border: 0;
border-radius: 10px;
background: #18a56d;
color: white;
cursor: pointer;
font-weight: 700;
}
.end-screen button:hover {
background: #1ccf86;
}
</style>
</head></script>
<body>
<div class="stage" id="stage">
<div class="bg"></div>
<div class="overlay">
<div class="header">
<div>Your Total Card: <strong id="playerTotalUI">0</strong></div>
<div id="status">PLACE YOUR BET</div>
</div>
<div id="deck" class="deck" aria-hidden="true">DECK</div>
<div class="table-area">
<div class="dealer-zone" aria-live="polite">
<div class="dealer-label">DEALER</div>
<div class="dealer-cards" id="dealerWrapper" aria-hidden="false"></div>
<div class="dealer-label">Total Dealer: <span id="dealerTotalUI">0</span></div>
</div>
<div class="player-zone">
<div style="display:flex;justify-content:center;align-items:center;width:100%;color:#dff6e9;font-weight:700;margin-bottom:8px;gap:40px">
<div class="cards-wrapper" id="cardsWrapper" aria-live="polite"></div>
<div class="controls">
<button id="stand" disabled>STAND</button>
<button id="hit" disabled>HIT</button>
</div>
</div>
</div>
<div class="end-screen" id="endScreen" role="dialog" aria-modal="true">
<div id="endMessage">RESULT</div>
<button id="playAgainBtn">PLAY AGAIN</button>
</div>
</div>
</div>
</div>
<script src="assets/js/game.js"></script>
</body>
</html>