Skip to content

Commit 26af7fb

Browse files
committed
Format heex files
Result of automatic formatting: ``` mix format --check-formatted mix format ```
1 parent 1c5a98a commit 26af7fb

12 files changed

+254
-51
lines changed

Diff for: lib/mjw_web/components/layouts/root.html.heex

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<meta name="csrf-token" content={get_csrf_token()} />
77
<.live_title><%= assigns[:page_title] || "Mahjong Wind" %></.live_title>
88
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
9-
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}></script>
9+
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
10+
</script>
1011
</head>
1112
<body>
1213
<%= @inner_content %>

Diff for: lib/mjw_web/live/game_live/current_user_seat_component.html.heex

+36-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,47 @@
11
<div id={@id}>
22
<div class={"tiles flex-wrap turn-glow-0-#{if @current_user_drawing, do: "t"}"}>
3-
<div id="hiddengongs-0" phx-hook="Drag" phx-target="#game" class={"hiddengong-tiles dropzone#{if @win_declared_seatno && @win_declared_seatno != @current_user_seatno && @seat.win_expose, do: " exposed-loser-hand"}"}>
3+
<div
4+
id="hiddengongs-0"
5+
phx-hook="Drag"
6+
phx-target="#game"
7+
class={"hiddengong-tiles dropzone#{if @win_declared_seatno && @win_declared_seatno != @current_user_seatno && @seat.win_expose, do: " exposed-loser-hand"}"}
8+
>
49
<%= for tile <- @seat.hiddengongs do %>
5-
<img id={tile} src={"/images/tiles/#{Mjw.Tile.without_id(tile)}.png"} alt="" class="tile draggable" />
10+
<img
11+
id={tile}
12+
src={"/images/tiles/#{Mjw.Tile.without_id(tile)}.png"}
13+
alt=""
14+
class="tile draggable"
15+
/>
616
<% end %>
717
<div class="dropzone-description">Hidden gong</div>
818
</div>
919

1020
<div id="exposed-0" phx-hook="Drag" phx-target="#game" class="exposed-tiles dropzone">
1121
<%= for tile <- @seat.exposed do %>
12-
<img id={tile} src={"/images/tiles/#{Mjw.Tile.without_id(tile)}.png"} alt="" class="tile draggable" />
22+
<img
23+
id={tile}
24+
src={"/images/tiles/#{Mjw.Tile.without_id(tile)}.png"}
25+
alt=""
26+
class="tile draggable"
27+
/>
1328
<% end %>
1429
<div class="dropzone-description">Exposed tiles</div>
1530
</div>
1631

17-
<div id="wintile-0" phx-hook="Drag" phx-target="#game" class={"wintile-tiles#{if !@win_declared_seatno || @win_declared_seatno == @current_user_seatno, do: " dropzone"}"}>
32+
<div
33+
id="wintile-0"
34+
phx-hook="Drag"
35+
phx-target="#game"
36+
class={"wintile-tiles#{if !@win_declared_seatno || @win_declared_seatno == @current_user_seatno, do: " dropzone"}"}
37+
>
1838
<%= if @seat.wintile do %>
19-
<img id={@seat.wintile} src={"/images/tiles/#{Mjw.Tile.without_id(@seat.wintile)}.png"} alt="" class="tile cursor-not-allowed" />
39+
<img
40+
id={@seat.wintile}
41+
src={"/images/tiles/#{Mjw.Tile.without_id(@seat.wintile)}.png"}
42+
alt=""
43+
class="tile cursor-not-allowed"
44+
/>
2045
<% end %>
2146
<%= if !@win_declared_seatno || @win_declared_seatno == @current_user_seatno do %>
2247
<div class="dropzone-description">Winning tile</div>
@@ -25,7 +50,12 @@
2550

2651
<div class="line-break"></div>
2752

28-
<div id="concealed-0" phx-hook="Drag" phx-target="#game" class={"concealed-tiles dropzone current-user-discarding-#{if @current_user_discarding, do: "t"} enable-pull-from-discards-#{if @available_discard_tile, do: "t"} concealed-loser-hand-#{if @concealed_loser_hand, do: "t"}"}>
53+
<div
54+
id="concealed-0"
55+
phx-hook="Drag"
56+
phx-target="#game"
57+
class={"concealed-tiles dropzone current-user-discarding-#{if @current_user_discarding, do: "t"} enable-pull-from-discards-#{if @available_discard_tile, do: "t"} concealed-loser-hand-#{if @concealed_loser_hand, do: "t"}"}
58+
>
2959
<%= for tile <- @seat.concealed do %>
3060
<img
3161
id={tile}

Diff for: lib/mjw_web/live/game_live/dice_component.html.heex

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
<div class={"dice-#{@previous_roller_relative_position}"}>
33
<%= if @rolled_dice do %>
44
<%= for {die, i} <- Enum.with_index(@dice) do %>
5-
<img src={"/images/dice/d#{die}.png"} alt="" class={"die die-#{i}#{if @raw_event in [:rolled_for_first_dealer, :rolled_for_deal], do: " #{@game_state}-#{@previous_roller_relative_position}"}"} />
5+
<img
6+
src={"/images/dice/d#{die}.png"}
7+
alt=""
8+
class={"die die-#{i}#{if @raw_event in [:rolled_for_first_dealer, :rolled_for_deal], do: " #{@game_state}-#{@previous_roller_relative_position}"}"}
9+
/>
610
<% end %>
711
<% end %>
812
</div>
+41-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<div id={@id} class="phx-modal relative" phx-target="#game" phx-click="closegamemenu">
22
<div class="gamemenu-content">
33
<%= if @player_seats_finalized do %>
4-
<div phx-target="#game" phx-click="draw" class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4">
4+
<div
5+
phx-target="#game"
6+
phx-click="draw"
7+
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4"
8+
>
59
Declare draw 🤝
610
</div>
711

812
<div id="dqs" phx-hook="DeclareDq" phx-click="">
9-
<div id="declare-dq-btn" class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4">
13+
<div
14+
id="declare-dq-btn"
15+
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4"
16+
>
1017
Declare DQ 🙅🏻‍♀️
1118
</div>
1219

@@ -15,7 +22,12 @@
1522
</div>
1623

1724
<%= for seat <- @relative_game_seats |> Enum.drop(1) do %>
18-
<div class="dqplayer bg-red-600 hover:bg-red-500 text-gray-200 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4 hidden" phx-target="#game" phx-click="dq" phx-value-seatno={seat.seatno}>
25+
<div
26+
class="dqplayer bg-red-600 hover:bg-red-500 text-gray-200 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4 hidden"
27+
phx-target="#game"
28+
phx-click="dq"
29+
phx-value-seatno={seat.seatno}
30+
>
1931
<%= seat.player_name %>
2032
</div>
2133
<% end %>
@@ -24,7 +36,10 @@
2436

2537
<%= if length(@relative_game_seats_with_players) > 1 do %>
2638
<div id="bootplayers" phx-hook="BootPlayer" phx-click="">
27-
<div id="boot-player-btn" class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4">
39+
<div
40+
id="boot-player-btn"
41+
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4"
42+
>
2843
Boot player 🥾
2944
</div>
3045

@@ -33,25 +48,43 @@
3348
</div>
3449

3550
<%= for seat <- @relative_game_seats_with_players |> Enum.drop(1) do %>
36-
<div class="bootplayer bg-red-600 hover:bg-red-500 text-gray-200 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4 hidden" phx-target="#game" phx-click="bootplayer" phx-value-seatno={seat.seatno}>
51+
<div
52+
class="bootplayer bg-red-600 hover:bg-red-500 text-gray-200 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4 hidden"
53+
phx-target="#game"
54+
phx-click="bootplayer"
55+
phx-value-seatno={seat.seatno}
56+
>
3757
<%= seat.player_name %>
3858
</div>
3959
<% end %>
4060
</div>
4161
<% end %>
4262

43-
<div phx-target={@myself} class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4" phx-click="quit">
63+
<div
64+
phx-target={@myself}
65+
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4"
66+
phx-click="quit"
67+
>
4468
Leave game
4569
</div>
4670

47-
<div phx-target="#game" phx-click="reset" class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4">
71+
<div
72+
phx-target="#game"
73+
phx-click="reset"
74+
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow cursor-pointer my-4"
75+
>
4876
<div phx-target="#game" phx-click="reset">
4977
Reset game
5078
</div>
5179
</div>
5280

5381
<div phx-click="">
54-
<.live_component module={MjwWeb.GameLive.InviteLinkComponent} id="invite-link-gamemenu" game={@game} game_state={@game_state} />
82+
<.live_component
83+
module={MjwWeb.GameLive.InviteLinkComponent}
84+
id="invite-link-gamemenu"
85+
game={@game}
86+
game_state={@game_state}
87+
/>
5588
</div>
5689
</div>
5790
</div>

Diff for: lib/mjw_web/live/game_live/index.html.heex

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
<%= unless Enum.empty?(@games) do %>
99
<div class="pt-12 pb-10 text-xl font-semibold">or join a game in progress:</div>
1010
<%= for game <- @games do %>
11-
<.live_component module={MjwWeb.GameLive.LobbyGameComponent} id={"join-#{game.id}"} game={game} />
11+
<.live_component
12+
module={MjwWeb.GameLive.LobbyGameComponent}
13+
id={"join-#{game.id}"}
14+
game={game}
15+
/>
1216
<% end %>
1317
<% end %>
1418
</div>

Diff for: lib/mjw_web/live/game_live/invite_link_component.html.heex

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<div id={@id} class="text-gray-800 text-base font-semibold py-2 px-4 my-4" phx-hook="CopyToClipboard">
2-
Invite link:
3-
<% game_url = url(~p"/games/#{@game.id}") %>
1+
<div
2+
id={@id}
3+
class="text-gray-800 text-base font-semibold py-2 px-4 my-4"
4+
phx-hook="CopyToClipboard"
5+
>
6+
Invite link: <% game_url = url(~p"/games/#{@game.id}") %>
47
<input type="text" class="game-url font-normal" value={game_url} size={String.length(game_url)} />
58
<span class="copy-to-clipboard" style="cursor:pointer;">📋</span>
69

Diff for: lib/mjw_web/live/game_live/opponent_seat_component.html.heex

+25-5
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,31 @@
77

88
<div class="player-icons">
99
<%= if @seat.seatno == 0 && @player_seats_finalized do %>
10-
<div class="firstdealer-indicator" title="First dealer. Game wind changes when the deal circles back to them.">
10+
<div
11+
class="firstdealer-indicator"
12+
title="First dealer. Game wind changes when the deal circles back to them."
13+
>
1114
1215
</div>
1316
<% end %>
1417

1518
<%= if @seat.seatno == @game.dealer_seatno do %>
16-
<div class="dealer-indicator" title={"Dealer#{if @game.dealer_win_count > 0, do: " (time ##{@game.dealer_win_count + 1})"}"}>
19+
<div
20+
class="dealer-indicator"
21+
title={"Dealer#{if @game.dealer_win_count > 0, do: " (time ##{@game.dealer_win_count + 1})"}"}
22+
>
1723
Dealer<%= if @game.dealer_win_count > 0 do %>
1824
<sup><%= @game.dealer_win_count + 1 %></sup>
1925
<% end %>
2026
</div>
2127
<% end %>
2228
<%= if @game_state != :rolling_for_deal && @seat.seatno == @game.dealpick_seatno do %>
23-
<img src="/images/staircase.png" alt="" title="This staircase is the end of the deck (used to determine player wind)" class={"dealpickstaircase inline-block mx-auto relative bottom-1#{if @seat.seatno == @game.dealer_seatno, do: " pl-1"}"} />
29+
<img
30+
src="/images/staircase.png"
31+
alt=""
32+
title="This staircase is the end of the deck (used to determine player wind)"
33+
class={"dealpickstaircase inline-block mx-auto relative bottom-1#{if @seat.seatno == @game.dealer_seatno, do: " pl-1"}"}
34+
/>
2435
<% end %>
2536
</div>
2637
</div>
@@ -34,7 +45,11 @@
3445
<div class="hiddengong-tiles">
3546
<%= if @seat.win_expose do %>
3647
<%= for tile <- @seat.hiddengongs do %>
37-
<img src={"/images/tiles/#{Mjw.Tile.without_id(tile)}.png"} alt="" class="tile opacity-50" />
48+
<img
49+
src={"/images/tiles/#{Mjw.Tile.without_id(tile)}.png"}
50+
alt=""
51+
class="tile opacity-50"
52+
/>
3853
<% end %>
3954
<% else %>
4055
<%= for _tile <- @seat.hiddengongs do %>
@@ -59,7 +74,12 @@
5974

6075
<%= if @seat.wintile do %>
6176
<div class="wintile-tiles">
62-
<img id={@seat.wintile} src={"/images/tiles/#{Mjw.Tile.without_id(@seat.wintile)}.png"} alt="" class="tile ml-8" />
77+
<img
78+
id={@seat.wintile}
79+
src={"/images/tiles/#{Mjw.Tile.without_id(@seat.wintile)}.png"}
80+
alt=""
81+
class="tile ml-8"
82+
/>
6383
</div>
6484
<% end %>
6585
</div>

Diff for: lib/mjw_web/live/game_live/seat_offering_component.html.heex

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@
1010
</div>
1111

1212
<div class="pt-4">
13-
<input type="text" name="player_name" class="p-2 mx-3 border border-gray-600 rounded w-72" required minlength="1" maxlength="70" autofocus autocomplete="off" data-1p-ignore="true" data-lpignore="true" />
13+
<input
14+
type="text"
15+
name="player_name"
16+
class="p-2 mx-3 border border-gray-600 rounded w-72"
17+
required
18+
minlength="1"
19+
maxlength="70"
20+
autofocus
21+
autocomplete="off"
22+
data-1p-ignore="true"
23+
data-lpignore="true"
24+
/>
1425
</div>
1526

1627
<div class="pt-8">

0 commit comments

Comments
 (0)