Spaces:
Runtime error
Runtime error
File size: 12,439 Bytes
eb224f7 80aca33 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Agricultural Schemes</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<!-- Bootstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<style>
:root {
/* Brand Colors from Style Guide */
--primary: #1a5d3a;
--secondary: #198754;
--accent: #0d6efd;
--bg-light: #f8f9fa;
--border-color: #dee2e6;
--text-dark: #212529;
--text-muted: #6c757d;
}
body {
background-color: var(--bg-light);
font-family: 'Outfit', sans-serif;
color: var(--text-dark);
margin: 0;
padding: 0;
min-height: 100vh;
}
/* --- Navbar --- */
.navbar {
background-color: var(--primary) !important;
padding: 1rem 0;
margin-bottom: 0 !important;
box-shadow: 0 4px 12px rgba(26, 93, 58, 0.15);
}
.navbar-brand {
font-weight: 700;
letter-spacing: 0.5px;
font-size: 1.5rem;
}
.container {
padding: 0 15px;
}
/* --- Hero Section (Curved) --- */
.header-section {
background-color: var(--primary);
color: white;
padding: 4rem 1rem 10rem;
/* Deep padding for clean overlap */
text-align: center;
border-bottom-left-radius: 50% 20px;
border-bottom-right-radius: 50% 20px;
margin-bottom: -6rem;
/* Negative margin for content overlap */
position: relative;
z-index: 0;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.header-section h1 {
font-weight: 800;
letter-spacing: -1px;
margin-bottom: 1rem;
}
.main-container {
max-width: 1100px;
margin: 0 auto;
padding: 0 1.5rem;
position: relative;
z-index: 10;
}
/* --- Premium Card (The New Standard) --- */
.premium-card {
background: white;
border-radius: 20px;
/* Outer Solid Border */
border: 1px solid rgba(26, 93, 58, 0.1);
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
/* Updated shadow to match Guide */
transition: all 0.3s ease;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}
.premium-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 50px rgba(26, 93, 58, 0.12);
}
.premium-card .card-body {
position: relative;
z-index: 2;
/* Content above border */
padding: 2rem;
flex: 1 1 auto;
}
/* --- Typography & Layout --- */
.page-title {
color: var(--primary);
font-weight: 800;
margin-bottom: 2rem;
letter-spacing: -0.5px;
}
.section-title {
color: var(--primary);
font-size: 1.25rem;
margin-bottom: 1rem;
font-weight: 700;
border-bottom: 2px solid #e9ecef;
padding-bottom: 0.5rem;
display: inline-block;
}
.btn-primary {
background-color: var(--primary);
border-color: var(--primary);
border-radius: 50px;
padding: 0.6rem 1.5rem;
font-weight: 600;
}
.btn-primary:hover {
background-color: var(--secondary);
border-color: var(--secondary);
}
.form-select,
.form-control {
border-radius: 12px;
padding: 0.8rem 1rem;
border: 1px solid #dee2e6;
}
.form-select:focus,
.form-control:focus {
border-color: var(--secondary);
box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
}
a {
color: var(--primary);
text-decoration: none;
}
a:hover {
color: var(--secondary);
}
/* List Styling in Cards */
.list-group-item {
border: none;
border-bottom: 1px dashed #e9ecef;
padding: 0.75rem 0;
background: transparent;
}
.list-group-item:last-child {
border-bottom: none;
}
/* Breadcrumb */
.breadcrumb {
background: transparent;
padding: 0;
margin-bottom: 2rem;
}
.breadcrumb-item a {
color: var(--text-muted);
font-weight: 500;
}
.breadcrumb-item.active {
color: var(--primary);
font-weight: 600;
}
/* --- Hero Button Emphasis --- */
.btn-hero-emphasized {
background-color: #ffffff;
color: var(--primary);
font-weight: 800;
border: 4px solid rgba(255, 255, 255, 0.3);
/* Semi-transparent ring */
background-clip: padding-box;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.btn-hero-emphasized:hover {
transform: translateY(-3px) scale(1.02);
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
background-color: #f8f9fa;
color: var(--secondary);
border-color: rgba(255, 255, 255, 0.5);
}
/* Responsive */
@media (max-width: 992px) {
.premium-card .card-body {
padding: 1.5rem;
}
}
</style>
</head>
<body>
{% block content %}{% endblock %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Function to update URL parameters based on filter values
function updateUrlParams() {
const searchTerm = document.getElementById('searchInput')?.value || '';
const schemeType = document.getElementById('schemeTypeFilter')?.value || '';
const beneficiary = document.getElementById('beneficiaryFilter')?.value || '';
const benefit = document.getElementById('benefitFilter')?.value || '';
// Save to localStorage
localStorage.setItem('agri_search', searchTerm);
localStorage.setItem('agri_schemeType', schemeType);
localStorage.setItem('agri_beneficiary', beneficiary);
localStorage.setItem('agri_benefit', benefit);
// Update URL parameters
const url = new URL(window.location);
if (searchTerm) url.searchParams.set('search', searchTerm);
else url.searchParams.delete('search');
if (schemeType) url.searchParams.set('type', schemeType);
else url.searchParams.delete('type');
if (beneficiary) url.searchParams.set('beneficiary', beneficiary);
else url.searchParams.delete('beneficiary');
if (benefit) url.searchParams.set('benefit', benefit);
else url.searchParams.delete('benefit');
// Update URL without reloading the page
window.history.pushState({}, '', url);
}
// Add to the script section in base.html
function filterSchemes() {
const searchTerm = document.getElementById('searchInput').value.toLowerCase();
const schemeType = document.getElementById('schemeTypeFilter')?.value || '';
const beneficiary = document.getElementById('beneficiaryFilter')?.value || '';
const benefit = document.getElementById('benefitFilter')?.value || '';
const schemeCards = document.querySelectorAll('.scheme-card');
let visibleCount = 0;
schemeCards.forEach(card => {
const title = card.querySelector('.card-title').textContent.toLowerCase();
const description = card.querySelector('.card-text').textContent.toLowerCase();
const content = card.getAttribute('data-keywords').toLowerCase();
const matchesSearch = title.includes(searchTerm) || description.includes(searchTerm);
const matchesType = !schemeType || content.includes(schemeType.toLowerCase());
const matchesBeneficiary = !beneficiary || content.includes(beneficiary.toLowerCase());
const matchesBenefit = !benefit || content.includes(benefit.toLowerCase());
const cardParent = card.closest('.col-sm-12');
if (matchesSearch && matchesType && matchesBeneficiary && matchesBenefit) {
cardParent.style.display = '';
visibleCount++;
} else {
cardParent.style.display = 'none';
}
});
// Show a message when no results are found
const container = document.querySelector('.scheme-container');
let noResultsMsg = document.querySelector('.no-results-message');
if (visibleCount === 0 && container) {
if (!noResultsMsg) {
noResultsMsg = document.createElement('div');
noResultsMsg.className = 'col-12 text-center py-4 no-results-message';
noResultsMsg.innerHTML = '<p class="text-muted">No schemes found matching your criteria.</p>';
container.appendChild(noResultsMsg);
}
} else if (noResultsMsg) {
noResultsMsg.remove();
}
// Update URL and localStorage
updateUrlParams();
}
// Function to restore filters from URL or localStorage
function restoreFilters() {
const params = new URLSearchParams(window.location.search);
// Get values from URL params or localStorage
const searchValue = params.get('search') || localStorage.getItem('agri_search') || '';
const typeValue = params.get('type') || localStorage.getItem('agri_schemeType') || '';
const beneficiaryValue = params.get('beneficiary') || localStorage.getItem('agri_beneficiary') || '';
const benefitValue = params.get('benefit') || localStorage.getItem('agri_benefit') || '';
// Set form values
const searchInput = document.getElementById('searchInput');
const schemeTypeFilter = document.getElementById('schemeTypeFilter');
const beneficiaryFilter = document.getElementById('beneficiaryFilter');
const benefitFilter = document.getElementById('benefitFilter');
if (searchInput) searchInput.value = searchValue;
if (schemeTypeFilter) schemeTypeFilter.value = typeValue;
if (beneficiaryFilter) beneficiaryFilter.value = beneficiaryValue;
if (benefitFilter) benefitFilter.value = benefitValue;
// Apply filters if any were set
if (searchValue || typeValue || beneficiaryValue || benefitValue) {
filterSchemes();
}
}
// Add event listeners when DOM is loaded
document.addEventListener('DOMContentLoaded', function () {
// Restore filters
restoreFilters();
// Add event listeners
document.getElementById('searchInput')?.addEventListener('input', filterSchemes);
document.getElementById('schemeTypeFilter')?.addEventListener('change', filterSchemes);
document.getElementById('beneficiaryFilter')?.addEventListener('change', filterSchemes);
document.getElementById('benefitFilter')?.addEventListener('change', filterSchemes);
});
</script>
{% block extra_scripts %}{% endblock %}
</body>
</html> |