Add files via upload
This commit is contained in:
parent
21dcb7ad15
commit
282db0889a
8 changed files with 267 additions and 68 deletions
100
app/stone-origami-sword/app.js
Normal file
100
app/stone-origami-sword/app.js
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
function randomNumber(min, max) {
|
||||||
|
min = Math.ceil(min);
|
||||||
|
max = Math.floor(max);
|
||||||
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
|
}
|
||||||
|
//Randomizer I copied from the internet
|
||||||
|
|
||||||
|
var output = '';
|
||||||
|
var win = 0;
|
||||||
|
var rounds = 0;
|
||||||
|
var winr = 0;
|
||||||
|
//Variables
|
||||||
|
|
||||||
|
function rockButton() {
|
||||||
|
output = '';
|
||||||
|
document.getElementById('rock').style.border = "3px solid #333333";
|
||||||
|
document.getElementById('paper').style.border = "3px solid #000000";
|
||||||
|
document.getElementById('scissors').style.border = "3px solid #000000";
|
||||||
|
output += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function paperButton() {
|
||||||
|
output = '';
|
||||||
|
document.getElementById('paper').style.border = "3px solid #333333";
|
||||||
|
document.getElementById('rock').style.border = "3px solid #000000";
|
||||||
|
document.getElementById('scissors').style.border = "3px solid #000000";
|
||||||
|
output += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
function scissorsButton() {
|
||||||
|
output = '';
|
||||||
|
document.getElementById('scissors').style.border = "3px solid #333333";
|
||||||
|
document.getElementById('rock').style.border = "3px solid #000000";
|
||||||
|
document.getElementById('paper').style.border = "3px solid #000000";
|
||||||
|
output += 3;
|
||||||
|
}
|
||||||
|
//Buttons for the options
|
||||||
|
|
||||||
|
function button() {
|
||||||
|
var bot = (randomNumber(1, 3));
|
||||||
|
var final = output / bot;
|
||||||
|
|
||||||
|
switch (bot) {
|
||||||
|
case 1:
|
||||||
|
document.getElementById("bot").innerHTML = "Bot chose stone.";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
document.getElementById("bot").innerHTML = "Bot chose origami.";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
document.getElementById("bot").innerHTML = "Bot chose sword.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (final) {
|
||||||
|
case 1:
|
||||||
|
document.getElementById("answer").innerHTML = "Tie";
|
||||||
|
break;
|
||||||
|
case 0.5:
|
||||||
|
document.getElementById("answer").innerHTML = "You chose stone and lost...";
|
||||||
|
rounds += 1;
|
||||||
|
break;
|
||||||
|
case 0.3333333333333333:
|
||||||
|
document.getElementById("answer").innerHTML = "You chose stone and won!";
|
||||||
|
win += 1;
|
||||||
|
rounds += 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
document.getElementById("answer").innerHTML = "You chose origami and won!";
|
||||||
|
win += 1;
|
||||||
|
rounds += 1;
|
||||||
|
break;
|
||||||
|
case 0.6666666666666666:
|
||||||
|
document.getElementById("answer").innerHTML = "You chose origami and lost...";
|
||||||
|
rounds += 1;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
document.getElementById("answer").innerHTML = "You chose sword and lost...";
|
||||||
|
rounds += 1;
|
||||||
|
break;
|
||||||
|
case 1.5:
|
||||||
|
document.getElementById("answer").innerHTML = "You chose sword and won!";
|
||||||
|
win += 1;
|
||||||
|
rounds += 1;
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
document.getElementById("answer").innerHTML = "You didn't pick anything.";
|
||||||
|
}
|
||||||
|
//Yikes that's a lot of cases and repetition
|
||||||
|
if (rounds >= 1) {
|
||||||
|
winr = Math.round(win/rounds*100);
|
||||||
|
document.getElementById("winrate").innerHTML = "Winrate: " + winr + "%";
|
||||||
|
} else {
|
||||||
|
document.getElementById("winrate").innerHTML = "Winrate:";
|
||||||
|
}
|
||||||
|
//I made this in like 2 minutes there's probably a more efficient way to calculate without it breaking
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Probably too many functions in a button but that's only way I know how to update page on press
|
||||||
BIN
app/stone-origami-sword/icon.png
Normal file
BIN
app/stone-origami-sword/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
|
|
@ -1,68 +1,68 @@
|
||||||
<?php
|
<?php
|
||||||
// CHECKS TO SEE IF USER OWNS APPLICATION
|
// CHECKS TO SEE IF USER OWNS APPLICATION
|
||||||
require_once("../../inc/conx.php");
|
require_once("../../inc/conx.php");
|
||||||
if($logged_in == false) {
|
if($logged_in == false) {
|
||||||
header("location: /");
|
header("location: /");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$app_uqid = "stone-origami-sword";
|
$app_uqid = "stone-origami-sword";
|
||||||
if(mysqli_num_rows(mysqli_query($conx, "SELECT uid FROM user_apps WHERE uid='$u_uid' && app_uqid='$app_uqid'")) == '0') {
|
if(mysqli_num_rows(mysqli_query($conx, "SELECT uid FROM user_apps WHERE uid='$u_uid' && app_uqid='$app_uqid'")) == '0') {
|
||||||
header("location: /hub");
|
header("location: /hub");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
# # # # # # #
|
# # # # # # #
|
||||||
# WEBSITE LOCATION #
|
# WEBSITE LOCATION #
|
||||||
# # # # # # #
|
# # # # # # #
|
||||||
if($u_siteloc != '/app/stone-origami-sword') {
|
if($u_siteloc != '/app/stone-origami-sword') {
|
||||||
$loc_desc = "usin\' Stone Origami Sword";
|
$loc_desc = "usin\' Stone Origami Sword";
|
||||||
mysqli_query($conx, "UPDATE accounts SET site_locdesc='$loc_desc' WHERE uid='$u_uid'");
|
mysqli_query($conx, "UPDATE accounts SET site_locdesc='$loc_desc' WHERE uid='$u_uid'");
|
||||||
mysqli_query($conx, "UPDATE accounts SET site_locurl='/app/stone-origami-sword' WHERE uid='$u_uid'");
|
mysqli_query($conx, "UPDATE accounts SET site_locurl='/app/stone-origami-sword' WHERE uid='$u_uid'");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="description" content="Blank HTML">
|
<meta name="description" content="Blank HTML">
|
||||||
|
|
||||||
<title>S.O.S. - Misdew</title>
|
<title>S.O.S. - Misdew</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="main.css">
|
<link rel="stylesheet" href="main.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body><center>
|
<body><center>
|
||||||
|
|
||||||
<script src="./app.js"></script>
|
<script src="./app.js"></script>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
|
|
||||||
|
|
||||||
<a href="/hub" style="text-decoration: none; color: #333;">Misdew</a>
|
<a href="/hub" style="text-decoration: none; color: #333;">Misdew</a>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th id='rock' onclick="rockButton()"><img src="rock.png" alt="Rock"></th>
|
<th id='rock' onclick="rockButton()"><img src="rock.png" alt="Rock"></th>
|
||||||
<th id='paper' onclick="paperButton()"><img src="paper.png" alt="Paper"></th>
|
<th id='paper' onclick="paperButton()"><img src="paper.png" alt="Paper"></th>
|
||||||
<th id='scissors' onclick="scissorsButton()"><img src="scissors.png" alt="Scissors"></th>
|
<th id='scissors' onclick="scissorsButton()"><img src="scissors.png" alt="Scissors"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div><a id='winStatic'></a><a id='winrate'>Good luck.</a></div>
|
<div><a id='winStatic'></a><a id='winrate'>Good luck.</a></div>
|
||||||
|
|
||||||
<br> <!-- Haha br go brrr -->
|
<br> <!-- Haha br go brrr -->
|
||||||
|
|
||||||
<button id=buttonDiv onclick="button()"><a>Submit</button><br><br>
|
<button id=buttonDiv onclick="button()"><a>Submit</button><br><br>
|
||||||
<div><a id='bot'> </a></div>
|
<div><a id='bot'> </a></div>
|
||||||
<div><a id='answer'> </a></div>
|
<div><a id='answer'> </a></div>
|
||||||
|
|
||||||
<!-- AHaahaha br go brrrrrrrr-->
|
<!-- AHaahaha br go brrrrrrrr-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</center></body>
|
</center></body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
33
app/stone-origami-sword/info.php
Normal file
33
app/stone-origami-sword/info.php
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
__ __ _____ _____
|
||||||
|
| \/ | __ \ | ____|
|
||||||
|
| \ / | | | |_ _| |__
|
||||||
|
| |\/| | | | \ \ / /___ \
|
||||||
|
| | | | |__| |\ V / ___) |
|
||||||
|
|_| |_|_____/ \_/ |____/ Join us. The hype is real.
|
||||||
|
|
||||||
|
You may code your application however you like.
|
||||||
|
It may be designed however you like.
|
||||||
|
You can do whatever you want, as long as you aren't mischievous.
|
||||||
|
You will not be able to access anything from Misdew's database.
|
||||||
|
However, you can connect to your own external database(s) if needed.
|
||||||
|
Be sure to fill out the required info below.
|
||||||
|
Once your app is done, zip all of your files into an archive.
|
||||||
|
Be sure to also include this file in the archive.
|
||||||
|
Name this archive as so: Username_AppName.zip
|
||||||
|
Upload this archive to dev.misdew.com
|
||||||
|
*/
|
||||||
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||||
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||||
|
# # # # # # # # # FILL OUT THE FORM # # # # # # # # #
|
||||||
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||||
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||||
|
$application_name = "Stone Origami Sword"; // Must not exceed 18 chars
|
||||||
|
$application_icon = "https://i.imgur.com/8oQmLWE.png"; // Upload your square, 1080x1080 icon to Imgur and paste the direct link here
|
||||||
|
$application_desc = "Play Stone Origami Sword against a bot."; // Describe your app
|
||||||
|
$application_price = "100"; // Set the price of your app (0 to whatever you want; you keep 70%)
|
||||||
|
$application_dev = "Lock"; // Enter your Misdew username here
|
||||||
|
$application_color = "black"; // Your app color; should be the same color as your icon's main color
|
||||||
|
$application_tcolor = "#333333"; // Should look good on top of your app's color (is used for font)
|
||||||
|
?>
|
||||||
66
app/stone-origami-sword/main.css
Normal file
66
app/stone-origami-sword/main.css
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
@import url('https://fonts.googleapis.com/css?family=Dosis:400,700');
|
||||||
|
th {
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: #000000;
|
||||||
|
margin: 0px;
|
||||||
|
font-family: 'Dosis', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
background-color: #000000 !important;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
height: 70px;
|
||||||
|
padding: 0px;
|
||||||
|
text-align: center;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 45px;
|
||||||
|
line-height: 60px;
|
||||||
|
font-family: 'Dosis', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#rock, #paper, #scissors {
|
||||||
|
border: 3px solid #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
font-family: 'Dosis', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#answer, #bot, #winStatic, #winrate {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#buttonDiv {
|
||||||
|
height: 66px;
|
||||||
|
width: 150px;
|
||||||
|
background-color: #000000;
|
||||||
|
border-radius: 5em;
|
||||||
|
border: 2px solid #333333;
|
||||||
|
line-height: 40px;
|
||||||
|
font-size: 25px;
|
||||||
|
color: #333333;
|
||||||
|
font-family: 'Dosis', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#patch {
|
||||||
|
color: white;
|
||||||
|
background-color: #2c2c2c;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
BIN
app/stone-origami-sword/paper.png
Normal file
BIN
app/stone-origami-sword/paper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
app/stone-origami-sword/rock.png
Normal file
BIN
app/stone-origami-sword/rock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
app/stone-origami-sword/scissors.png
Normal file
BIN
app/stone-origami-sword/scissors.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
Loading…
Add table
Add a link
Reference in a new issue