2025-01-20 18:02:28 +08:00
|
|
|
<div class="container mx-auto px-4 py-16">
|
|
|
|
<div class="text-center mb-16 space-y-4">
|
|
|
|
<h1 class="text-4xl md:text-5xl font-display font-bold">Explore Cities</h1>
|
|
|
|
<p class="text-xl text-base-content/70 max-w-2xl mx-auto">
|
|
|
|
Discover AI-generated weather art from cities around the world
|
|
|
|
</p>
|
|
|
|
</div>
|
2025-01-19 22:08:05 +08:00
|
|
|
|
2025-01-20 18:02:28 +08:00
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
2025-01-19 22:08:05 +08:00
|
|
|
<% @cities.each do |city| %>
|
2025-01-20 18:02:28 +08:00
|
|
|
<% latest_art = city.weather_arts.last %>
|
|
|
|
<div class="card bg-base-100 shadow-xl hover:shadow-2xl transition-all duration-300 group">
|
|
|
|
<% if latest_art&.image&.attached? %>
|
|
|
|
<figure class="relative aspect-[16/9] overflow-hidden">
|
|
|
|
<%= image_tag latest_art.image,
|
|
|
|
class: "w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-500" %>
|
|
|
|
<div class="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"></div>
|
|
|
|
</figure>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="card-body relative">
|
2025-01-21 21:29:26 +08:00
|
|
|
<h2 class="card-title font-display text-2xl"><%= city.localized_name %></h2>
|
2025-01-20 18:02:28 +08:00
|
|
|
<div class="text-base-content/70">
|
|
|
|
<p>Lat: <%= city.latitude %></p>
|
|
|
|
<p>Long: <%= city.longitude %></p>
|
|
|
|
</div>
|
|
|
|
<div class="card-actions justify-end mt-4">
|
|
|
|
<%= link_to "View Weather Art", city_path(city),
|
|
|
|
class: "btn btn-primary" %>
|
2025-01-19 22:08:05 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|