Last active
January 2, 2020 21:29
-
-
Save neslinesli93/5ccc17606454b90f3b6abea27615c9de to your computer and use it in GitHub Desktop.
Main template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="game-container"> | |
<%= for block <- @blocks, block.type in [:wall, :floor] do %> | |
<div class="block <%= block.type %>" | |
style="transform: translate3d(<%= block.left %>px, <%= block.top %>px, 0px); | |
width: <%= block.width %>px; | |
height: <%= block.height %>px; "></div> | |
<% end %> | |
<%= for brick <- @blocks, brick.type == :brick and brick.visible == true do %> | |
<div class="block brick" | |
style="transform: translate3d(<%= brick.left %>px, <%= brick.top %>px, 0px); | |
width: <%= brick.width %>px; | |
height: <%= brick.height %>px; | |
background: <%= Map.fetch!(brick, :color) %>; "></div> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment