Kelompok02-Memory-Card/mainboard.html

268 lines
6.8 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Memory Flip Card Game</title>
<style>
body {
margin: 0;
font-family: Poppins, Arial, sans-serif;
background: linear-gradient(135deg, #d9a7ff, #fbc2eb, #a1c4fd);
height: 100vh;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.container {
width: 90%;
max-width: 800px;
background: rgba(255,255,255,0.7);
backdrop-filter: blur(15px);
padding: 25px 35px;
border-radius: 28px;
box-shadow: 0 15px 35px rgba(0,0,0,0.2);
z-index: 10;
display: flex;
flex-direction: column;
animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.header {
background: rgba(255,255,255,0.65);
padding: 15px 22px;
border-radius: 20px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.btn {
padding: 10px 20px;
border: none;
border-radius: 12px;
cursor: pointer;
font-size: 14px;
font-weight: bold;
transition: 0.25s;
}
.blue { background: linear-gradient(to right, #4facfe, #00f2fe); color: white; margin-right: 5px; }
.gold { background: linear-gradient(to right, gold, orange); color: white; margin-right: 5px; }
.gray { background: #444; color: white; }
.btn:hover { transform: scale(1.05); }
/* Judul & Grid */
.title { text-align: center; margin-bottom: 20px; }
.title h1 {
font-size: 38px;
margin: 0;
background: linear-gradient(purple, hotpink);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.stage-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
.stage-btn {
background: white;
padding: 20px;
border-radius: 20px;
text-align: center;
cursor: pointer;
border: none;
}
.icon { font-size: 40px; display: block; }
/*Background*/
.fruit {
position: absolute;
width: 90px;
opacity: 0.8;
animation: floatFruit 6s infinite ease-in-out;
pointer-events: none;
z-index: 1;
}
.f1 { top: 10%; left: 5%; }
.f2 { bottom: 10%; right: 5%; }
.f3 { top: 20%; right: 10%; }
.f4 { bottom: 20%; left: 15%; }
@keyframes floatFruit {
0%, 100% { transform: translateY(0) rotate(0deg); }
50% { transform: translateY(-20px) rotate(5deg); }
}
/* overlay animation*/
.credits-overlay {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.95);
backdrop-filter: blur(10px);
display: none;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 9999;
color: white;
}
.credits-box {
height: 60%;
width: 80%;
max-width: 500px;
overflow: hidden;
position: relative;
border-top: 1px solid rgba(255,255,255,0.2);
border-bottom: 1px solid rgba(255,255,255,0.2);
}
.credits-scroll {
position: absolute;
width: 100%;
text-align: center;
animation: scrollAnimation 15s linear infinite;
}
@keyframes scrollAnimation {
0% { top: 100%; }
100% { top: -120%; }
}
.credits-title { color: #ff419b; font-size: 2.5rem; margin-bottom: 30px; }
.credits-section { margin-bottom: 30px; }
.close-credits {
margin-top: 30px;
padding: 12px 40px;
background: white;
color: black;
border: none;
border-radius: 10px;
font-weight: bold;
cursor: pointer;
}
/* Musik */
.music-container { position: fixed; top: 20px; right: 20px; z-index: 1000; }
.music-btn { width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer; font-size: 24px; background: white; }
</style>
</head>
<body>
<img src="images/fruit1.png" class="fruit f1">
<img src="images/fruit2.png" class="fruit f2">
<img src="images/fruit3.png" class="fruit f3">
<img src="images/fruit4.png" class="fruit f4">
<div class="music-container">
<button id="musicBtn" class="music-btn">🔇</button>
</div>
<audio id="bgMusic" loop src="music/music_background.mp3"></audio>
<div class="container">
<header class="header">
<div class="user-info">
<h2 style="margin:0">Player</h2>
<p style="margin:0">🎮 Player</p>
</div>
<div class="actions">
<button class="btn blue" onclick="openCredits()"> Credit</button>
<button id="leaderboardBtn" class="btn gold">🏆 Leaderboard</button>
<button id="logoutBtn" class="btn gray">🚪 Logout</button>
</div>
</header>
<div class="title">
<h1>Memory Flip Card</h1>
<p>Pilih tingkat kesulitan untuk memulai permainan</p>
</div>
<div class="stage-grid">
<button class="stage-btn" onclick="selectStage('easy')">
<span class="icon">😊</span>
<h3>Easy Mode</h3>
</button>
<button class="stage-btn" onclick="selectStage('medium')">
<span class="icon">🤔</span>
<h3>Medium Mode</h3>
</button>
<button class="stage-btn" onclick="selectStage('hard')">
<span class="icon">😤</span>
<h3>Hard Mode</h3>
</button>
</div>
</div>
<div id="creditsOverlay" class="credits-overlay">
<div class="credits-box">
<div class="credits-scroll">
<h2 class="credits-title">CREDITS</h2>
<div class="credits-section">
<p><strong>KELOMPOK 2</strong></p>
<p>Evelyn Adi Gloria - 5803025026</p>
<p>Nathan Handoko S - 5803025001</p>
<p>Yustina Rizky S.P - 5803025041</p>
</div>
<div class="credits-section">
<p><strong>PROJECT UAS</strong></p>
<p>MEMORI FLIP CARD</p>
</div>
<div class="credits-section">
<p><strong>SPECIAL THANKS</strong></p>
<p>Bu Devi dan Pak Andrew<br>dan teman-teman informatika</p>
</div>
<p>© 2025 UKWMS</p>
</div>
</div>
<button class="close-credits" onclick="closeCredits()">TUTUP</button>
</div>
<script>
const musicBtn = document.getElementById('musicBtn');
const bgMusic = document.getElementById('bgMusic');
let isMusicPlaying = false;
musicBtn.addEventListener('click', () => {
isMusicPlaying ? bgMusic.pause() : bgMusic.play();
musicBtn.innerText = isMusicPlaying ? '🔇' : '🔊';
isMusicPlaying = !isMusicPlaying;
});
function selectStage(stage) {
window.location.href = "gameboard-" + stage + ".html";
}
document.getElementById("leaderboardBtn").addEventListener("click", () => {
window.location.href = "Leaderboard.html";
});
document.getElementById("logoutBtn").addEventListener("click", () => {
alert("Logout berhasil!");
});
function openCredits() {
document.getElementById('creditsOverlay').style.display = 'flex';
}
function closeCredits() {
document.getElementById('creditsOverlay').style.display = 'none';
}
</script>
</body>
</html>