-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_live.html.leex
55 lines (49 loc) · 1.25 KB
/
game_live.html.leex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<div class="visible-elements-container">
<div class="username-manager-container">
<h1>
Hello, <%= @username %>!
</h1>
<%= f = form_for :username, "#", [phx_submit: :change_username] %>
<%= label f, :value, "Change username:" %>
<%= text_input f, :value, required: true %>
<div class="username-chooser-btn">
<%= submit "Submit" %>
</div>
</form>
</div>
<div class="status-message-container">
<h1>
<%= @status_message %>
</h1>
</div>
<div class="game-grid-wrapper">
<div class="game-grid">
<%= for cell_num <- 0..8 do %>
<div class="game-cell" phx-click="click_cell" phx-value-cell-num="<%= cell_num %>">
<%= case Enum.at(@game.board, cell_num) do %>
<% :empty -> %>
<% :x -> %>X
<% :o -> %>O
<% end %>
</div>
<% end %>
</div>
</div>
<div class="new-game-button-container">
<button class="new-game-button" phx-click="new_game">
Start New Game
</button>
</div>
<div class="user-list-container">
<h1>
User List:
</h1>
<ul class="user-list">
<%= for name <- @all_names do %>
<li>
<%= name %>
</li>
<% end %>
</ul>
</div>
</div>