+ Новинки
+
+
+
{products.map((product, index) => (
setHoveredProduct(product.id)}
onMouseLeave={() => setHoveredProduct(null)}
>
-
+ {/* Метка "New" */}
+ {product.isNew && (
+
+ New
+
+ )}
+
+ {/* Кнопка избранного */}
+
+
+ {/* Изображение товара */}
+
1 ? product.images[1] : product.images[0]}
alt={product.name}
layout="fill"
- objectFit="contain"
- className="transition-opacity duration-300"
+ objectFit="cover"
+ className="transition-all duration-500 hover:scale-105"
/>
-
-
{product.name}
-
{product.description}
-
- {product.price.toLocaleString()} ₽
-
-
+
+ {/* Информация о товаре */}
+
+
{product.name}
+
{product.price.toLocaleString()} ₽
))}
@@ -193,6 +173,80 @@ export default function Home() {
+
+
);
+}
+
+// Функция для получения данных на стороне сервера
+export async function getStaticProps() {
+ // Данные о товарах
+ const products = [
+ {
+ id: 1,
+ name: 'Пальто оверсайз',
+ price: 43800,
+ images: ['/wear/palto1.jpg', '/wear/palto2.jpg'],
+ description: 'Элегантное пальто оверсайз высокого качества',
+ isNew: true
+ },
+ {
+ id: 2,
+ name: 'Костюм хлопок',
+ price: 12800,
+ images: ['/wear/pidzak1.jpg', '/wear/pidzak2.jpg'],
+ description: 'Стильный костюм для особых случаев',
+ isNew: true
+ },
+ {
+ id: 3,
+ name: 'Блузка',
+ price: 3500,
+ images: ['/wear/sorochka1.jpg', '/wear/sorochka2.jpg'],
+ description: 'Классическая блузка в коричневом цвете',
+ isNew: true
+ },
+ {
+ id: 4,
+ name: 'Платье со сборкой',
+ price: 28800,
+ images: ['/wear/jumpsuit_1.jpg', '/wear/jumpsuit_2.jpg'],
+ description: 'Элегантное платье высокого качества',
+ isNew: true
+ }
+ ];
+
+ // Получение изображений для слайдера из папки hero_photos
+ const heroImagesDirectory = path.join(process.cwd(), 'public/hero_photos');
+ let heroImages = [];
+
+ try {
+ const fileNames = fs.readdirSync(heroImagesDirectory);
+ // Фильтруем только изображения
+ const imageExtensions = ['.jpg', '.jpeg', '.png', '.webp', '.gif'];
+ const imageFiles = fileNames.filter(file =>
+ imageExtensions.some(ext => file.toLowerCase().endsWith(ext))
+ );
+
+ if (imageFiles.length > 0) {
+ heroImages = imageFiles.map(fileName => `/hero_photos/${fileName}`);
+ } else {
+ // Если нет изображений, используем изображения из папки photos
+ heroImages = ['/photos/head_photo.png'];
+ }
+ } catch (error) {
+ console.error('Error reading hero_photos directory:', error);
+ // Если папка не существует или пуста, используем изображение из папки photos
+ heroImages = ['/photos/head_photo.png'];
+ }
+
+ return {
+ props: {
+ heroImages,
+ products,
+ },
+ // Перегенерация страницы каждые 10 минут
+ revalidate: 600,
+ };
}
\ No newline at end of file
diff --git a/public/hero_photos/hero1.png b/public/hero_photos/hero1.png
new file mode 100644
index 0000000..8541c64
Binary files /dev/null and b/public/hero_photos/hero1.png differ
diff --git a/public/hero_photos/photo_main_main_1.png b/public/hero_photos/photo_main_main_1.png
new file mode 100644
index 0000000..e387f13
Binary files /dev/null and b/public/hero_photos/photo_main_main_1.png differ
diff --git a/public/hero_photos/photo_main_main_2.png b/public/hero_photos/photo_main_main_2.png
new file mode 100644
index 0000000..3c38e3c
Binary files /dev/null and b/public/hero_photos/photo_main_main_2.png differ
diff --git a/public/hero_photos/photo_main_main_3.png b/public/hero_photos/photo_main_main_3.png
new file mode 100644
index 0000000..27d8fae
Binary files /dev/null and b/public/hero_photos/photo_main_main_3.png differ
diff --git a/public/wear/jumpsuit_1.jpg b/public/wear/jumpsuit_1.jpg
new file mode 100644
index 0000000..79ea664
Binary files /dev/null and b/public/wear/jumpsuit_1.jpg differ
diff --git a/public/wear/jumpsuit_2.jpg b/public/wear/jumpsuit_2.jpg
new file mode 100644
index 0000000..10ecf69
Binary files /dev/null and b/public/wear/jumpsuit_2.jpg differ
diff --git a/tailwind.config.js b/tailwind.config.js
index 3db4c4a..f92a8c8 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -16,6 +16,15 @@ module.exports = {
sans: ['Inter', 'sans-serif'],
serif: ['Playfair Display', 'serif'],
},
+ animation: {
+ 'fade-in': 'fadeIn 0.5s ease-in-out',
+ },
+ keyframes: {
+ fadeIn: {
+ '0%': { opacity: 0 },
+ '100%': { opacity: 1 },
+ },
+ },
},
},
plugins: [],