Responsive Perfume Website Template Design Using HTML, CSS & JavaScript
Responsive Perfume Website Template Design Using HTML, CSS & JavaScript
Responsive Perfume Website Template Design Using HTML, CSS & JavaScript
π§ Overview
In this tutorial, you will learn how to make a mobile-friendly and modern Perfume Website with HTML, CSS and JavaScript. This design includes a fixed navigation bar, a cool hero section, buttons with a gradient, and smooth scroll animations with ScrollReveal.js.
By the end of this tutorial you will learn how to:
- Build a responsive layout using CSS Grid
- Introduce animations with ScrollReveal.js
- Build a working mobile navigation menu with JavaScript
- Style the hero section using gradients and hover effects.
π§© Project Files
Before we begin, create the following file structure:
perfume-website/
β
βββ index.html
βββ style.css
βββ script.js
βββ images/
Β Β Β Β βββ hero.png
Β Β Β Β βββ bg.png
π§± Step 1: Creating the Navbar
The navbar includes the following:
- A logo (PerfumeLogo)
- Navigation links (About, Perfume, Delivery)
- A hamburger icon that opens the mobile menu or closes it
- Icons for the wishlist and shopping cart
π§± Step 2: Creating the Hero Section
The hero section includes:
- A heading: Premium Perfume
- A short description: Viktor & Rolf Perfume
- Size buttons (50ml, 100ml, 150ml)
- Gradient βAdd to Cartβ button
- Image of the perfume on one side
Use gradient backgrounds for buttons:Β
background-image: linear-gradient(180deg, #e1bbf7 0%, #af6de5 46%, #36104f 100%)
π§± Step 3: Making It Responsive
To make your design look great on all devices:
@media (max-width: 768px) {
/* Adjust column stacking, font size, padding */
}
π§± Step 4: Adding Scroll Animations
We will implement ScrollReveal.js to animate the elements when brought into view via scrolling.
1. Add ScrollReveal CDN
Paste this code before the closing tag:
<script src=”https://unpkg.com/scrollreveal”></script>
2. Add the animation script:
<script>
const scrollRevealOption = {
distance: “50px”,
origin: “bottom”,
duration: 1000,
};
ScrollReveal().reveal(“.header__image img”, { …scrollRevealOption, origin: “right” });
ScrollReveal().reveal(“.header__content h1”, { …scrollRevealOption, delay: 500 });
ScrollReveal().reveal(“.header__content p”, { …scrollRevealOption, delay: 1000 });
</script>
π§± Step5: Adding JS for the Menu
Now we will have the mobile navigation menu open/close on a click.
<script>
const menuBtn = document.getElementById(“menu-btn”);
const navLinks = document.getElementById(“nav__links”);
const menuBtnIcon = menuBtn.querySelector(“i”);
menuBtn.addEventListener(“click”, () => {
navLinks.classList.toggle(“open”);
const isOpen = navLinks.classList.contains(“open”);
menuBtnIcon.setAttribute(“class”, isOpen ? “ri-close-line” : “ri-menu-line”);
});
</script>
π‘ Note: This will toggle your navigation open and close smoothly on an icon switch.
Previous Post
Related Post
Design Synth
Welcome to Design Synth! Enter the world of web design, where art meets code. Find awesome designs, practice new techniques, and churn out stunning digital experiences that excite and engage an audience.
Popular Posts
Explore Topics
- Card Design (1)
- Carousel (11)
- CSS and HTML (2)
- Form Designs (1)
- Header Design (2)
- Hover Effect (1)
- JavaScript (1)
- Slider Designs (1)
- Template Designs (1)
Tag Clouds
- Animation Effects
- Animation Image
- Animation Text
- AOS Animation
- Button
- Card Design
- Cards Design
- Carousel
- Code Tutorials
- Creative Web Templates
- CSS and HTML
- Design Synth
- Effect Image
- Effect Scroll
- Form Design
- Form Designs
- Free Website Template
- Front-End Design
- Glassmorphism Design
- GSAP Animation
- Halloween
- Header Design
- Hover Effects
- HTML
- HTML CSS Projects
- JavaScript
- JS
- Modern Website Design
- Navbar Design
- Navbar Designs
- Parallax Effect
- Parallax Scroll CSS
- Plane Website
- Responsive
- Responsive Design
- Slider Design
- Slider Designs
- SVG
- Tailwind CSS
- Template Designs
- UI Design
- UX Design
- Web Design
- Web Development
- Website Templates
- WordPress Website
π§ Overview
In this tutorial, you will learn how to make a mobile-friendly and modern Perfume Website with HTML, CSS and JavaScript. This design includes a fixed navigation bar, a cool hero section, buttons with a gradient, and smooth scroll animations with ScrollReveal.js.
By the end of this tutorial you will learn how to:
- Build a responsive layout using CSS Grid
- Introduce animations with ScrollReveal.js
- Build a working mobile navigation menu with JavaScript
- Style the hero section using gradients and hover effects.
π§© Project Files
Before we begin, create the following file structure:
perfume-website/
β
βββ index.html
βββ style.css
βββ script.js
βββ images/
Β Β Β Β βββ hero.png
Β Β Β Β βββ bg.png
π§± Step 1: Creating the Navbar
The navbar includes the following:
- A logo (PerfumeLogo)
- Navigation links (About, Perfume, Delivery)
- A hamburger icon that opens the mobile menu or closes it
- Icons for the wishlist and shopping cart
π§± Step 2: Creating the Hero Section
The hero section includes:
- A heading: Premium Perfume
- A short description: Viktor & Rolf Perfume
- Size buttons (50ml, 100ml, 150ml)
- Gradient βAdd to Cartβ button
- Image of the perfume on one side
Use gradient backgrounds for buttons:Β
background-image: linear-gradient(180deg, #e1bbf7 0%, #af6de5 46%, #36104f 100%)
π§± Step 3: Making It Responsive
To make your design look great on all devices:
@media (max-width: 768px) {
/* Adjust column stacking, font size, padding */
}
π§± Step 4: Adding Scroll Animations
We will implement ScrollReveal.js to animate the elements when brought into view via scrolling.
1. Add ScrollReveal CDN
Paste this code before the closing tag:
<script src=”https://unpkg.com/scrollreveal”></script>
2. Add the animation script:
<script>
const scrollRevealOption = {
distance: “50px”,
origin: “bottom”,
duration: 1000,
};
ScrollReveal().reveal(“.header__image img”, { …scrollRevealOption, origin: “right” });
ScrollReveal().reveal(“.header__content h1”, { …scrollRevealOption, delay: 500 });
ScrollReveal().reveal(“.header__content p”, { …scrollRevealOption, delay: 1000 });
</script>
π§± Step5: Adding JS for the Menu
Now we will have the mobile navigation menu open/close on a click.
<script>
const menuBtn = document.getElementById(“menu-btn”);
const navLinks = document.getElementById(“nav__links”);
const menuBtnIcon = menuBtn.querySelector(“i”);
menuBtn.addEventListener(“click”, () => {
navLinks.classList.toggle(“open”);
const isOpen = navLinks.classList.contains(“open”);
menuBtnIcon.setAttribute(“class”, isOpen ? “ri-close-line” : “ri-menu-line”);
});
</script>
π‘ Note: This will toggle your navigation open and close smoothly on an icon switch.
Previous Post
Related Post
Design Synth
Welcome to Design Synth! Enter the world of web design, where art meets code. Find awesome designs, practice new techniques, and churn out stunning digital experiences that excite and engage an audience.
Popular Posts
Explore Topics
- Card Design (1)
- Carousel (11)
- CSS and HTML (2)
- Form Designs (1)
- Header Design (2)
- Hover Effect (1)
- JavaScript (1)
- Slider Designs (1)
- Template Designs (1)
Tag Clouds
- Animation Effects
- Animation Image
- Animation Text
- AOS Animation
- Button
- Card Design
- Cards Design
- Carousel
- Code Tutorials
- Creative Web Templates
- CSS and HTML
- Design Synth
- Effect Image
- Effect Scroll
- Form Design
- Form Designs
- Free Website Template
- Front-End Design
- Glassmorphism Design
- GSAP Animation
- Halloween
- Header Design
- Hover Effects
- HTML
- HTML CSS Projects
- JavaScript
- JS
- Modern Website Design
- Navbar Design
- Navbar Designs
- Parallax Effect
- Parallax Scroll CSS
- Plane Website
- Responsive
- Responsive Design
- Slider Design
- Slider Designs
- SVG
- Tailwind CSS
- Template Designs
- UI Design
- UX Design
- Web Design
- Web Development
- Website Templates
- WordPress Website
π§ Overview
In this tutorial, you will learn how to make a mobile-friendly and modern Perfume Website with HTML, CSS and JavaScript. This design includes a fixed navigation bar, a cool hero section, buttons with a gradient, and smooth scroll animations with ScrollReveal.js.
By the end of this tutorial you will learn how to:
- Build a responsive layout using CSS Grid
- Introduce animations with ScrollReveal.js
- Build a working mobile navigation menu with JavaScript
- Style the hero section using gradients and hover effects.
π§© Project Files
Before we begin, create the following file structure:
perfume-website/
β
βββ index.html
βββ style.css
βββ script.js
βββ images/
Β Β Β Β βββ hero.png
Β Β Β Β βββ bg.png
π§± Step 1: Creating the Navbar
The navbar includes the following:
- A logo (PerfumeLogo)
- Navigation links (About, Perfume, Delivery)
- A hamburger icon that opens the mobile menu or closes it
- Icons for the wishlist and shopping cart
π§± Step 2: Creating the Hero Section
The hero section includes:
- A heading: Premium Perfume
- A short description: Viktor & Rolf Perfume
- Size buttons (50ml, 100ml, 150ml)
- Gradient βAdd to Cartβ button
- Image of the perfume on one side
Use gradient backgrounds for buttons:Β
background-image: linear-gradient(180deg, #e1bbf7 0%, #af6de5 46%, #36104f 100%)
π§± Step 3: Making It Responsive
To make your design look great on all devices:
@media (max-width: 768px) {
/* Adjust column stacking, font size, padding */
}
π§± Step 4: Adding Scroll Animations
We will implement ScrollReveal.js to animate the elements when brought into view via scrolling.
1. Add ScrollReveal CDN
Paste this code before the closing tag:
<script src=”https://unpkg.com/scrollreveal”></script>
2. Add the animation script:
<script>
const scrollRevealOption = {
distance: “50px”,
origin: “bottom”,
duration: 1000,
};
ScrollReveal().reveal(“.header__image img”, { …scrollRevealOption, origin: “right” });
ScrollReveal().reveal(“.header__content h1”, { …scrollRevealOption, delay: 500 });
ScrollReveal().reveal(“.header__content p”, { …scrollRevealOption, delay: 1000 });
</script>
π§± Step5: Adding JS for the Menu
Now we will have the mobile navigation menu open/close on a click.
<script>
const menuBtn = document.getElementById(“menu-btn”);
const navLinks = document.getElementById(“nav__links”);
const menuBtnIcon = menuBtn.querySelector(“i”);
menuBtn.addEventListener(“click”, () => {
navLinks.classList.toggle(“open”);
const isOpen = navLinks.classList.contains(“open”);
menuBtnIcon.setAttribute(“class”, isOpen ? “ri-close-line” : “ri-menu-line”);
});
</script>
π‘ Note: This will toggle your navigation open and close smoothly on an icon switch.
Previous Post
Related Post
Design Synth
Welcome to Design Synth! Enter the world of web design, where art meets code. Find awesome designs, practice new techniques, and churn out stunning digital experiences that excite and engage an audience.
Popular Posts
Explore Topics
- Card Design (1)
- Carousel (11)
- CSS and HTML (2)
- Form Designs (1)
- Header Design (2)
- Hover Effect (1)
- JavaScript (1)
- Slider Designs (1)
- Template Designs (1)
Tag Clouds
- Animation Effects
- Animation Image
- Animation Text
- AOS Animation
- Button
- Card Design
- Cards Design
- Carousel
- Code Tutorials
- Creative Web Templates
- CSS and HTML
- Design Synth
- Effect Image
- Effect Scroll
- Form Design
- Form Designs
- Free Website Template
- Front-End Design
- Glassmorphism Design
- GSAP Animation
- Halloween
- Header Design
- Hover Effects
- HTML
- HTML CSS Projects
- JavaScript
- JS
- Modern Website Design
- Navbar Design
- Navbar Designs
- Parallax Effect
- Parallax Scroll CSS
- Plane Website
- Responsive
- Responsive Design
- Slider Design
- Slider Designs
- SVG
- Tailwind CSS
- Template Designs
- UI Design
- UX Design
- Web Design
- Web Development
- Website Templates
- WordPress Website