aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/css/fia.css22
-rwxr-xr-xpublic/imgs/chequer-blue.pngbin0 -> 7190 bytes
-rwxr-xr-xpublic/imgs/chequer-green.pngbin0 -> 13153 bytes
-rwxr-xr-xpublic/imgs/chequer-red.pngbin0 -> 10981 bytes
-rwxr-xr-xpublic/imgs/chequer-yellow.pngbin0 -> 12357 bytes
-rwxr-xr-xpublic/imgs/dice-1.pngbin0 -> 42445 bytes
-rwxr-xr-xpublic/imgs/dice-2.pngbin0 -> 50881 bytes
-rwxr-xr-xpublic/imgs/dice-3.pngbin0 -> 70612 bytes
-rwxr-xr-xpublic/imgs/dice-4.pngbin0 -> 73484 bytes
-rwxr-xr-xpublic/imgs/dice-5.pngbin0 -> 68973 bytes
-rwxr-xr-xpublic/imgs/dice-6.pngbin0 -> 88847 bytes
-rwxr-xr-xpublic/imgs/fia.pngbin0 -> 27383 bytes
-rw-r--r--public/index.html6
-rw-r--r--public/php/dbCredentials.php4
-rw-r--r--public/php/fia.php34
15 files changed, 52 insertions, 14 deletions
diff --git a/public/css/fia.css b/public/css/fia.css
index 80d5b61..93d4c6d 100644
--- a/public/css/fia.css
+++ b/public/css/fia.css
@@ -2,7 +2,7 @@
width: 660px;
height: 660px;
margin: 0 auto;
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/fia.png");
+ background-image: url("../imgs/fia.png");
background-size: contain;
border-collapse: separate;
padding: 0;
@@ -32,22 +32,22 @@
background-size: contain;
}
.dice-1 {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/dice-1.png");
+ background-image: url("../imgs/dice-1.png");
}
.dice-2 {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/dice-2.png");
+ background-image: url("../imgs/dice-2.png");
}
.dice-3 {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/dice-3.png");
+ background-image: url("../imgs/dice-3.png");
}
.dice-4 {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/dice-4.png");
+ background-image: url("../imgs/dice-4.png");
}
.dice-5 {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/dice-5.png");
+ background-image: url("../imgs/dice-5.png");
}
.dice-6 {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/dice-6.png");
+ background-image: url("../imgs/dice-6.png");
}
.player-name :nth-child(even) {
@@ -61,19 +61,19 @@
-webkit-text-stroke: 5px black;
}
.chequer-red {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/chequer-red.png");
+ background-image: url("../imgs/chequer-red.png");
border: 4px solid black;
}
.chequer-blue {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/chequer-blue.png");
+ background-image: url("../imgs/chequer-blue.png");
border: 4px solid black;
}
.chequer-green {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/chequer-green.png");
+ background-image: url("../imgs/chequer-green.png");
border: 4px solid black;
}
.chequer-yellow {
- background-image: url("https://jopek.eu/maks/szkola/apkKli/fiaFiles/chequer-yellow.png");
+ background-image: url("../imgs/chequer-yellow.png");
border: 4px solid black;
}
.chequer-white {
diff --git a/public/imgs/chequer-blue.png b/public/imgs/chequer-blue.png
new file mode 100755
index 0000000..67d3b94
--- /dev/null
+++ b/public/imgs/chequer-blue.png
Binary files differ
diff --git a/public/imgs/chequer-green.png b/public/imgs/chequer-green.png
new file mode 100755
index 0000000..bcca402
--- /dev/null
+++ b/public/imgs/chequer-green.png
Binary files differ
diff --git a/public/imgs/chequer-red.png b/public/imgs/chequer-red.png
new file mode 100755
index 0000000..878cdc2
--- /dev/null
+++ b/public/imgs/chequer-red.png
Binary files differ
diff --git a/public/imgs/chequer-yellow.png b/public/imgs/chequer-yellow.png
new file mode 100755
index 0000000..bf74e1a
--- /dev/null
+++ b/public/imgs/chequer-yellow.png
Binary files differ
diff --git a/public/imgs/dice-1.png b/public/imgs/dice-1.png
new file mode 100755
index 0000000..c698476
--- /dev/null
+++ b/public/imgs/dice-1.png
Binary files differ
diff --git a/public/imgs/dice-2.png b/public/imgs/dice-2.png
new file mode 100755
index 0000000..9eb260d
--- /dev/null
+++ b/public/imgs/dice-2.png
Binary files differ
diff --git a/public/imgs/dice-3.png b/public/imgs/dice-3.png
new file mode 100755
index 0000000..f5d53d0
--- /dev/null
+++ b/public/imgs/dice-3.png
Binary files differ
diff --git a/public/imgs/dice-4.png b/public/imgs/dice-4.png
new file mode 100755
index 0000000..b4fca33
--- /dev/null
+++ b/public/imgs/dice-4.png
Binary files differ
diff --git a/public/imgs/dice-5.png b/public/imgs/dice-5.png
new file mode 100755
index 0000000..6f9d5de
--- /dev/null
+++ b/public/imgs/dice-5.png
Binary files differ
diff --git a/public/imgs/dice-6.png b/public/imgs/dice-6.png
new file mode 100755
index 0000000..a51e5b3
--- /dev/null
+++ b/public/imgs/dice-6.png
Binary files differ
diff --git a/public/imgs/fia.png b/public/imgs/fia.png
new file mode 100755
index 0000000..9597560
--- /dev/null
+++ b/public/imgs/fia.png
Binary files differ
diff --git a/public/index.html b/public/index.html
index 9cc5532..617de91 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,8 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fia</title>
- <link rel="stylesheet" href="fia/css/bootstrap.min.css" />
- <link rel="stylesheet" href="fia/css/fia.css" />
+ <link rel="stylesheet" href="css/bootstrap.min.css" />
+ <link rel="stylesheet" href="css/fia.css" />
</head>
<body class="bg-dark text-white">
<noscript>
@@ -14,6 +14,6 @@
Tyvärr, men för att spela Fia måste du aktivera skript
</div>
</noscript>
- <script src="fia/js/frontend/ts/login.js" type="module"></script>
+ <script src="js/frontend/ts/login.js" type="module"></script>
</body>
</html>
diff --git a/public/php/dbCredentials.php b/public/php/dbCredentials.php
new file mode 100644
index 0000000..87bbfd5
--- /dev/null
+++ b/public/php/dbCredentials.php
@@ -0,0 +1,4 @@
+<?php
+ $apiKey = "secureApiKey123(!*";
+ $dbUser = "admin";
+ $dbPassword = "qwerty123";
diff --git a/public/php/fia.php b/public/php/fia.php
new file mode 100644
index 0000000..b9f45f1
--- /dev/null
+++ b/public/php/fia.php
@@ -0,0 +1,34 @@
+<?php
+error_reporting(E_ALL);
+ini_set('display_errors', 1);
+
+$req = json_decode(file_get_contents("php://input"));
+require_once "dbCredentials.php";
+
+if ($req->apiKey === $apiKey) {
+ $http = isset($_SERVER["HTTPS"]) ? "https" : "http";
+ header("Access-Control-Allow-Origin: $http://localhost:8000");
+ $pdo = new PDO("mysql:dbname=ClientApps;host=localhost;charset=utf8mb4", $dbUser, $dbPassword);
+ $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
+ $stmt = $pdo->prepare($req->query);
+ try {
+ $params = [];
+ foreach ($req->params as $v) {
+ if(is_string($v))
+ array_push($params, $v);
+ else
+ array_push($params, json_encode($v));
+ }
+ $stmt->execute($params);
+ } catch (PDOException $e) {
+ echo "ERROR!!!";
+ var_dump($req);
+ var_dump($stmt);
+ throw $e;
+ }
+ echo json_encode($stmt->fetchAll(PDO::FETCH_ASSOC));
+ http_response_code(200);
+} else {
+ echo "Wrong username or password!";
+ http_response_code(401);
+}