Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <meta charset="UTF-8"> |
| 4 | <title>Pàgina de benvinguda</title> |
avm99963 | db383ed | 2019-09-22 02:14:42 +0200 | [diff] [blame] | 5 | |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 8 | <link rel="stylesheet" href="./css/basic.css" /> |
| 9 | <link rel="stylesheet" href="./css/login.css" /> |
avm99963 | db383ed | 2019-09-22 02:14:42 +0200 | [diff] [blame] | 10 | |
Andreu | 0b2f843 | 2019-09-18 20:09:59 +0200 | [diff] [blame] | 11 | <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> |
Andreu | 543e70c | 2019-09-22 14:08:49 +0200 | [diff] [blame] | 12 | <script src="https://rawgit.com/notifyjs/notifyjs/master/dist/notify.js"></script> |
| 13 | |
| 14 | <script src="./js/utils.js"></script> |
| 15 | <script src="./js/animations.js"></script> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 16 | </head> |
| 17 | <body> |
| 18 | <div id="outter-container"> |
| 19 | <div id="inner-container"> |
| 20 | <h1>Selecciona el teu nom</h1> |
avm99963 | db383ed | 2019-09-22 02:14:42 +0200 | [diff] [blame] | 21 | <p>Per entrar al joc de la Pastanaga Assessina</p> |
Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame] | 22 | <form action="./php/login.php" method="POST"> |
Andreu | dd6cfb4 | 2019-09-22 19:52:39 +0200 | [diff] [blame^] | 23 | <input type="hidden" name="user" id="user"> |
| 24 | |
| 25 | <!-- MD Search Box --> |
| 26 | <div class="md-google-search__metacontainer"> |
| 27 | <div class="md-google-search__container"> |
| 28 | <div class="md-google-search"> |
| 29 | <span class="md-google-search__search-btn"> |
| 30 | <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> |
| 31 | </span> |
| 32 | <div class="md-google-search__field-container"> |
| 33 | <input id="search-input" class="md-google-search__field" autocomplete="off" placeholder="Usuari" value="" name="search" type="text" spellcheck="false" style="outline: none;"> |
| 34 | </div> |
| 35 | <span class="md-google-search__empty-btn" style="display: none;"> |
| 36 | <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> |
| 37 | </span> |
| 38 | </div> |
| 39 | </div> |
| 40 | |
| 41 | <div class="autocomplete-container" style="display: none;"> |
| 42 | <div id="autocomplete-list" class="autocomplete-items"></div> |
| 43 | </div> |
| 44 | </div> |
avm99963 | db383ed | 2019-09-22 02:14:42 +0200 | [diff] [blame] | 45 | |
Andreu | 20cbd1d | 2019-09-22 00:00:57 +0200 | [diff] [blame] | 46 | <input disabled required placeholder="Clau d'accés..." id="password" type="password" name="password"/> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 47 | <input type="submit" value="Entrar" /> |
| 48 | </form> |
| 49 | </div> |
| 50 | </div> |
avm99963 | db383ed | 2019-09-22 02:14:42 +0200 | [diff] [blame] | 51 | |
Andreu | dd6cfb4 | 2019-09-22 19:52:39 +0200 | [diff] [blame^] | 52 | <script src="./js/autocomplete.js"></script> |
Andreu | 0b2f843 | 2019-09-18 20:09:59 +0200 | [diff] [blame] | 53 | <script> |
Andreu | dd6cfb4 | 2019-09-22 19:52:39 +0200 | [diff] [blame^] | 54 | fetch("./ajax/getusers.php").then(result => result.json()).then(users => { |
| 55 | console.log(users); |
| 56 | autocomplete(document.getElementById("search-input"), users, "search"); |
| 57 | |
Andreu | ef5af2d | 2019-09-22 01:24:47 +0200 | [diff] [blame] | 58 | userid = <?=isset($_COOKIE['user']) ? $_COOKIE['user'] : -1 ?>; |
Andreu | 2a26cd7 | 2019-09-22 01:58:23 +0200 | [diff] [blame] | 59 | username = $('option[value=' + userid + ']').text(); |
Andreu | ef5af2d | 2019-09-22 01:24:47 +0200 | [diff] [blame] | 60 | |
| 61 | if (userid > 0) { |
Andreu | ef5af2d | 2019-09-22 01:24:47 +0200 | [diff] [blame] | 62 | redir = confirm("Has entrat com a usuari " + username + " anteriorment, vols tornar-ho a fer?"); |
| 63 | if (redir) window.location.href = 'main.php'; |
| 64 | } |
Andreu | 0b2f843 | 2019-09-18 20:09:59 +0200 | [diff] [blame] | 65 | }); |
avm99963 | db383ed | 2019-09-22 02:14:42 +0200 | [diff] [blame] | 66 | |
Andreu | 543e70c | 2019-09-22 14:08:49 +0200 | [diff] [blame] | 67 | $(document).ready(function() { |
| 68 | // Notify of messages |
| 69 | if (getUrlParameter("passwordchanged")) read_message("La teva clau d'accés ha canviat", "error"); |
| 70 | if (getUrlParameter("wrongpassword")) read_message("La clau d'accés no és correcta", "error"); |
| 71 | |
| 72 | }); |
Andreu | 0b2f843 | 2019-09-18 20:09:59 +0200 | [diff] [blame] | 73 | </script> |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 74 | </body> |
| 75 | </html> |