blob: d04d95750930164c8d8b548950523d97133f011a [file] [log] [blame]
Andreu66ad5cf2019-09-18 17:15:44 +02001<html>
2 <head>
3 <meta charset="UTF-8">
4 <title>Pàgina de benvinguda</title>
avm99963db383ed2019-09-22 02:14:42 +02005
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7
Andreu4b2fbd92019-09-22 22:30:25 +02008 <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
9
Andreu66ad5cf2019-09-18 17:15:44 +020010 <link rel="stylesheet" href="./css/basic.css" />
11 <link rel="stylesheet" href="./css/login.css" />
avm99963db383ed2019-09-22 02:14:42 +020012
Andreu0b2f8432019-09-18 20:09:59 +020013 <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
Andreu543e70c2019-09-22 14:08:49 +020014 <script src="https://rawgit.com/notifyjs/notifyjs/master/dist/notify.js"></script>
15
16 <script src="./js/utils.js"></script>
17 <script src="./js/animations.js"></script>
Andreu66ad5cf2019-09-18 17:15:44 +020018 </head>
19 <body>
20 <div id="outter-container">
21 <div id="inner-container">
22 <h1>Selecciona el teu nom</h1>
avm99963db383ed2019-09-22 02:14:42 +020023 <p>Per entrar al joc de la Pastanaga Assessina</p>
Andreua0fc8272019-09-23 00:35:25 +020024 <form action="./main.php" method="POST">
Andreudd6cfb42019-09-22 19:52:39 +020025 <input type="hidden" name="user" id="user">
26
27 <!-- MD Search Box -->
28 <div class="md-google-search__metacontainer">
29 <div class="md-google-search__container">
30 <div class="md-google-search">
31 <span class="md-google-search__search-btn">
32 <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>
33 </span>
34 <div class="md-google-search__field-container">
35 <input id="search-input" class="md-google-search__field" autocomplete="off" placeholder="Usuari" value="" name="search" type="text" spellcheck="false" style="outline: none;">
36 </div>
37 <span class="md-google-search__empty-btn" style="display: none;">
38 <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>
39 </span>
40 </div>
41 </div>
42
43 <div class="autocomplete-container" style="display: none;">
44 <div id="autocomplete-list" class="autocomplete-items"></div>
45 </div>
46 </div>
avm99963db383ed2019-09-22 02:14:42 +020047
Andreu20cbd1d2019-09-22 00:00:57 +020048 <input disabled required placeholder="Clau d'accés..." id="password" type="password" name="password"/>
Andreu4b2fbd92019-09-22 22:30:25 +020049 <input type="submit" value="Entrar" id="submit" />
Andreu66ad5cf2019-09-18 17:15:44 +020050 </form>
51 </div>
52 </div>
avm99963db383ed2019-09-22 02:14:42 +020053
Andreudd6cfb42019-09-22 19:52:39 +020054 <script src="./js/autocomplete.js"></script>
Andreu0b2f8432019-09-18 20:09:59 +020055 <script>
Andreudd6cfb42019-09-22 19:52:39 +020056 fetch("./ajax/getusers.php").then(result => result.json()).then(users => {
Andreudd6cfb42019-09-22 19:52:39 +020057 autocomplete(document.getElementById("search-input"), users, "search");
Andreu1bf9ab72019-09-22 20:27:40 +020058 console.log(users);
59
Andreu99501052019-09-22 20:09:08 +020060 userid = <?=isset($_COOKIE['user']) ? (int)$_COOKIE['user'] : -1 ?>;
Andreu1bf9ab72019-09-22 20:27:40 +020061 username = get_user_name(users, userid);
Andreu4b2fbd92019-09-22 22:30:25 +020062 if (userid > 0) $("#search-input").prop("placeholder", username);
Andreu0b2f8432019-09-18 20:09:59 +020063 });
avm99963db383ed2019-09-22 02:14:42 +020064
Andreu543e70c2019-09-22 14:08:49 +020065 $(document).ready(function() {
66 // Notify of messages
67 if (getUrlParameter("passwordchanged")) read_message("La teva clau d'accés ha canviat", "error");
68 if (getUrlParameter("wrongpassword")) read_message("La clau d'accés no és correcta", "error");
69
70 });
Andreu0b2f8432019-09-18 20:09:59 +020071 </script>
Andreu66ad5cf2019-09-18 17:15:44 +020072 </body>
73</html>