thulieu commited on
Commit
53b07b2
·
verified ·
1 Parent(s): 3b60160

Upload 63 files

Browse files
Files changed (4) hide show
  1. assets/css/styles.css +160 -0
  2. assets/js/main.js +74 -20
  3. index.html +30 -0
  4. product_detail.html +2 -2
assets/css/styles.css CHANGED
@@ -617,6 +617,127 @@ body.dark-theme {
617
  border-radius: 10px;
618
  }
619
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
620
  /*=============== DISCOUNT ===============*/
621
  .discount__container {
622
  row-gap: 3.5rem;
@@ -1844,3 +1965,42 @@ body.dark-theme {
1844
  background-color: var(--first-color);
1845
  color: var(--white-color);
1846
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
617
  border-radius: 10px;
618
  }
619
 
620
+ /*=============== FEATURED CATEGORIES ===============*/
621
+ .featured__category {
622
+ margin-bottom: 4rem;
623
+ }
624
+
625
+ .featured__category:last-child {
626
+ margin-bottom: 0;
627
+ }
628
+
629
+ .featured__category-header {
630
+ text-align: center;
631
+ margin-bottom: 2rem;
632
+ padding: 2rem 1rem;
633
+ background: linear-gradient(135deg, var(--first-color) 0%, #8e0022 100%);
634
+ border-radius: 20px;
635
+ position: relative;
636
+ overflow: hidden;
637
+ }
638
+
639
+ .featured__category-header::before {
640
+ content: "";
641
+ position: absolute;
642
+ top: 0;
643
+ left: 0;
644
+ right: 0;
645
+ bottom: 0;
646
+ background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="0.8" fill="white" opacity="0.08"/><circle cx="40" cy="80" r="1.2" fill="white" opacity="0.06"/><circle cx="90" cy="90" r="0.6" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.9" fill="white" opacity="0.07"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
647
+ pointer-events: none;
648
+ }
649
+
650
+ .featured__category-title {
651
+ color: var(--white-color);
652
+ font-size: var(--h2-font-size);
653
+ font-weight: var(--font-semi-bold);
654
+ margin-bottom: 0.5rem;
655
+ display: flex;
656
+ align-items: center;
657
+ justify-content: center;
658
+ gap: 0.75rem;
659
+ position: relative;
660
+ z-index: 1;
661
+ }
662
+
663
+ .featured__category-title i {
664
+ font-size: 1.5rem;
665
+ background: var(--white-color);
666
+ color: var(--first-color);
667
+ padding: 0.5rem;
668
+ border-radius: 50%;
669
+ }
670
+
671
+ .featured__category-desc {
672
+ color: var(--white-color);
673
+ font-size: var(--normal-font-size);
674
+ opacity: 0.9;
675
+ max-width: 400px;
676
+ margin: 0 auto;
677
+ position: relative;
678
+ z-index: 1;
679
+ }
680
+
681
+ /* Category specific styling */
682
+ .featured__category:nth-child(2) .featured__category-header {
683
+ background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
684
+ }
685
+
686
+ .featured__category:nth-child(3) .featured__category-header {
687
+ background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
688
+ }
689
+
690
+ .featured__category:nth-child(4) .featured__category-header {
691
+ background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
692
+ }
693
+
694
+ /* Animation effects */
695
+ .featured__category-header {
696
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
697
+ }
698
+
699
+ .featured__category-header:hover {
700
+ transform: translateY(-2px);
701
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
702
+ }
703
+
704
+ /* Responsive */
705
+ @media screen and (max-width: 768px) {
706
+ .featured__category {
707
+ margin-bottom: 3rem;
708
+ }
709
+
710
+ .featured__category-title {
711
+ font-size: var(--h3-font-size);
712
+ flex-direction: column;
713
+ gap: 0.5rem;
714
+ }
715
+
716
+ .featured__category-title i {
717
+ font-size: 1.25rem;
718
+ padding: 0.4rem;
719
+ }
720
+
721
+ .featured__category-desc {
722
+ font-size: var(--small-font-size);
723
+ }
724
+
725
+ .featured__category-header {
726
+ padding: 1.5rem 1rem;
727
+ border-radius: 15px;
728
+ }
729
+ }
730
+
731
+ @media screen and (max-width: 480px) {
732
+ .featured__category-title {
733
+ font-size: var(--normal-font-size);
734
+ }
735
+
736
+ .featured__category-desc {
737
+ font-size: var(--smaller-font-size);
738
+ }
739
+ }
740
+
741
  /*=============== DISCOUNT ===============*/
742
  .discount__container {
743
  row-gap: 3.5rem;
 
1965
  background-color: var(--first-color);
1966
  color: var(--white-color);
1967
  }
1968
+
1969
+ /*=============== ANIMATIONS ===============*/
1970
+ @keyframes fadeInUp {
1971
+ from {
1972
+ opacity: 0;
1973
+ transform: translateY(30px);
1974
+ }
1975
+ to {
1976
+ opacity: 1;
1977
+ transform: translateY(0);
1978
+ }
1979
+ }
1980
+
1981
+ @keyframes pulse {
1982
+ 0%,
1983
+ 100% {
1984
+ transform: scale(1);
1985
+ }
1986
+ 50% {
1987
+ transform: scale(1.05);
1988
+ }
1989
+ }
1990
+
1991
+ .featured__category-title i {
1992
+ animation: pulse 2s infinite;
1993
+ }
1994
+
1995
+ /* Hover effects cho featured cards trong từng category */
1996
+ .featured__category:nth-child(2) .featured__card:hover {
1997
+ border-color: #2ecc71;
1998
+ }
1999
+
2000
+ .featured__category:nth-child(3) .featured__card:hover {
2001
+ border-color: #3498db;
2002
+ }
2003
+
2004
+ .featured__category:nth-child(4) .featured__card:hover {
2005
+ border-color: #e74c3c;
2006
+ }
assets/js/main.js CHANGED
@@ -261,24 +261,39 @@ let swiperHome = new Swiper(".home__swiper", {
261
  });
262
 
263
  /*=============== FEATURED SWIPER ===============*/
264
- let swiperFeatured = new Swiper(".featured__swiper", {
265
- loop: true,
266
- spaceBetween: 16,
267
- grabCursor: true,
268
- slidesPerView: "auto",
269
- centeredSlides: "auto",
270
-
271
- navigation: {
272
- nextEl: ".swiper-button-next",
273
- prevEl: ".swiper-button-prev",
274
- },
275
-
276
- breakpoints: {
277
- 1150: {
278
- slidesPerView: 4,
279
- centeredSlides: false,
280
- },
281
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  });
283
 
284
  /*=============== FEATURED ADD TO CART ===============*/
@@ -476,16 +491,28 @@ const sr = ScrollReveal({
476
  distance: "60px",
477
  duration: 2500,
478
  delay: 400,
479
- // reset: true, // Animations repeat
480
  });
481
 
482
- sr.reveal(`.home__data, .featured__container, .new__container,
483
  .join__data, .testimonial__container, .footer`);
484
  sr.reveal(`.home__images`, { delay: 600 });
485
  sr.reveal(`.services__card`, { interval: 100 });
486
  sr.reveal(`.discount__data`, { origin: "left" });
487
  sr.reveal(`.discount__images`, { origin: "right" });
488
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
  /*=============== OPEN DETAIL TAB ===============*/
490
  function openDetailPage() {
491
  // Đường dẫn tới trang detail.html
@@ -803,3 +830,30 @@ document.addEventListener("DOMContentLoaded", function () {
803
  });
804
  }
805
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  });
262
 
263
  /*=============== FEATURED SWIPER ===============*/
264
+ // Khởi tạo swiper cho tất cả các category
265
+ document.addEventListener("DOMContentLoaded", function () {
266
+ // Tìm tất cả các swiper trong featured
267
+ const featuredSwipers = document.querySelectorAll(".featured__swiper");
268
+
269
+ featuredSwipers.forEach((swiperElement, index) => {
270
+ new Swiper(swiperElement, {
271
+ loop: true,
272
+ spaceBetween: 16,
273
+ grabCursor: true,
274
+ slidesPerView: "auto",
275
+ centeredSlides: "auto",
276
+
277
+ navigation: {
278
+ nextEl: swiperElement.querySelector(".swiper-button-next"),
279
+ prevEl: swiperElement.querySelector(".swiper-button-prev"),
280
+ },
281
+
282
+ breakpoints: {
283
+ 1150: {
284
+ slidesPerView: 4,
285
+ centeredSlides: false,
286
+ },
287
+ },
288
+
289
+ // Thêm class unique cho mỗi swiper
290
+ on: {
291
+ init: function () {
292
+ swiperElement.classList.add(`featured-swiper-${index + 1}`);
293
+ },
294
+ },
295
+ });
296
+ });
297
  });
298
 
299
  /*=============== FEATURED ADD TO CART ===============*/
 
491
  distance: "60px",
492
  duration: 2500,
493
  delay: 400,
 
494
  });
495
 
496
+ sr.reveal(`.home__data, .new__container,
497
  .join__data, .testimonial__container, .footer`);
498
  sr.reveal(`.home__images`, { delay: 600 });
499
  sr.reveal(`.services__card`, { interval: 100 });
500
  sr.reveal(`.discount__data`, { origin: "left" });
501
  sr.reveal(`.discount__images`, { origin: "right" });
502
 
503
+ // Thêm animation cho category headers
504
+ sr.reveal(`.featured__category-header`, {
505
+ interval: 200,
506
+ distance: "30px",
507
+ duration: 1000,
508
+ });
509
+
510
+ // Animation cho featured containers
511
+ sr.reveal(`.featured__container`, {
512
+ interval: 300,
513
+ delay: 200,
514
+ });
515
+
516
  /*=============== OPEN DETAIL TAB ===============*/
517
  function openDetailPage() {
518
  // Đường dẫn tới trang detail.html
 
830
  });
831
  }
832
  });
833
+
834
+ /*=============== CATEGORY SCROLL ANIMATION ===============*/
835
+ document.addEventListener("DOMContentLoaded", function () {
836
+ // Intersection Observer cho category headers
837
+ const categoryHeaders = document.querySelectorAll(
838
+ ".featured__category-header"
839
+ );
840
+
841
+ const observerOptions = {
842
+ threshold: 0.3,
843
+ rootMargin: "0px 0px -50px 0px",
844
+ };
845
+
846
+ const categoryObserver = new IntersectionObserver((entries) => {
847
+ entries.forEach((entry) => {
848
+ if (entry.isIntersecting) {
849
+ entry.target.style.animation = "fadeInUp 0.8s ease forwards";
850
+ }
851
+ });
852
+ }, observerOptions);
853
+
854
+ categoryHeaders.forEach((header) => {
855
+ header.style.opacity = "0";
856
+ header.style.transform = "translateY(30px)";
857
+ categoryObserver.observe(header);
858
+ });
859
+ });
index.html CHANGED
@@ -320,6 +320,16 @@
320
  <h2 class="section__title">Sản phẩm bán chạy</h2>
321
 
322
  <div class="featured__container container">
 
 
 
 
 
 
 
 
 
 
323
  <div class="featured__swiper swiper">
324
  <div class="swiper-wrapper">
325
  <article class="featured__card swiper-slide">
@@ -490,6 +500,16 @@
490
  </div>
491
 
492
  <div class="featured__container container">
 
 
 
 
 
 
 
 
 
 
493
  <div class="featured__swiper swiper">
494
  <div class="swiper-wrapper">
495
  <article class="featured__card swiper-slide">
@@ -660,6 +680,16 @@
660
  </div>
661
 
662
  <div class="featured__container container">
 
 
 
 
 
 
 
 
 
 
663
  <div class="featured__swiper swiper">
664
  <div class="swiper-wrapper">
665
  <article class="featured__card swiper-slide">
 
320
  <h2 class="section__title">Sản phẩm bán chạy</h2>
321
 
322
  <div class="featured__container container">
323
+ <div class="container">
324
+ <div class="featured__category-header">
325
+ <h3 class="featured__category-title">
326
+ <i class="ri-drop-line"></i>
327
+ Nước Tẩy Trang
328
+ </h3>
329
+ <p class="featured__category-desc">Làm sạch sâu, loại bỏ hoàn toàn makeup</p>
330
+ </div>
331
+ </div>
332
+
333
  <div class="featured__swiper swiper">
334
  <div class="swiper-wrapper">
335
  <article class="featured__card swiper-slide">
 
500
  </div>
501
 
502
  <div class="featured__container container">
503
+ <div class="container">
504
+ <div class="featured__category-header">
505
+ <h3 class="featured__category-title">
506
+ <i class="ri-brush-2-line"></i>
507
+ Kem Nền
508
+ </h3>
509
+ <p class="featured__category-desc">Che phủ hoàn hảo, làn da mịn màng tự nhiên</p>
510
+ </div>
511
+ </div>
512
+
513
  <div class="featured__swiper swiper">
514
  <div class="swiper-wrapper">
515
  <article class="featured__card swiper-slide">
 
680
  </div>
681
 
682
  <div class="featured__container container">
683
+ <div class="container">
684
+ <div class="featured__category-header">
685
+ <h3 class="featured__category-title">
686
+ <i class="ri-heart-3-line"></i>
687
+ Son Môi
688
+ </h3>
689
+ <p class="featured__category-desc">Màu sắc rực rỡ, độ bền cao, không khô môi</p>
690
+ </div>
691
+ </div>
692
+
693
  <div class="featured__swiper swiper">
694
  <div class="swiper-wrapper">
695
  <article class="featured__card swiper-slide">
product_detail.html CHANGED
@@ -29,14 +29,14 @@
29
  <!--==================== HEADER ====================-->
30
  <header class="header" id="header">
31
  <nav class="nav container">
32
- <a href="#" class="nav__logo">
33
  <i class="ri-store-2-line"></i> ThuLieu Store
34
  </a>
35
 
36
  <div class="nav__menu">
37
  <ul class="nav__list">
38
  <li class="nav__item">
39
- <a href="#home" class="nav__link active-link">
40
  <i class="ri-home-line"></i>
41
  <span>Trang chủ</span>
42
  </a>
 
29
  <!--==================== HEADER ====================-->
30
  <header class="header" id="header">
31
  <nav class="nav container">
32
+ <a href="index.html" class="nav__logo">
33
  <i class="ri-store-2-line"></i> ThuLieu Store
34
  </a>
35
 
36
  <div class="nav__menu">
37
  <ul class="nav__list">
38
  <li class="nav__item">
39
+ <a href="index.html" class="nav__link active-link">
40
  <i class="ri-home-line"></i>
41
  <span>Trang chủ</span>
42
  </a>