Full beta
diff --git a/ajax/victiminfo.php b/ajax/victiminfo.php
index 44a3c88..e17a649 100644
--- a/ajax/victiminfo.php
+++ b/ajax/victiminfo.php
@@ -9,8 +9,8 @@
<table id="victim_info">
<tr>
- <td><img id="victim_img" src="https://picsum.photos/id/<?=$victim->id?>/200/200" /></td>
- <td>
+ <td class="table_img"><img id="victim_img" src="https://picsum.photos/id/<?=$victim->id?>/200/200" /></td>
+ <td class="table_text">
<div id="victim_name"><?=$victim->nomcomplet?></div>
<div id="victim_curs_i_grau">
<span id="victim_curs"><?=$victim->nomcurs()?></span>
diff --git a/bin/.Rhistory b/bin/.Rhistory
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bin/.Rhistory
diff --git a/bin/images/icons/icon-128x128.png b/bin/images/icons/icon-128x128.png
new file mode 100644
index 0000000..fdb4b6d
--- /dev/null
+++ b/bin/images/icons/icon-128x128.png
Binary files differ
diff --git a/bin/images/icons/icon-144x144.png b/bin/images/icons/icon-144x144.png
new file mode 100644
index 0000000..9334f05
--- /dev/null
+++ b/bin/images/icons/icon-144x144.png
Binary files differ
diff --git a/bin/images/icons/icon-152x152.png b/bin/images/icons/icon-152x152.png
new file mode 100644
index 0000000..af61cb2
--- /dev/null
+++ b/bin/images/icons/icon-152x152.png
Binary files differ
diff --git a/bin/images/icons/icon-192x192.png b/bin/images/icons/icon-192x192.png
new file mode 100644
index 0000000..e645f4d
--- /dev/null
+++ b/bin/images/icons/icon-192x192.png
Binary files differ
diff --git a/bin/images/icons/icon-384x384.png b/bin/images/icons/icon-384x384.png
new file mode 100644
index 0000000..7187d07
--- /dev/null
+++ b/bin/images/icons/icon-384x384.png
Binary files differ
diff --git a/bin/images/icons/icon-512x512.png b/bin/images/icons/icon-512x512.png
new file mode 100644
index 0000000..e18042b
--- /dev/null
+++ b/bin/images/icons/icon-512x512.png
Binary files differ
diff --git a/bin/images/icons/icon-72x72.png b/bin/images/icons/icon-72x72.png
new file mode 100644
index 0000000..406aba6
--- /dev/null
+++ b/bin/images/icons/icon-72x72.png
Binary files differ
diff --git a/bin/images/icons/icon-96x96.png b/bin/images/icons/icon-96x96.png
new file mode 100644
index 0000000..7bb9c72
--- /dev/null
+++ b/bin/images/icons/icon-96x96.png
Binary files differ
diff --git a/bin/manifest.json b/bin/manifest.json
new file mode 100644
index 0000000..d7c610b
--- /dev/null
+++ b/bin/manifest.json
@@ -0,0 +1,52 @@
+{
+ "name": "PastanagAPP",
+ "theme_color": "#36a000",
+ "background_color": "#ffa82e",
+ "display": "standalone",
+ "orientation": "portrait",
+ "Scope": "/beta/",
+ "start_url": "/beta/main.php",
+ "icons": [
+ {
+ "src": "images/icons/icon-72x72.png",
+ "sizes": "72x72",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/icon-96x96.png",
+ "sizes": "96x96",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/icon-128x128.png",
+ "sizes": "128x128",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/icon-144x144.png",
+ "sizes": "144x144",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/icon-152x152.png",
+ "sizes": "152x152",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/icon-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/icon-384x384.png",
+ "sizes": "384x384",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/icon-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ],
+ "splash_pages": null
+}
\ No newline at end of file
diff --git a/css/basic.css b/css/basic.css
index 38f4d7f..88dfeb2 100644
--- a/css/basic.css
+++ b/css/basic.css
@@ -1,6 +1,5 @@
body {
- font-size: 24px;
-
+ font-size: 18px;
background-image: url('https://images.unsplash.com/photo-1428196457394-f0c4aec5f574?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80');
background-size: cover;
}
diff --git a/css/login.css b/css/login.css
index c18a282..4130e71 100644
--- a/css/login.css
+++ b/css/login.css
@@ -1,5 +1,8 @@
#password {
- font-size: 18px;
+ font-size: 14px;
+ line-height: 1.75em;
+ font-family: 'Open Sans';
+ text-indent: 10px;
}
input[type="submit"] {
diff --git a/css/main.css b/css/main.css
index a07653c..73c2b6a 100644
--- a/css/main.css
+++ b/css/main.css
@@ -2,10 +2,29 @@
font-size: 18px;
}
+.goback {
+ font-size: 14px;
+ font-family: 'Open Sans';
+ float: right;
+ text-decoration: none;
+}
+
+#inner-container {
+ padding-bottom: 50px;
+}
+
table td {
vertical-align: top;
}
+td.table_text {
+ padding-left: 10px;
+}
+
+td.table_img {
+ padding-top: 10px;
+}
+
#butons button {
font-size: 1.25em;
min-height: 2em;
diff --git a/dead.php b/dead.php
index 2c3e3de..e65b073 100644
--- a/dead.php
+++ b/dead.php
@@ -7,7 +7,7 @@
<html>
<head>
<meta charset="UTF-8">
- <title>Pàgina de benvinguda</title>
+ <title>PastanagAPP - Mort/a</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -22,7 +22,7 @@
<body>
<div id="outter-container">
<div id="inner-container">
- <h1>Estàs mort!</h1>
+ <h1>Estàs mort/a!</h1>
<p>Torna a la pàgina principal.</p>
<a href="./index.php">Go back</a>
</div>
diff --git a/imgs/4.jpg b/imgs/4.jpg
deleted file mode 100644
index 5a71026..0000000
--- a/imgs/4.jpg
+++ /dev/null
Binary files differ
diff --git a/imgs/carrot.png b/imgs/carrot.png
new file mode 100644
index 0000000..a794d38
--- /dev/null
+++ b/imgs/carrot.png
Binary files differ
diff --git a/index.php b/index.php
index d04d957..766b46a 100644
--- a/index.php
+++ b/index.php
@@ -1,9 +1,16 @@
<html>
<head>
<meta charset="UTF-8">
- <title>Pàgina de benvinguda</title>
+ <title>PastanagAPP</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="manifest" href="https://api.myjson.com/bins/u6r41">
+
+ <!-- Apple web app -->
+ <link rel="apple-touch-icon" href="./bin/images/icons/icon-72x72.png">
+ <meta name="apple-mobile-web-app-title" content="PastanagAPP">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="green">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
@@ -19,8 +26,6 @@
<body>
<div id="outter-container">
<div id="inner-container">
- <h1>Selecciona el teu nom</h1>
- <p>Per entrar al joc de la Pastanaga Assessina</p>
<form action="./main.php" method="POST">
<input type="hidden" name="user" id="user">
@@ -32,7 +37,7 @@
<svg height="24px" viewBox="0 0 24 24" width="24px" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>
</span>
<div class="md-google-search__field-container">
- <input id="search-input" class="md-google-search__field" autocomplete="off" placeholder="Usuari" value="" name="search" type="text" spellcheck="false" style="outline: none;">
+ <input id="search-input" class="md-google-search__field" required autocomplete="off" placeholder="Introdueix usuari..." value="" name="search" type="text" spellcheck="false" style="outline: none;">
</div>
<span class="md-google-search__empty-btn" style="display: none;">
<svg focusable="false" height="24px" viewBox="0 0 24 24" width="24px" xmlns="http://www.w3.org/2000/svg"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>
@@ -48,6 +53,8 @@
<input disabled required placeholder="Clau d'accés..." id="password" type="password" name="password"/>
<input type="submit" value="Entrar" id="submit" />
</form>
+
+ <p>La primera persona que entri al teu compte tindrà l'oportunitat de canviar la contrasenya.</p>
</div>
</div>
@@ -61,12 +68,14 @@
username = get_user_name(users, userid);
if (userid > 0) $("#search-input").prop("placeholder", username);
});
-
+
$(document).ready(function() {
// Notify of messages
if (getUrlParameter("passwordchanged")) read_message("La teva clau d'accés ha canviat", "error");
if (getUrlParameter("wrongpassword")) read_message("La clau d'accés no és correcta", "error");
-
+ if (getUrlParameter("wrongconfirmation")) read_message("Les contrasenyes no coincideixen", "error");
+ if (getUrlParameter("errordb")) read_message("Hi ha hagut un problema a la base de dades, torna-ho a intentar", "error");
+ if (getUrlParameter("successpassword")) read_message("La teva clau d'accés s'ha guardat", "success");
});
</script>
</body>
diff --git a/main.php b/main.php
index 955e6e9..bb2ffbf 100644
--- a/main.php
+++ b/main.php
@@ -1,16 +1,16 @@
<?php
require './credentials.php';
require './php/utils.php';
-
+
$user = (int)$_POST['user'];
- $password = $_POST['password'] == '' ? '' : md5($_POST['password']);
+ $password = isset($_POST['password']) ? md5($_POST['password']) : '';
// Check if password is correct
$query_password = "SELECT password FROM users WHERE id=".$user;
$real_password = query($query_password)->fetch_row()[0];
if ($real_password != $password) die("<script>window.location.href = './index.php?wrongpassword=1'</script>");
- if (!isset($_POST['user'])) {
+ if (!isset($_POST['user']) or $_POST['user'] == '') {
die("<script>window.location.href = './index.php'</script>");
} else if (isset($_POST['password'])) {
$query_password = "SELECT password FROM users WHERE id=$user";
@@ -26,9 +26,17 @@
<html>
<head>
<meta charset="UTF-8">
- <title>Pàgina de l'usuari</title>
+ <title>PastanagAPP</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="manifest" href="https://api.myjson.com/bins/u6r41">
+
+ <!-- Apple web app -->
+ <link rel="apple-touch-icon" href="./bin/images/icons/icon-72x72.png">
+ <meta name="apple-mobile-web-app-title" content="PastanagAPP">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="green">
+
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
@@ -64,6 +72,7 @@
<body>
<div id="outter-container">
<div id="inner-container">
+ <a href="./index.php" class="goback">Torna a la pàgina principal</a><br />
<h2>Hola <name id="user_name"><?=$user->nom()?></name>,</h2>
<div class="formulari_contrasenya">
@@ -81,8 +90,8 @@
<div class="victima">
<table>
<tr>
- <td><img id="victim_img" src="https://picsum.photos/id/<?=$victim->id?>/200/200" /></td>
- <td>
+ <td class="table_img"><img id="victim_img" src="https://picsum.photos/id/<?=$victim->id?>/200/200" /></td>
+ <td class="table_text">
<div id="victim_name"><?=$victim->nomcomplet?></div>
<div id="victim_curs_i_grau">
<span id="victim_curs"><?=$victim->nomcurs()?></span>
@@ -110,11 +119,6 @@
$.notify("No tens clau d'accés", "info");
$(".formulari_contrasenya").show();
}
-
- // Notify of messages
- if (getUrlParameter("wrongconfirmation")) read_message("Les contrasenyes no coincideixen", "error");
- if (getUrlParameter("errordb")) read_message("Hi ha hagut un problema a la base de dades, torna-ho a intentar", "error");
- if (getUrlParameter("successpassword")) read_message("La teva clau d'accés s'ha guardat", "success");
});
</script>
</body>
diff --git a/php/change_password.php b/php/change_password.php
index 1585a41..d02f389 100644
--- a/php/change_password.php
+++ b/php/change_password.php
@@ -4,16 +4,16 @@
// Check if confirmation is the same
if ($_POST['password'] != $_POST['confirmation']) {
- die("<script>window.location.href = '../main.php?wrongconfirmation=1'</script>");
+ die("<script>window.location.href = '../index.php?wrongconfirmation=1'</script>");
} else {
// Execute query to change password
$update_password = "UPDATE users SET password=\"".md5($_POST['password'])."\" WHERE id=".$_POST['userid'];
- if(!$result = query($update_password)) die("<script>window.location.href = '../main.php?errordb=1'</script>");
+ if(!$result = query($update_password)) die("<script>window.location.href = '../index.php?errordb=1'</script>");
// Save 'password' to cookies
setcookie('password', md5($_POST['password']), time() + (86400 * 10), "/");
// Go back to main page
- die("<script>window.location.href = '../main.php?successpassword=1'</script>");
+ die("<script>window.location.href = '../index.php?successpassword=1'</script>");
}
?>