instinct/index.html
Omar Najjar 4d25e9d5e7 x
2024-07-06 17:13:11 +10:00

221 lines
8.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Instinct App</title>
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Syne', sans-serif;
background-color: #000;
color: #fff;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
}
.page {
display: none;
text-align: center;
width: 80%;
max-width: 600px;
padding: 20px;
border-radius: 10px;
background: rgba(20, 20, 20, 0.8);
box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
margin-top: 20px;
}
.page.active {
display: block;
}
.btn-place, .btn-confirm {
cursor: pointer;
padding: 10px 20px;
border-radius: 5px;
color: white;
border: 1px solid #fff;
background: transparent;
font-size: 16px;
font-weight: bold;
margin-top: 10px;
transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-place:hover, .btn-confirm:hover {
background: #fff;
color: #000;
}
input[type="email"], input[type="text"], input[type="tel"], textarea {
width: calc(100% - 40px);
padding: 10px;
border-radius: 5px;
border: 1px solid #fff;
background-color: #222;
color: #fff;
margin-top: 10px;
font-weight: 300; /* Lighter font */
line-height: 1.5; /* Taller text */
}
.avatars img {
width: 60px;
height: 60px;
margin: 10px;
cursor: pointer;
border-radius: 50%;
border: 2px solid transparent;
transition: transform 0.2s, border-color 0.2s;
}
.avatars img:hover {
transform: scale(1.1);
border-color: #fff;
}
.video-frame {
position: relative;
width: 100%;
max-width: 600px;
height: 300px;
border-radius: 10px;
margin: 0 auto; /* Centers the video frame */
overflow: hidden; /* Ensures no overflow from the video */
}
.live-indicator {
position: absolute;
top: 10px;
right: 10px;
font-size: 18px;
font-weight: bold;
color: #fff;
background-color: #ff0000;
padding: 5px 10px;
border-radius: 5px;
animation: flash 1s infinite;
z-index: 20; /* Ensures it is above the video */
}
.countdown {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 48px;
font-weight: 700;
z-index: 10;
color: #FFF; /* Ensures visibility on top of any background */
}
.bet-buttons {
display: flex;
justify-content: space-around;
margin: 20px 0;
}
@keyframes flash {
0%, 50%, 100% {
opacity: 1;
}
25%, 75% {
opacity: 0;
}
}
.live-chat, .live-messages-container {
background: rgba(0, 0, 0, 0.8);
border-radius: 10px;
padding: 10px;
margin-top: 20px;
}
.message {
color: #fff;
background: rgba(255, 255, 255, 0.1);
padding: 5px;
margin-bottom: 5px;
border-radius: 5px;
}
</style>
</head>
<body>
<div id="page1" class="page active">
<h1 class="text-2xl font-bold text-center mb-4">Instinct</h1>
<input type="email" id="email" placeholder="Enter your email" required>
<button class="btn-place" onclick="navigateTo('page2')">Enter</button>
</div>
<div id="page2" class="page">
<h1 class="text-2xl font-bold text-center mb-4">Welcome, <span id="userEmail"></span></h1>
<h2 class="text-xl text-center mb-4">Setup your account</h2>
<input type="text" id="name" placeholder="Name" required>
<input type="tel" id="phone" placeholder="Phone" required>
<button class="btn-place" onclick="navigateTo('page3')">Next</button>
</div>
<div id="page3" class="page">
<h2 class="text-xl text-center mb-4">Choose your avatar</h2>
<div class="avatars flex justify-center gap-4">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRYGG5wQxwQh8ZwAf-6K84NnUZ_lngQxgMSiw&s" alt="Avatar 1" onclick="selectAvatar('avatar1')">
<img src="https://cdn.icon-icons.com/icons2/1368/PNG/512/-avatar_89781.png" alt="Avatar 2" onclick="selectAvatar('avatar2')">
<img src="https://icons.iconarchive.com/icons/iconarchive/incognito-animals/512/Bear-Avatar-icon.png" alt="Avatar 3" onclick="selectAvatar('avatar3')">
<img src="https://icons.iconarchive.com/icons/iconarchive/incognito-animals/512/Lama-Avatar-icon.png" alt="Avatar 4" onclick="selectAvatar('avatar4')">
</div>
<button class="btn-place" onclick="navigateTo('page4')">Next</button>
</div>
<div id="page4" class="page">
<div class="video-frame mb-4">
<div class="countdown" id="countdown">5</div>
<div class="live-indicator">LIVE</div>
<!-- iframe is now dynamically added by the script to control timing -->
</div>
<div class="bet-buttons">
<button class="btn-place" onclick="bet('Lion')">Bet Lion</button>
<button class="btn-confirm" onclick="bet('Buffalo')">Bet Buffalo</button>
</div>
<div class="live-chat">
<textarea id="chatBox" placeholder="Type your message..." onkeydown="if(event.keyCode==13){sendChatMessage()}"></textarea>
<div id="liveMessages" class="live-messages-container"></div>
</div>
</div>
<script>
function navigateTo(pageId) {
document.querySelectorAll('.page').forEach(page => {
page.classList.remove('active');
});
document.getElementById(pageId).classList.add('active');
if (pageId === 'page4') {
startCountdown(5);
}
}
function startCountdown(duration) {
var timer = duration, seconds;
var countdownElement = document.getElementById('countdown');
var videoFrame = document.querySelector('.video-frame');
countdownElement.style.display = 'block';
countdownElement.textContent = duration;
var countdownTimer = setInterval(function () {
seconds = parseInt(timer % 60, 10);
countdownElement.textContent = seconds;
if (--timer < 0) {
countdownElement.style.display = 'none';
clearInterval(countdownTimer);
// Only create and display the video after the countdown finishes
var iframe = document.createElement('iframe');
iframe.src = "https://customer-0sb72e7akfw9m0dg.cloudflarestream.com/7d7cb4e7e6ead747b72073c3824a9d3f/iframe?preload=true&autoplay=true&poster=https%3A%2F%2Fcustomer-0sb72e7akfw9m0dg.cloudflarestream.com%2F7d7cb4e7e6ead747b72073c3824a9d3f%2Fthumbnails%2Fthumbnail.jpg%3Ftime%3D%26height%3D600&controls=false";
iframe.style.cssText = 'border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;';
iframe.allow = "accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;";
iframe.allowfullscreen = true;
videoFrame.appendChild(iframe);
}
}, 1000);
}
function sendChatMessage() {
var message = document.getElementById('chatBox').value.trim();
if (message) {
var messageElement = document.createElement('div');
messageElement.classList.add('message');
messageElement.textContent = message;
document.getElementById('liveMessages').appendChild(messageElement);
document.getElementById('chatBox').value = ''; // Clear the input after sending
}
}
</script>
</body>
</html>