badar_madeena/app/views/institutions/index.html.erb

315 lines
8.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
body {
background: linear-gradient(135deg, #e3f2fd, #e8f5e9);
font-family: "Poppins", sans-serif;
color: #2c3e50;
display: flex;
flex-direction: column;
}
.page-wrapper {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between; /* space out header and content */
min-height: 100vh;
}
.container {
padding: 0 20px;
max-width: 1900px;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center; /* center vertically */
}
.text-center.my-5 {
margin-top: 0 !important;
margin-bottom: 1.5rem !important;
}
/* Header Section */
.page-header {
text-align: center;
}
.page-header h1 {
font-weight: 700;
color: #1e88e5;
margin-bottom: 0px;
background: linear-gradient(90deg, #1e88e5, #43a047, #1e88e5);
background-size: 200% auto;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: gradient-move 3s linear infinite;
}
@keyframes gradient-move {
0% {
background-position: 0% center;
}
100% {
background-position: 200% center;
}
}
.logo-img {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 50%;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.divider {
width: 70px;
height: 4px;
background: linear-gradient(to right, #1e88e5, #43a047);
margin: 15px auto;
border-radius: 3px;
}
/* Card Styles */
.glass-card {
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(12px);
border-radius: 18px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
transition: 0.3s ease;
height: 100%;
}
.glass-card:hover {
transform: translateY(-3px);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}
.section-title {
font-weight: 700;
text-align: center;
color: #1565c0;
margin-bottom: 15px;
}
.item-card {
border-radius: 15px;
background: #ffffff;
transition: all 0.3s ease;
border: 1px solid #e0e0e0;
}
.item-card:hover {
background: #f9f9f9;
transform: scale(1.02);
}
.item-title {
font-size: 1.1rem;
font-weight: 600;
color: #0d47a1;
}
.item-desc {
color: #37474f;
font-size: 0.95rem;
}
.item-footer {
border-top: 1px solid #e3f2fd;
padding-top: 10px;
text-align: right;
}
.btn-custom {
border-radius: 25px;
font-weight: 600;
padding: 7px 18px;
transition: 0.3s ease;
}
.btn-primary-custom {
background-color: #1e88e5;
color: #fff;
}
.btn-primary-custom:hover {
background-color: #1565c0;
}
.btn-success-custom {
background-color: #43a047;
color: #fff;
}
.btn-success-custom:hover {
background-color: #2e7d32;
}
footer {
background: rgba(255, 255, 255, 0.7);
padding: 12px;
text-align: center;
font-size: 0.9rem;
color: #555;
backdrop-filter: blur(8px);
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
@media (max-width: 992px) {
.container {
padding: 20px;
}
}
/* --- Ziyara Section Styling --- */
.ziyara-card {
border-top: 5px solid #fbc02d;
background: rgba(255, 255, 240, 0.95);
}
.ziyara-title {
color: #f9a825;
background: linear-gradient(90deg, #fdd835, #fbc02d, #f57f17);
background-size: 200% auto;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: gradient-move 4s linear infinite;
}
.ziyara-item {
border-left: 4px solid #fbc02d;
transition: all 0.3s ease;
}
.ziyara-item:hover {
background: #fff8e1;
box-shadow: 0 8px 20px rgba(251, 192, 45, 0.25);
transform: translateY(-4px);
}
</style>
<div class="page-wrapper">
<div class="container text-center">
<!-- Logo & Header -->
<div class="page-header mb-4 d-flex align-items-center justify-content-center flex-wrap">
<%= image_tag("unnamed.jpg", alt: "Logo", class: "logo-img me-3") %>
<h1>BADAR MADEENA CULTURAL CENTER
AND CHARITY TRUST</h1>
</div>
<div class="divider"></div>
<!-- Two Sections Side by Side -->
<div class="row g-4 justify-content-center align-items-stretch">
<!-- Institutions Section -->
<div class="col-lg-6 d-flex">
<div class="glass-card p-4 w-100">
<h3 class="section-title text-primary">🏫 Institutions</h3>
<% if @institutions.present? %>
<div class="row g-3">
<% @institutions.each do |institution| %>
<div class="col-12">
<div class="item-card p-3 shadow-sm">
<div class="item-title"><%= institution.name %></div>
<% if institution.respond_to?(:description) %>
<p class="item-desc mb-2"><%= institution.description.truncate(100) %></p>
<% end %>
<div class="item-footer">
<%= link_to "View", institution, class: "btn btn-primary-custom btn-sm btn-custom" %>
</div>
</div>
</div>
<% end %>
</div>
<% else %>
<p class="item-desc text-center">No institutions added yet.</p>
<% end %>
<div class="text-center mt-3">
<%= link_to " New Institution", new_institution_path, class: "btn btn-success-custom btn-custom" %>
</div>
</div>
</div>
<!-- Programs Section -->
<div class="col-lg-6 d-flex">
<div class="glass-card p-4 w-100">
<h3 class="section-title text-success">🎓 Programs</h3>
<% if @programs.present? %>
<div class="row g-3">
<% @programs.each do |program| %>
<div class="col-12">
<div class="item-card p-3 shadow-sm">
<div class="item-title"><%= program.name %></div>
<p class="item-desc mb-2">
<% if program.respond_to?(:date) %>
<strong>Date:</strong> <%= program.date %><br>
<% end %>
<% if program.respond_to?(:leadingPerson) %>
<strong>Lead:</strong> <%= program.leadingPerson %>
<% end %>
</p>
<div class="item-footer">
<%= link_to "View", program, class: "btn btn-success-custom btn-sm btn-custom" %>
</div>
</div>
</div>
<% end %>
</div>
<% else %>
<p class="item-desc text-center">No programs available yet.</p>
<% end %>
<div class="text-center mt-3">
<%= link_to " New Program", new_program_path, class: "btn btn-success-custom btn-custom" %>
</div>
</div>
</div>
</div>
<!-- Ziyara Section -->
<div class="row mt-4 justify-content-center">
<div class="col-lg-10 d-flex">
<div class="glass-card ziyara-card p-4 w-100">
<h3 class="section-title ziyara-title">🕌 Ziyara</h3>
<% if @ziyaras.present? %>
<div class="row g-3">
<% @ziyaras.each do |ziyara| %>
<div class="col-md-6 col-lg-4">
<div class="item-card ziyara-item p-3 shadow-sm">
<div class="item-title"><%= ziyara.name %></div>
<% if ziyara.respond_to?(:location) %>
<p class="item-desc mb-1"><strong>📍 Location:</strong> <%= ziyara.location %></p>
<% end %>
<% if ziyara.respond_to?(:date) %>
<p class="item-desc mb-1"><strong>📅 Date:</strong> <%= ziyara.date %></p>
<% end %>
<div class="item-footer">
<%= link_to "View", ziyara, class: "btn btn-primary-custom btn-sm btn-custom" %>
</div>
</div>
</div>
<% end %>
</div>
<% else %>
<p class="item-desc text-center">No Ziyara records yet.</p>
<% end %>
<div class="text-center mt-3">
<%= link_to " New Ziyara", new_ziyara_path, class: "btn btn-success-custom btn-custom" %>
</div>
</div>
</div>
</div>
</div>