sprites relative positioning

This commit is contained in:
2023-04-19 13:47:14 +02:00
parent 06cbfc78fc
commit a14c56092c
5 changed files with 12 additions and 16 deletions

View File

@ -3,7 +3,7 @@ defmodule ChickenEggWeb.ChickenComponents do
def chicken(assigns) do
~H"""
<div class="w-32 h-32 absolute" style={"top: #{@y}px; left: #{@x}px;"}>
<div class="z-0 max-w-[144px] h-auto absolute" style={"width: 12%; top: #{@y}%; left: #{@x}%;"}>
<img src={~p"/images/chicken.svg"} />
</div>
"""
@ -11,7 +11,7 @@ defmodule ChickenEggWeb.ChickenComponents do
def egg(assigns) do
~H"""
<div class="w-12 h-12 absolute" style={"top: #{@y}px; left: #{@x}px;"}>
<div class="z-10 max-w-[48px] h-auto absolute" style={"width: 4%; top: #{@y}%; left: #{@x}%;"}>
<img src={~p"/images/egg.svg"} />
</div>
"""