Compare commits
No commits in common. "3e2e1641fd95b90e0bbd31178fd06734c90d49db" and "dfd725d1b18cc1d691c59e1fa5a8d7308d957ceb" have entirely different histories.
3e2e1641fd
...
dfd725d1b1
@ -47,11 +47,10 @@
|
||||
}
|
||||
|
||||
.container-first {
|
||||
background-image: url(/assets/Design/newBGBOSSFIGHT.gif);
|
||||
/* background-image: url(/src/assets/Design/CAVEBOSSFIGHT.png); */
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
image-rendering: pixelated;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.container-first .content .boss {
|
||||
|
||||
@ -139,35 +139,6 @@
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 100dvh;
|
||||
/* Hapus properti background dari sini dan pindahkan ke ::before */
|
||||
|
||||
/* Tambahkan posisi relatif agar pseudo-element bisa diposisikan absolut di dalamnya */
|
||||
position: relative;
|
||||
/* Pastikan konten di dalam container ada di atas latar */
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Pseudo-element untuk menampung gambar latar transparan */
|
||||
.container-board::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
/* Pindahkan properti background Anda ke sini */
|
||||
background-image: url(/assets/Design/CampFire8WESFIX!-export.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
image-rendering: pixelated;
|
||||
|
||||
/* >>> INI KUNCINYA: Atur opasitasnya di sini <<< */
|
||||
opacity:1; /* Contoh nilai 40% transparan */
|
||||
|
||||
/* Pindahkan latar ini ke lapisan paling bawah */
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.container-board .chara {
|
||||
@ -189,14 +160,13 @@
|
||||
width: 300px;
|
||||
image-rendering: pixelated;
|
||||
margin: 20px;
|
||||
margin-top: 160px;
|
||||
}
|
||||
|
||||
.container-board .menu {
|
||||
margin: 0 auto;
|
||||
border-radius: 6px;
|
||||
border-radius: 10px;
|
||||
width: 400px;
|
||||
border: 5px solid;
|
||||
border: 1px solid;
|
||||
height: 40px;
|
||||
align-content: center;
|
||||
}
|
||||
@ -208,15 +178,13 @@
|
||||
/*menghilangkan gap antar border*/
|
||||
font-family: "Segoe UI", Tahoma, sans-serif;
|
||||
color: white;
|
||||
font-weight: 200;
|
||||
font-size: 20px;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container-board .board table th,
|
||||
td {
|
||||
border: 5px solid #ffffff;
|
||||
border: 5px solid #ffffffb8;
|
||||
padding: 14px 18px;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
@ -230,9 +198,6 @@ td {
|
||||
}
|
||||
|
||||
|
||||
.container-board .board table tbody tr {
|
||||
background: #0b0e00bd;
|
||||
}
|
||||
.container-board .board table tbody tr:hover {
|
||||
background: #c1fc0032;
|
||||
}
|
||||
@ -244,6 +209,9 @@ td {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
/* background-image: url(/src/assets/Design/wayland.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover; */
|
||||
}
|
||||
|
||||
.container-onboard h1 {
|
||||
|
||||
@ -66,7 +66,7 @@ function selectAnswer(e){
|
||||
const isCorrect = selectedBtn.dataset.correct === "true";
|
||||
if(isCorrect){
|
||||
selectedBtn.classList.add("correct");
|
||||
score += 10;
|
||||
score++;
|
||||
} else {
|
||||
selectedBtn.classList.add("Incorrect");
|
||||
}
|
||||
@ -83,6 +83,8 @@ function showScore(){
|
||||
resetState();
|
||||
const show = questionElement.innerHTML = `you scored ${score} out of ${questions.length}!`;
|
||||
postScore(score);
|
||||
alert(show);
|
||||
window.location.href = "../leaderboard.php"
|
||||
}
|
||||
|
||||
function handleNextBtn(){
|
||||
@ -106,21 +108,10 @@ function postScore(score){
|
||||
fetch('/score.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ score: score })
|
||||
body: JSON.stringify({ score })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
console.log("Server response:", data);
|
||||
|
||||
if(data.success || data.message === "Score accumulated") {
|
||||
window.location.href = "../leaderboard.php";
|
||||
} else {
|
||||
window.location.href = "../leaderboard.php";
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error("Fetch error:", err);
|
||||
alert("Terjadi kesalahan koneksi.");
|
||||
});
|
||||
.then(r => r.text())
|
||||
.then(t => console.log("Server response:", t))
|
||||
.catch(err => console.error("Fetch error:", err));
|
||||
}
|
||||
startQuiz()
|
||||
@ -0,0 +1 @@
|
||||
dadad
|
||||
@ -5,7 +5,7 @@ require_once "config/db.php";
|
||||
$sql= "SELECT username, score
|
||||
FROM users
|
||||
ORDER BY score DESC
|
||||
LIMIT 8";
|
||||
LIMIT 10";
|
||||
$nama = $_SESSION['username'];
|
||||
$score = 0;
|
||||
|
||||
|
||||
@ -19,20 +19,15 @@ if (!$user_id) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "UPDATE users SET score = score + ? where id =? ";
|
||||
$stmt = $db ->prepare($sql);
|
||||
$stmt = $db->prepare("INSERT INTO scores (id, score) VALUES (?, ?)");
|
||||
$stmt->bind_param("ii", $user_id, $score);
|
||||
|
||||
if ($stmt){
|
||||
$stmt->bind_param("ii",$score,$user_id);
|
||||
if ($stmt->execute()) {
|
||||
echo json_encode(["success" => true, "message" => "Score accumulated"]);
|
||||
echo json_encode(["success" => true]);
|
||||
} else {
|
||||
echo json_encode(["error" => "update failed: " . $stmt->error]);
|
||||
}
|
||||
$stmt->close();
|
||||
}else{
|
||||
echo json_encode(["error" => "stetment prep failed"]);
|
||||
echo json_encode(["error" => "insert failed"]);
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$db->close();
|
||||
?>
|
||||
Loading…
x
Reference in New Issue
Block a user