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>
"""

View File

@ -1,7 +1,5 @@
<header class="px-4 sm:px-6 lg:px-8 p-0"></header>
<main class="">
<div class="">
<.flash_group flash={@flash} />
<%= @inner_content %>
</div>
<main>
<.flash_group flash={@flash} />
<%= @inner_content %>
</main>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" style="scrollbar-gutter: stable;">
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />