Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
RatCheese1608 committed Jul 11, 2023
1 parent e6bf393 commit 1e2f49e
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 44 deletions.
41 changes: 33 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
</div>
</div>
<div id="actopt">
<button class="actbtn" id="Serang" onClick="attack(player,enemy)">Serang</button>
<button class="actbtn" id='Guna' onClick="">Gunakan<br>"Item"</button>
<button class="actbtn" id="Mampu" onClick="">Kemampuan</button>
<button class="actbtn" id="Soal" onClick="">Lihat Soal Lalu</button>
<button class="actbtn" id="Att" onClick="attack(player,enemy)">Serang</button>
<button class="actbtn" id='Use' onClick="">Gunakan<br>"Item"</button>
<button class="actbtn" id="Tutor" onClick="show_popup(document.querySelector('#tutorial-container'))">Tutorial</button>
<button class="actbtn" id="PastQ" onClick="">Lihat Soal Lalu</button>
</div>
</div>
</div>
<div id="question-container" class="container">
<div id="question-container" class="container pop-up">
<div id="question">
<h1>BONUS</h1>
<h2>Kerjakan Soal berikut untuk menerima bonus yang dapat berupa "power-up" atau "item"</h2>
<h2>Kerjakan Soal berikut untuk menerima bonus "item"</h2>
<div class="wrapper">
<img src="" alt="question pic">
</div>
Expand All @@ -91,20 +91,45 @@ <h2>Kerjakan Soal berikut untuk menerima bonus yang dapat berupa "power-up" atau
<button class="ansbtn" onClick="setAnsOpt('E')">E</button>
</div>
<div id="move">
<button id="tolak" onClick="tolak()">
<button id="tolak" onClick="decline()">
<h2>TOLAK</h2>
<p>Lompatkan Soalnya</p>
</button>
<h1>PILIH</h1>
<button id="terima" onClick="terima()">
<button id="terima" onClick="accept()">
<h2>TERIMA</h2>
<p>Jawab Soalnya</p>
</button>
</div>
</div>
<div id="tutorial-container" class="container pop-up">
<button onclick="hide_popup(document.querySelector('#tutorial-container'))">X</button>
<h1 style="width: 50%; text-align: center; margin: 25px auto;">TUTORIAL</h1>
<p style="white-space: pre-wrap">Cara bermain:
1. Pada ronde pertama, kamu hanya bisa menyerang lawan kamu dengan memencet tombol “Serang”.
2. Setelah beberapa ronde, kamu akan diberikan sebuah soal PG dimana jika kamu menjawab dengan benar, kamu akan diberikan suatu hadiah “Item” yang dapat membantu kamu.
3. Kamu juga dapat menolak untuk menjawab. Soal yang kamu tolak dapat kamu lihat kembali melalui tombol "Lihat Soal Lalu"
4. Saat HP lawan atau kamu sudah habis, permainan akan berakhir. Jika HP lawan yang lebih awal habis, maka kamu dinyatakan sebagai pemenangnya. Jika HP kamu yang lebih awal habis, maka kamu dinyatakan kalah.

Untuk melihat kembali tutorial ini, pencet saja tombol "Tutorial".

Kamu bisa menutup halaman tutorial ini dengan memencet tombol "X" yang ada di atas.
</p>
</div>
<div id="start-container" class="container pop-up">
<h1 style="width: 50%; text-align: center; margin: 25px auto;">Chemistry Smart Mobile Games</h1>
<div>
<button onclick="hide_popup(document.querySelector('#start-container'))">MULAI</button>
<button onclick="show_popup(document.querySelector('#tutorial-container'))">TUTORIAL</button>
</div>
</div>
</div>
<div id="cheese-ball">
<img src="Resources/cheese.png" alt="CHEESE MAGIC">
</div>
<script>
document.querySelector('#start-container').style.display='flex';
document.querySelector('#start-container').style.opacity=1;
</script>
</body>
</html>
32 changes: 32 additions & 0 deletions lose.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:site_name" content="AlCheesy">
<meta property=“og:title” content="Cheesing Chemistry">
<meta property="og:description" content="The rat has been fooled by his teacher to make a web app that teaches thermochemistry." />
<meta property="og:url" content="https://ratcheese1608.github.io">
<meta property="og:type" content="website">
<meta property="og:image" content="https://ratcheese1608.github.io/Resources/golden%20rat.jpg">
<meta property="og:image:secure_url" content="https://ratcheese1608.github.io/Resources/golden%20rat.jpg">
<meta property="og:image:width" content="320">
<meta property="og:image:height" content="482">
<meta property="og:image:type" content="image/jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://ratcheese1608.github.io/Resources/golden%20rat.jpg">
<title>Funny Kimia</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" media="only screen and (orientation: portrait)" href="smalley.css">
<script src="script.js"></script>
</head>
<body>
<iframe src="https://giphy.com/embed/eJ4j2VnYOZU8qJU3Py" frameBorder="0" class="giphy-embed" allowFullScreen style="width: 100vw; height: 90vh; z-index: 1;">
</iframe>
<p>
<a href="https://giphy.com/gifs/universalafrica-back-to-you-matthewmole-matthew-mole-eJ4j2VnYOZU8qJU3Py">via GIPHY</a>
<a href="/index.html">KEMBALI</a>
</p>
<div style="position: absolute; top:0; left: 0; width: 100vw; height: 90vh; z-index: 10;"></div>
</body>
</html>
62 changes: 40 additions & 22 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,53 @@ function updtinfo(n) {
}
}

function show_popup(target) {
target.style.display='flex';
setTimeout(()=>target.style.opacity=1,200);
}

function hide_popup(target){
target.style.opacity=0;
setTimeout(()=>target.style.display='none',200);
}

function q_event() {
console.log('Question TIME!');
qCont.style.display='flex';
setTimeout(()=>qCont.style.opacity=1,200);
show_popup(qCont);
}

function decline() {
hide_popup(qCont);
setTimeout(()=>{
// next images
qPic.src=serv[stor].Path+'/'+serv[stor].Images[++cImage];
lock=false;
},200);
turn = 1;
}

function accept() {
if (serv[stor].Answers[cImage] == ansOpt) {
console.log("Selamat kamu betul")
} else {
console.log("YAHAHAH KAMU SALAH")
}
decline()
}

function upd_hel(item, dec) {
item.hp=Math.max(item.hp-dec, 0);
item.elm.style.width=item.hp+'%';
setTimeout(()=>{
if (item.hp==0) {
lock=trye
if (item.id=="pl") {
window.location.href = "lose.html";
} else {
window.location.href = "win.html";
}
}
},750);
}

function cheesefly(source, target) {
Expand Down Expand Up @@ -131,26 +169,6 @@ function attack(source, target) {
}
}

function tolak() {
qCont.style.opacity=0;
setTimeout(()=>{
qCont.style.display='none';
// next images
qPic.src=serv[stor].Path+'/'+serv[stor].Images[++cImage];
lock=false;
},200);
turn = 1;
}

function terima() {
if (serv[stor].Answers[cImage] == ansOpt) {
console.log("Selamat kamu betul")
} else {
console.log("YAHAHAH KAMU SALAH")
}
tolak()
}

// main basically
function main() {
console.log("serv",serv);
Expand Down
9 changes: 9 additions & 0 deletions smalley.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
border: none;
}

.container {
padding: 15px;
}

.sprite-container > * {
margin: 0 5px;
}
Expand Down Expand Up @@ -37,6 +41,11 @@
flex-basis: 18%;
}

#start-container > * {
width: 100% !important;
box-sizing: border-box;
}

#cheese-ball {
width: 75px;
}
Loading

0 comments on commit 1e2f49e

Please sign in to comment.