Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,7 +104,7 @@ def catalog():
|
|
| 104 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 105 |
<title>Каталог</title>
|
| 106 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
| 107 |
-
<link href="https://fonts.googleapis.com/css2?family=
|
| 108 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/10.2.0/swiper-bundle.min.css">
|
| 109 |
<style>
|
| 110 |
* {
|
|
@@ -113,23 +113,35 @@ def catalog():
|
|
| 113 |
box-sizing: border-box;
|
| 114 |
}
|
| 115 |
body {
|
| 116 |
-
font-family: '
|
| 117 |
-
background: linear-gradient(135deg, #
|
| 118 |
color: #ffffff;
|
| 119 |
line-height: 1.6;
|
| 120 |
-
transition: background 0.3s, color 0.3s;
|
| 121 |
}
|
| 122 |
.container {
|
| 123 |
max-width: 1300px;
|
| 124 |
margin: 0 auto;
|
| 125 |
padding: 20px;
|
| 126 |
}
|
| 127 |
-
.header
|
| 128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
font-weight: 600;
|
| 130 |
-
margin-bottom: 20px;
|
| 131 |
}
|
| 132 |
-
.filters-container
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
margin: 20px 0;
|
| 134 |
text-align: center;
|
| 135 |
}
|
|
@@ -138,12 +150,12 @@ def catalog():
|
|
| 138 |
max-width: 600px;
|
| 139 |
padding: 12px 18px;
|
| 140 |
font-size: 1rem;
|
| 141 |
-
border: 1px solid
|
| 142 |
-
border-radius:
|
| 143 |
background-color: rgba(255, 255, 255, 0.1);
|
| 144 |
-
color: #
|
| 145 |
outline: none;
|
| 146 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.
|
| 147 |
transition: all 0.3s ease;
|
| 148 |
}
|
| 149 |
#search-input:focus {
|
|
@@ -152,8 +164,8 @@ def catalog():
|
|
| 152 |
}
|
| 153 |
.category-filter {
|
| 154 |
padding: 8px 16px;
|
| 155 |
-
border: 1px solid
|
| 156 |
-
border-radius:
|
| 157 |
background-color: rgba(255, 255, 255, 0.1);
|
| 158 |
color: #ffffff;
|
| 159 |
cursor: pointer;
|
|
@@ -162,9 +174,10 @@ def catalog():
|
|
| 162 |
font-weight: 400;
|
| 163 |
}
|
| 164 |
.category-filter.active, .category-filter:hover {
|
| 165 |
-
background
|
| 166 |
-
|
| 167 |
-
|
|
|
|
| 168 |
}
|
| 169 |
.products-grid {
|
| 170 |
display: grid;
|
|
@@ -176,8 +189,13 @@ def catalog():
|
|
| 176 |
background: rgba(255, 255, 255, 0.1);
|
| 177 |
border-radius: 15px;
|
| 178 |
padding: 15px;
|
| 179 |
-
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.
|
| 180 |
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
}
|
| 182 |
.product-image {
|
| 183 |
width: 100%;
|
|
@@ -198,17 +216,40 @@ def catalog():
|
|
| 198 |
.product-image img:hover {
|
| 199 |
transform: scale(1.1);
|
| 200 |
}
|
| 201 |
-
.product h2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
color: #ffffff;
|
| 203 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
.product-button {
|
| 205 |
display: block;
|
| 206 |
width: 100%;
|
| 207 |
padding: 10px;
|
| 208 |
border: none;
|
| 209 |
-
border-radius:
|
| 210 |
-
background
|
| 211 |
-
color:
|
| 212 |
font-size: 0.9rem;
|
| 213 |
font-weight: 500;
|
| 214 |
cursor: pointer;
|
|
@@ -218,23 +259,23 @@ def catalog():
|
|
| 218 |
text-decoration: none;
|
| 219 |
}
|
| 220 |
.product-button:hover {
|
| 221 |
-
background
|
| 222 |
-
box-shadow: 0 4px 15px rgba(
|
| 223 |
transform: translateY(-2px);
|
| 224 |
}
|
| 225 |
.add-to-cart {
|
| 226 |
-
background
|
| 227 |
}
|
| 228 |
.add-to-cart:hover {
|
| 229 |
-
background
|
| 230 |
-
box-shadow: 0 4px 15px rgba(
|
| 231 |
}
|
| 232 |
#cart-button {
|
| 233 |
position: fixed;
|
| 234 |
bottom: 20px;
|
| 235 |
right: 20px;
|
| 236 |
-
background
|
| 237 |
-
color:
|
| 238 |
border: none;
|
| 239 |
border-radius: 50%;
|
| 240 |
width: 60px;
|
|
@@ -242,12 +283,12 @@ def catalog():
|
|
| 242 |
font-size: 1.5rem;
|
| 243 |
cursor: pointer;
|
| 244 |
display: none;
|
| 245 |
-
box-shadow: 0 4px 15px rgba(76,
|
| 246 |
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 247 |
z-index: 1000;
|
| 248 |
}
|
| 249 |
#cart-button:hover {
|
| 250 |
-
background
|
| 251 |
transform: scale(1.1);
|
| 252 |
}
|
| 253 |
.modal {
|
|
@@ -268,34 +309,54 @@ def catalog():
|
|
| 268 |
border-radius: 15px;
|
| 269 |
width: 90%;
|
| 270 |
max-width: 700px;
|
| 271 |
-
box-shadow: 0 10px 30px rgba(0,0,0,0.
|
| 272 |
}
|
| 273 |
.close {
|
| 274 |
-
|
|
|
|
|
|
|
| 275 |
cursor: pointer;
|
| 276 |
transition: color 0.3s;
|
| 277 |
}
|
| 278 |
.close:hover {
|
| 279 |
-
color: #
|
| 280 |
}
|
| 281 |
.cart-item {
|
| 282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
}
|
| 284 |
.quantity-input {
|
| 285 |
width: 70px;
|
| 286 |
padding: 8px;
|
| 287 |
-
border: 1px solid
|
| 288 |
border-radius: 8px;
|
| 289 |
background-color: rgba(255, 255, 255, 0.1);
|
| 290 |
-
color: #
|
| 291 |
font-size: 1rem;
|
| 292 |
}
|
| 293 |
-
.clear-cart
|
| 294 |
-
background
|
| 295 |
}
|
| 296 |
-
.clear-cart:hover
|
| 297 |
-
background
|
| 298 |
-
box-shadow: 0 4px 15px rgba(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
}
|
| 300 |
@media (max-width: 768px) {
|
| 301 |
.products-grid {
|
|
@@ -327,9 +388,6 @@ def catalog():
|
|
| 327 |
<div class="container">
|
| 328 |
<div class="header">
|
| 329 |
<h1>Каталог</h1>
|
| 330 |
-
<button class="theme-toggle" onclick="toggleTheme()">
|
| 331 |
-
<i class="fas fa-moon"></i>
|
| 332 |
-
</button>
|
| 333 |
</div>
|
| 334 |
<div class="filters-container">
|
| 335 |
<button class="category-filter active" data-category="all">Все категории</button>
|
|
@@ -404,19 +462,6 @@ def catalog():
|
|
| 404 |
const products = {{ products|tojson }};
|
| 405 |
let selectedProductIndex = null;
|
| 406 |
|
| 407 |
-
function toggleTheme() {
|
| 408 |
-
document.body.classList.toggle('dark-mode');
|
| 409 |
-
const icon = document.querySelector('.theme-toggle i');
|
| 410 |
-
icon.classList.toggle('fa-moon');
|
| 411 |
-
icon.classList.toggle('fa-sun');
|
| 412 |
-
localStorage.setItem('theme', document.body.classList.contains('dark-mode') ? 'dark' : 'light');
|
| 413 |
-
}
|
| 414 |
-
|
| 415 |
-
if (localStorage.getItem('theme') === 'dark') {
|
| 416 |
-
document.body.classList.add('dark-mode');
|
| 417 |
-
document.querySelector('.theme-toggle i').classList.replace('fa-moon', 'fa-sun');
|
| 418 |
-
}
|
| 419 |
-
|
| 420 |
function openModal(index) {
|
| 421 |
loadProductDetails(index);
|
| 422 |
document.getElementById('productModal').style.display = "block";
|
|
@@ -601,9 +646,9 @@ def product_detail(index):
|
|
| 601 |
<div class="swiper-button-next"></div>
|
| 602 |
<div class="swiper-button-prev"></div>
|
| 603 |
</div>
|
| 604 |
-
<p style="color:
|
| 605 |
-
<p style="color:
|
| 606 |
-
<p style="color:
|
| 607 |
</div>
|
| 608 |
'''
|
| 609 |
return render_template_string(detail_html, product=product, repo_id=REPO_ID)
|
|
@@ -729,16 +774,11 @@ def admin():
|
|
| 729 |
<meta charset="UTF-8">
|
| 730 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 731 |
<title>Админ-панель</title>
|
| 732 |
-
<link href="https://fonts.googleapis.com/css2?family=
|
| 733 |
<style>
|
| 734 |
-
* {
|
| 735 |
-
margin: 0;
|
| 736 |
-
padding: 0;
|
| 737 |
-
box-sizing: border-box;
|
| 738 |
-
}
|
| 739 |
body {
|
| 740 |
-
font-family: '
|
| 741 |
-
background: linear-gradient(135deg, #
|
| 742 |
color: #ffffff;
|
| 743 |
padding: 20px;
|
| 744 |
}
|
|
@@ -746,8 +786,7 @@ def admin():
|
|
| 746 |
max-width: 1200px;
|
| 747 |
margin: 0 auto;
|
| 748 |
}
|
| 749 |
-
|
| 750 |
-
color: #ffffff;
|
| 751 |
font-weight: 600;
|
| 752 |
margin-bottom: 20px;
|
| 753 |
}
|
|
@@ -755,7 +794,7 @@ def admin():
|
|
| 755 |
background: rgba(255, 255, 255, 0.1);
|
| 756 |
padding: 20px;
|
| 757 |
border-radius: 15px;
|
| 758 |
-
box-shadow: 0 4px 15px rgba(0,0,0,0.
|
| 759 |
margin-bottom: 30px;
|
| 760 |
}
|
| 761 |
label {
|
|
@@ -768,8 +807,8 @@ def admin():
|
|
| 768 |
width: 100%;
|
| 769 |
padding: 12px;
|
| 770 |
margin-top: 5px;
|
| 771 |
-
border: 1px solid
|
| 772 |
-
border-radius:
|
| 773 |
background-color: rgba(255, 255, 255, 0.1);
|
| 774 |
color: #ffffff;
|
| 775 |
font-size: 1rem;
|
|
@@ -783,25 +822,25 @@ def admin():
|
|
| 783 |
button {
|
| 784 |
padding: 12px 20px;
|
| 785 |
border: none;
|
| 786 |
-
border-radius:
|
| 787 |
-
background
|
| 788 |
-
color:
|
| 789 |
font-weight: 500;
|
| 790 |
cursor: pointer;
|
| 791 |
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 792 |
margin-top: 15px;
|
| 793 |
}
|
| 794 |
button:hover {
|
| 795 |
-
background
|
| 796 |
-
box-shadow: 0 4px 15px rgba(
|
| 797 |
transform: translateY(-2px);
|
| 798 |
}
|
| 799 |
.delete-button {
|
| 800 |
-
background
|
| 801 |
}
|
| 802 |
.delete-button:hover {
|
| 803 |
-
background
|
| 804 |
-
box-shadow: 0 4px 15px rgba(
|
| 805 |
}
|
| 806 |
.product-list, .category-list {
|
| 807 |
display: grid;
|
|
@@ -811,7 +850,7 @@ def admin():
|
|
| 811 |
background: rgba(255, 255, 255, 0.1);
|
| 812 |
padding: 20px;
|
| 813 |
border-radius: 15px;
|
| 814 |
-
box-shadow: 0 4px 15px rgba(0,0,0,0.
|
| 815 |
}
|
| 816 |
.edit-form {
|
| 817 |
margin-top: 15px;
|
|
@@ -856,7 +895,7 @@ def admin():
|
|
| 856 |
<div class="category-list">
|
| 857 |
{% for category in categories %}
|
| 858 |
<div class="category-item">
|
| 859 |
-
<h3
|
| 860 |
<form method="POST" style="display: inline;">
|
| 861 |
<input type="hidden" name="action" value="delete_category">
|
| 862 |
<input type="hidden" name="category_index" value="{{ loop.index0 }}">
|
|
@@ -878,10 +917,10 @@ def admin():
|
|
| 878 |
<div class="product-list">
|
| 879 |
{% for product in products %}
|
| 880 |
<div class="product-item">
|
| 881 |
-
<h3
|
| 882 |
-
<p style="color:
|
| 883 |
-
<p style="color:
|
| 884 |
-
<p style="color:
|
| 885 |
{% if product.get('photos') and product['photos']|length > 0 %}
|
| 886 |
<img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/{{ product['photos'][0] }}"
|
| 887 |
alt="{{ product['name'] }}"
|
|
|
|
| 104 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 105 |
<title>Каталог</title>
|
| 106 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
| 107 |
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;600&display=swap" rel="stylesheet">
|
| 108 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/10.2.0/swiper-bundle.min.css">
|
| 109 |
<style>
|
| 110 |
* {
|
|
|
|
| 113 |
box-sizing: border-box;
|
| 114 |
}
|
| 115 |
body {
|
| 116 |
+
font-family: 'Roboto', sans-serif;
|
| 117 |
+
background: linear-gradient(135deg, #1a4d3e, #2e7d68);
|
| 118 |
color: #ffffff;
|
| 119 |
line-height: 1.6;
|
|
|
|
| 120 |
}
|
| 121 |
.container {
|
| 122 |
max-width: 1300px;
|
| 123 |
margin: 0 auto;
|
| 124 |
padding: 20px;
|
| 125 |
}
|
| 126 |
+
.header {
|
| 127 |
+
display: flex;
|
| 128 |
+
justify-content: space-between;
|
| 129 |
+
align-items: center;
|
| 130 |
+
padding: 15px 0;
|
| 131 |
+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
| 132 |
+
}
|
| 133 |
+
.header h1 {
|
| 134 |
+
font-size: 1.5rem;
|
| 135 |
font-weight: 600;
|
|
|
|
| 136 |
}
|
| 137 |
+
.filters-container {
|
| 138 |
+
margin: 20px 0;
|
| 139 |
+
display: flex;
|
| 140 |
+
flex-wrap: wrap;
|
| 141 |
+
gap: 10px;
|
| 142 |
+
justify-content: center;
|
| 143 |
+
}
|
| 144 |
+
.search-container {
|
| 145 |
margin: 20px 0;
|
| 146 |
text-align: center;
|
| 147 |
}
|
|
|
|
| 150 |
max-width: 600px;
|
| 151 |
padding: 12px 18px;
|
| 152 |
font-size: 1rem;
|
| 153 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 154 |
+
border-radius: 8px;
|
| 155 |
background-color: rgba(255, 255, 255, 0.1);
|
| 156 |
+
color: #fff;
|
| 157 |
outline: none;
|
| 158 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
| 159 |
transition: all 0.3s ease;
|
| 160 |
}
|
| 161 |
#search-input:focus {
|
|
|
|
| 164 |
}
|
| 165 |
.category-filter {
|
| 166 |
padding: 8px 16px;
|
| 167 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 168 |
+
border-radius: 8px;
|
| 169 |
background-color: rgba(255, 255, 255, 0.1);
|
| 170 |
color: #ffffff;
|
| 171 |
cursor: pointer;
|
|
|
|
| 174 |
font-weight: 400;
|
| 175 |
}
|
| 176 |
.category-filter.active, .category-filter:hover {
|
| 177 |
+
background: linear-gradient(135deg, #4caf50, #2e7d68);
|
| 178 |
+
color: white;
|
| 179 |
+
border-color: #4caf50;
|
| 180 |
+
box-shadow: 0 2px 10px rgba(76, 175, 80, 0.5);
|
| 181 |
}
|
| 182 |
.products-grid {
|
| 183 |
display: grid;
|
|
|
|
| 189 |
background: rgba(255, 255, 255, 0.1);
|
| 190 |
border-radius: 15px;
|
| 191 |
padding: 15px;
|
| 192 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
| 193 |
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
|
| 194 |
+
overflow: hidden;
|
| 195 |
+
}
|
| 196 |
+
.product:hover {
|
| 197 |
+
transform: translateY(-5px) scale(1.02);
|
| 198 |
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
|
| 199 |
}
|
| 200 |
.product-image {
|
| 201 |
width: 100%;
|
|
|
|
| 216 |
.product-image img:hover {
|
| 217 |
transform: scale(1.1);
|
| 218 |
}
|
| 219 |
+
.product h2 {
|
| 220 |
+
font-size: 1.2rem;
|
| 221 |
+
font-weight: 600;
|
| 222 |
+
margin: 10px 0;
|
| 223 |
+
text-align: center;
|
| 224 |
+
white-space: nowrap;
|
| 225 |
+
overflow: hidden;
|
| 226 |
+
text-overflow: ellipsis;
|
| 227 |
color: #ffffff;
|
| 228 |
}
|
| 229 |
+
.product-price {
|
| 230 |
+
font-size: 1.3rem;
|
| 231 |
+
color: #ffffff;
|
| 232 |
+
font-weight: 700;
|
| 233 |
+
text-align: center;
|
| 234 |
+
margin: 5px 0;
|
| 235 |
+
}
|
| 236 |
+
.product-description {
|
| 237 |
+
font-size: 0.9rem;
|
| 238 |
+
color: rgba(255, 255, 255, 0.8);
|
| 239 |
+
text-align: center;
|
| 240 |
+
margin-bottom: 15px;
|
| 241 |
+
overflow: hidden;
|
| 242 |
+
text-overflow: ellipsis;
|
| 243 |
+
white-space: nowrap;
|
| 244 |
+
}
|
| 245 |
.product-button {
|
| 246 |
display: block;
|
| 247 |
width: 100%;
|
| 248 |
padding: 10px;
|
| 249 |
border: none;
|
| 250 |
+
border-radius: 8px;
|
| 251 |
+
background: linear-gradient(135deg, #4caf50, #2e7d68);
|
| 252 |
+
color: white;
|
| 253 |
font-size: 0.9rem;
|
| 254 |
font-weight: 500;
|
| 255 |
cursor: pointer;
|
|
|
|
| 259 |
text-decoration: none;
|
| 260 |
}
|
| 261 |
.product-button:hover {
|
| 262 |
+
background: linear-gradient(135deg, #66bb6a, #2e7d68);
|
| 263 |
+
box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
|
| 264 |
transform: translateY(-2px);
|
| 265 |
}
|
| 266 |
.add-to-cart {
|
| 267 |
+
background: linear-gradient(135deg, #4caf50, #2e7d68);
|
| 268 |
}
|
| 269 |
.add-to-cart:hover {
|
| 270 |
+
background: linear-gradient(135deg, #66bb6a, #2e7d68);
|
| 271 |
+
box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
|
| 272 |
}
|
| 273 |
#cart-button {
|
| 274 |
position: fixed;
|
| 275 |
bottom: 20px;
|
| 276 |
right: 20px;
|
| 277 |
+
background: linear-gradient(135deg, #4caf50, #2e7d68);
|
| 278 |
+
color: white;
|
| 279 |
border: none;
|
| 280 |
border-radius: 50%;
|
| 281 |
width: 60px;
|
|
|
|
| 283 |
font-size: 1.5rem;
|
| 284 |
cursor: pointer;
|
| 285 |
display: none;
|
| 286 |
+
box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
|
| 287 |
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 288 |
z-index: 1000;
|
| 289 |
}
|
| 290 |
#cart-button:hover {
|
| 291 |
+
background: linear-gradient(135deg, #66bb6a, #2e7d68);
|
| 292 |
transform: scale(1.1);
|
| 293 |
}
|
| 294 |
.modal {
|
|
|
|
| 309 |
border-radius: 15px;
|
| 310 |
width: 90%;
|
| 311 |
max-width: 700px;
|
| 312 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
| 313 |
}
|
| 314 |
.close {
|
| 315 |
+
float: right;
|
| 316 |
+
font-size: 1.5rem;
|
| 317 |
+
color: rgba(255, 255, 255, 0.7);
|
| 318 |
cursor: pointer;
|
| 319 |
transition: color 0.3s;
|
| 320 |
}
|
| 321 |
.close:hover {
|
| 322 |
+
color: #ffffff;
|
| 323 |
}
|
| 324 |
.cart-item {
|
| 325 |
+
display: flex;
|
| 326 |
+
justify-content: space-between;
|
| 327 |
+
align-items: center;
|
| 328 |
+
padding: 15px 0;
|
| 329 |
+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
| 330 |
+
}
|
| 331 |
+
.cart-item img {
|
| 332 |
+
width: 50px;
|
| 333 |
+
height: 50px;
|
| 334 |
+
object-fit: contain;
|
| 335 |
+
border-radius: 8px;
|
| 336 |
+
margin-right: 15px;
|
| 337 |
}
|
| 338 |
.quantity-input {
|
| 339 |
width: 70px;
|
| 340 |
padding: 8px;
|
| 341 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 342 |
border-radius: 8px;
|
| 343 |
background-color: rgba(255, 255, 255, 0.1);
|
| 344 |
+
color: #fff;
|
| 345 |
font-size: 1rem;
|
| 346 |
}
|
| 347 |
+
.clear-cart {
|
| 348 |
+
background: linear-gradient(135deg, #ef5350, #d32f2f);
|
| 349 |
}
|
| 350 |
+
.clear-cart:hover {
|
| 351 |
+
background: linear-gradient(135deg, #f44336, #b71c1c);
|
| 352 |
+
box-shadow: 0 4px 15px rgba(244, 67, 54, 0.5);
|
| 353 |
+
}
|
| 354 |
+
.order-button {
|
| 355 |
+
background: linear-gradient(135deg, #4caf50, #2e7d68);
|
| 356 |
+
}
|
| 357 |
+
.order-button:hover {
|
| 358 |
+
background: linear-gradient(135deg, #66bb6a, #2e7d68);
|
| 359 |
+
box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
|
| 360 |
}
|
| 361 |
@media (max-width: 768px) {
|
| 362 |
.products-grid {
|
|
|
|
| 388 |
<div class="container">
|
| 389 |
<div class="header">
|
| 390 |
<h1>Каталог</h1>
|
|
|
|
|
|
|
|
|
|
| 391 |
</div>
|
| 392 |
<div class="filters-container">
|
| 393 |
<button class="category-filter active" data-category="all">Все категории</button>
|
|
|
|
| 462 |
const products = {{ products|tojson }};
|
| 463 |
let selectedProductIndex = null;
|
| 464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
function openModal(index) {
|
| 466 |
loadProductDetails(index);
|
| 467 |
document.getElementById('productModal').style.display = "block";
|
|
|
|
| 646 |
<div class="swiper-button-next"></div>
|
| 647 |
<div class="swiper-button-prev"></div>
|
| 648 |
</div>
|
| 649 |
+
<p style="color: rgba(255, 255, 255, 0.8);"><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
|
| 650 |
+
<p style="color: rgba(255, 255, 255, 0.8);"><strong>Цена:</strong> {{ product['price'] }} с</p>
|
| 651 |
+
<p style="color: rgba(255, 255, 255, 0.8);"><strong>Описание:</strong> {{ product['description'] }}</p>
|
| 652 |
</div>
|
| 653 |
'''
|
| 654 |
return render_template_string(detail_html, product=product, repo_id=REPO_ID)
|
|
|
|
| 774 |
<meta charset="UTF-8">
|
| 775 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 776 |
<title>Админ-панель</title>
|
| 777 |
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;600&display=swap" rel="stylesheet">
|
| 778 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 779 |
body {
|
| 780 |
+
font-family: 'Roboto', sans-serif;
|
| 781 |
+
background: linear-gradient(135deg, #1a4d3e, #2e7d68);
|
| 782 |
color: #ffffff;
|
| 783 |
padding: 20px;
|
| 784 |
}
|
|
|
|
| 786 |
max-width: 1200px;
|
| 787 |
margin: 0 auto;
|
| 788 |
}
|
| 789 |
+
h1, h2 {
|
|
|
|
| 790 |
font-weight: 600;
|
| 791 |
margin-bottom: 20px;
|
| 792 |
}
|
|
|
|
| 794 |
background: rgba(255, 255, 255, 0.1);
|
| 795 |
padding: 20px;
|
| 796 |
border-radius: 15px;
|
| 797 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
|
| 798 |
margin-bottom: 30px;
|
| 799 |
}
|
| 800 |
label {
|
|
|
|
| 807 |
width: 100%;
|
| 808 |
padding: 12px;
|
| 809 |
margin-top: 5px;
|
| 810 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 811 |
+
border-radius: 8px;
|
| 812 |
background-color: rgba(255, 255, 255, 0.1);
|
| 813 |
color: #ffffff;
|
| 814 |
font-size: 1rem;
|
|
|
|
| 822 |
button {
|
| 823 |
padding: 12px 20px;
|
| 824 |
border: none;
|
| 825 |
+
border-radius: 8px;
|
| 826 |
+
background: linear-gradient(135deg, #4caf50, #2e7d68);
|
| 827 |
+
color: white;
|
| 828 |
font-weight: 500;
|
| 829 |
cursor: pointer;
|
| 830 |
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 831 |
margin-top: 15px;
|
| 832 |
}
|
| 833 |
button:hover {
|
| 834 |
+
background: linear-gradient(135deg, #66bb6a, #2e7d68);
|
| 835 |
+
box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
|
| 836 |
transform: translateY(-2px);
|
| 837 |
}
|
| 838 |
.delete-button {
|
| 839 |
+
background: linear-gradient(135deg, #ef5350, #d32f2f);
|
| 840 |
}
|
| 841 |
.delete-button:hover {
|
| 842 |
+
background: linear-gradient(135deg, #f44336, #b71c1c);
|
| 843 |
+
box-shadow: 0 4px 15px rgba(244, 67, 54, 0.5);
|
| 844 |
}
|
| 845 |
.product-list, .category-list {
|
| 846 |
display: grid;
|
|
|
|
| 850 |
background: rgba(255, 255, 255, 0.1);
|
| 851 |
padding: 20px;
|
| 852 |
border-radius: 15px;
|
| 853 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
|
| 854 |
}
|
| 855 |
.edit-form {
|
| 856 |
margin-top: 15px;
|
|
|
|
| 895 |
<div class="category-list">
|
| 896 |
{% for category in categories %}
|
| 897 |
<div class="category-item">
|
| 898 |
+
<h3>{{ category }}</h3>
|
| 899 |
<form method="POST" style="display: inline;">
|
| 900 |
<input type="hidden" name="action" value="delete_category">
|
| 901 |
<input type="hidden" name="category_index" value="{{ loop.index0 }}">
|
|
|
|
| 917 |
<div class="product-list">
|
| 918 |
{% for product in products %}
|
| 919 |
<div class="product-item">
|
| 920 |
+
<h3>{{ product['name'] }}</h3>
|
| 921 |
+
<p style="color: rgba(255, 255, 255, 0.8);"><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
|
| 922 |
+
<p style="color: rgba(255, 255, 255, 0.8);"><strong>Цена:</strong> {{ product['price'] }} с</p>
|
| 923 |
+
<p style="color: rgba(255, 255, 255, 0.8);"><strong>Описание:</strong> {{ product['description'] }}</p>
|
| 924 |
{% if product.get('photos') and product['photos']|length > 0 %}
|
| 925 |
<img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/{{ product['photos'][0] }}"
|
| 926 |
alt="{{ product['name'] }}"
|