diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/header.ejs | 5 | ||||
-rw-r--r-- | views/login.ejs | 23 | ||||
-rw-r--r-- | views/nav.ejs | 7 | ||||
-rw-r--r-- | views/play.ejs | 4 |
4 files changed, 35 insertions, 4 deletions
diff --git a/views/header.ejs b/views/header.ejs index ddc0b56..e4d69d6 100644 --- a/views/header.ejs +++ b/views/header.ejs @@ -3,11 +3,12 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel="icon" href="/favicon.svg"> + <link rel="icon" href="/static/favicon.svg"> - <link rel="stylesheet" type="text/css" href="index.css" media="all"> + <link rel="stylesheet" type="text/css" href="/static/index.css" media="all"> <title>Jeu de mots - <%- title %></title> </head> <body> + <%- include("nav") %> <noscript>You need to enable JavaScript to run this app.</noscript> <main> diff --git a/views/login.ejs b/views/login.ejs new file mode 100644 index 0000000..e1178d7 --- /dev/null +++ b/views/login.ejs @@ -0,0 +1,23 @@ +<%- include("header") %> +<form action="/login" method="post"> + <% if (Object.keys(errors).length === 0) { %> + <h2>Connexion:</h2> + <% } else { %> + <h2>Oops, erreur de connexion!</h2> + <% } %> + <div class="form-field<%= errors.username ? ' form-field-invalid' : '' %>"> + <input type="text" placeholder="Identifiant" name="username" value="<%= data.username %>" required autofocus> + <% if (errors.username) { %> + <label class="error" for="username"><%= errors.username.msg %></label> + <% } %> + </div> + <div class="form-field<%= errors.password ? ' form-field-invalid' : '' %>"> + <input type="password" placeholder="Mot de passe" name="password" value="<%= data.password %>" required> + <% if (errors.password) { %> + <label class="error" for="password"><%= errors.password.msg %></label> + <% } %> + </div> + <button type="submit">Connexion</button> +</form> +<!-- TODO forgot password link --> +<%- include("footer") %> diff --git a/views/nav.ejs b/views/nav.ejs new file mode 100644 index 0000000..b494b55 --- /dev/null +++ b/views/nav.ejs @@ -0,0 +1,7 @@ +<header> + <nav> + <ul> + <li class="nav-menu-title">Jeu de mots</li> + </ul> + </nav> +</header> diff --git a/views/play.ejs b/views/play.ejs index 5998e40..bc98c94 100644 --- a/views/play.ejs +++ b/views/play.ejs @@ -1,5 +1,5 @@ <%- include("header") %> -<h1>Jeu de mots</h1> +<h2>À vous de jouer</h2> <table id="board"> <tr><td id="s0_0" class="tw" title="triple word"><td id="s0_1"><td id="s0_2"><td id="s0_3" class="dl" title="double letter"><td id="s0_4"><td id="s0_5"><td id="s0_6"><td id="s0_7" class="tw" title="triple word"><td id="s0_8"><td id="s0_9"><td id="s0_10"><td id="s0_11" class="dl" title="double letter"><td id="s0_12"><td id="s0_13"><td id="s0_14" class="tw" title="triple word"></tr> <tr><td id="s1_0"><td id="s1_1" class="dw" title="double word"><td id="s1_2"><td id="s1_3"><td id="s1_4"><td id="s1_5" class="tl" title="triple letter"><td id="s1_6"><td id="s1_7"><td id="s1_8"><td id="s1_9" class="tl" title="triple letter"><td id="s1_10"><td id="s1_11"><td id="s1_12"><td id="s1_13" class="dw" title="double word"><td id="s1_14"></tr> @@ -32,5 +32,5 @@ </p> <p id="remaining_letters"></p> <script>var CWDATA = <%- JSON.stringify(CWDATA) %></script> -<script type="module" src="index.js"></script> +<script type="module" src="/static/index.js"></script> <%- include("footer") %> |