Skip to content

style a bit the stamps #883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions app/views/shared/_stickers_display.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
<div class="bg-black rounded-2xl">
<div class="flex w-full items-center justify-center bg-black p-12">
<div class="mx-auto w-full overflow-hidden rounded-[40px] bg-gradient-to-b from-gray-300 via-gray-600 to-gray-600 p-[4px]">
<div class="back flex overflow-hidden aspect-[16/11] w-full items-center justify-center rounded-[40px] bg-gradient-to-b from-gray-400 via-gray-500 to-gray-600">
<div class="grid grid-cols-3 gap-[5vw] w-full h-full p-12">
<% events.shuffle.each do |event| %>
<%= link_to event, class: "max-w-[10vw]", style: "transform: rotate(#{(-20...20).to_a.sample}deg) translateY(#{(0...10).to_a.sample}vw) translateX(#{(0...10).to_a.sample}vh) scale(#{100 + (-10...10).to_a.sample}%)" do %>
<%= image_tag event.sticker_image_path, class: "transition transition-transform hover:scale-105" %>
<div class="bg-gray-50 min-h-screen py-8">
<div class="max-w-2xl">
<!-- Header with stamp count -->
<div class="mb-4">
<h2 class="text-lg font-semibold text-gray-800">
<%= events.count %> STAMPS COLLECTED
</h2>
</div>

<!-- Stamps Grid -->
<div class="mx-auto w-full overflow-hidden rounded-[40px] bg-gradient-to-b from-gray-600 via-gray-600 to-gray-400 p-[12px]">
<div class="flex flex-wrap gap-4 p-4 justify-evenly back verflow-hidden aspect-[16/11] w-full items-center rounded-[32px] bg-white">
<% events.each_with_index do |event, index| %>
<div class="aspect-square flex items-center justify-center h-24 sm:h-32 md:h-40 lg:h-48">
<%= link_to event, class: "block h-full w-full" do %>
<div class="w-full h-full border-4 border-dotted border-gray-300 rounded-xl p-2 bg-white transition-transform duration-200 hover:scale-105">
<div class="w-full h-full rounded-xl bg-white flex items-center justify-center relative overflow-hidden">
<%= image_tag event.sticker_image_path, class: "w-4/5 h-4/5 object-contain", style: "transform: rotate(#{(-10..10).to_a.sample}deg)" %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
<% end %>

<!-- Fill remaining slots with empty stamps -->
<% (9 - events.count).times do %>
<div class="aspect-square flex items-center justify-center h-24 sm:h-32 md:h-40 lg:h-48">
<div class="w-full h-full border-4 border-dotted border-gray-300 rounded-xl p-2 bg-white">
<div class="w-full h-full rounded-xl flex items-center justify-center relative overflow-hidden">
</div>
</div>
</div>
<% end %>
</div>
</div>
</div>
Expand Down