### Clone Grilli Repository
Source: https://github.com/codewithsadee/grilli/blob/master/README.md
Commands to clone the repository locally for Linux/macOS and Windows environments.
```bash
sudo git clone https://github.com/codewithsadee/grilli.git
```
```bash
git clone https://github.com/codewithsadee/grilli.git
```
--------------------------------
### Import Ionicon Icons
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
Add these script tags to your HTML to enable the use of Ionicon icons. Ensure correct placement for module and nomodule scripts.
```html
```
--------------------------------
### Project Directory Structure
Source: https://context7.com/codewithsadee/grilli/llms.txt
The file organization for the Grilli template, separating assets, styles, and scripts.
```text
grilli/
├── index.html # Main HTML file with all sections
├── favicon.svg # Site favicon
├── assets/
│ ├── css/
│ │ └── style.css # Complete stylesheet with CSS variables
│ ├── js/
│ │ └── script.js # JavaScript functionality
│ └── images/ # All image assets
├── README.md
└── style-guide.md # Design tokens reference
```
--------------------------------
### Implement Header Scroll Behavior
Source: https://context7.com/codewithsadee/grilli/llms.txt
Manages sticky header visibility based on scroll direction and distance. Requires elements with data-header and data-back-top-btn attributes.
```javascript
/**
* HEADER & BACK TOP BTN
* Header hides when scrolling down, shows when scrolling up
*/
const header = document.querySelector("[data-header]");
const backTopBtn = document.querySelector("[data-back-top-btn]");
let lastScrollPos = 0;
const hideHeader = function () {
const isScrollBottom = lastScrollPos < window.scrollY;
if (isScrollBottom) {
header.classList.add("hide");
} else {
header.classList.remove("hide");
}
lastScrollPos = window.scrollY;
}
window.addEventListener("scroll", function () {
if (window.scrollY >= 50) {
header.classList.add("active");
backTopBtn.classList.add("active");
hideHeader();
} else {
header.classList.remove("active");
backTopBtn.classList.remove("active");
}
});
// Usage: Required HTML elements
//
// ...
```
--------------------------------
### Implement Service Card Component
Source: https://context7.com/codewithsadee/grilli/llms.txt
HTML structure for service cards featuring hover shine effects and lazy-loaded images. Ensure the img-holder container uses the correct aspect ratio variables.
```html
```
--------------------------------
### Implement Menu Card Component
Source: https://context7.com/codewithsadee/grilli/llms.txt
Displays food items in a grid layout with support for images, pricing, and status badges. Uses CSS custom properties for image aspect ratio control.
```html
```
--------------------------------
### Implement Page Preloader
Source: https://context7.com/codewithsadee/grilli/llms.txt
Handles the removal of the preloader element once the window load event fires.
```javascript
'use strict';
/**
* PRELOAD
* Loading animation ends after document is fully loaded
*/
const preloader = document.querySelector("[data-preaload]");
window.addEventListener("load", function () {
preloader.classList.add("loaded");
document.body.classList.add("loaded");
});
// Usage: Preloader HTML element
//
```
--------------------------------
### Transition Variables
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
CSS variables for defining transition durations and easing functions, providing options for 250ms, 500ms, and 1000ms.
```css
--transition-1: 250ms ease;
--transition-2: 500ms ease;
--transition-3: 1000ms ease;
```
--------------------------------
### Import Google Fonts
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
Include these HTML links in your document's head to import the 'DM Sans' and 'Forum' Google Fonts.
```html
```
--------------------------------
### Create Online Reservation Form
Source: https://context7.com/codewithsadee/grilli/llms.txt
A structured HTML form for table bookings, including inputs for personal details, party size, date, and time.
```html
```
--------------------------------
### Implement Hero Slider Component
Source: https://context7.com/codewithsadee/grilli/llms.txt
Displays a full-screen background image slider with navigation buttons and auto-slide functionality. Requires specific data attributes for JavaScript initialization.
```html
```
--------------------------------
### Project Color Palette
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
Defines the primary color variables used throughout the Grilli project, including various shades of black, grey, silver, gold, and white.
```css
--gold-crayola: hsl(38, 61%, 73%);
--quick-silver: hsla(0, 0%, 65%, 1);
--davys-grey: hsla(30, 3%, 34%, 1);
--smoky-black-1: hsla(40, 12%, 5%, 1);
--smoky-black-2: hsla(30, 8%, 5%, 1);
--smoky-black-3: hsla(0, 3%, 7%, 1);
--eerie-black-1: hsla(210, 4%, 9%, 1);
--eerie-black-2: hsla(210, 4%, 11%, 1);
--eerie-black-3: hsla(180, 2%, 8%, 1);
--eerie-black-4: hsla(0, 0%, 13%, 1);
--white: hsla(0, 0%, 100%, 1);
--white-alpha-20: hsla(0, 0%, 100%, 0.2);
--white-alpha-10: hsla(0, 0%, 100%, 0.1);
--black: hsla(0, 0%, 0%, 1);
--black-alpha-80: hsla(0, 0%, 0%, 0.8);
--black-alpha-15: hsla(0, 0%, 0%, 0.15);
```
--------------------------------
### HTML5 Boilerplate Structure
Source: https://context7.com/codewithsadee/grilli/llms.txt
The base HTML5 structure for the Grilli template, utilizing semantic tags and data attributes for JavaScript hooks.
```html
Grilli - Amazing & Delicious Food
...
```
--------------------------------
### Typography Variables
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
CSS variables for font families, sizes, weights, line heights, and letter spacing, supporting 'Forum' and 'DM Sans' fonts.
```css
--fontFamily-forum: 'Forum', cursive;
--fontFamily-dm_sans: 'DM Sans', sans-serif;
--fontSize-display-1: calc(1.3rem + 6.7vw);
--fontSize-headline-1: calc(2rem + 2.5vw);
--fontSize-headline-2: calc(1.3rem + 2.4vw);
--fontSize-title-1: calc(1.6rem + 1.2vw);
--fontSize-title-2: 2.2rem;
--fontSize-title-3: 2.1rem;
--fontSize-title-4: calc(1.6rem + 1.2vw);
--fontSize-body-1: 2.4rem;
--fontSize-body-2: 1.6rem;
--fontSize-body-3: 1.8rem;
--fontSize-body-4: 1.6rem;
--fontSize-label-1: 1.4rem;
--fontSize-label-2: 1.2rem;
--weight-regular: 400;
--weight-bold: 700;
--lineHeight-1: 1em;
--lineHeight-2: 1.2em;
--lineHeight-3: 1.5em;
--lineHeight-4: 1.6em;
--lineHeight-5: 1.85em;
--lineHeight-6: 1.4em;
--letterSpacing-1: 0.15em;
--letterSpacing-2: 0.4em;
--letterSpacing-3: 0.2em;
--letterSpacing-4: 0.3em;
--letterSpacing-5: 3px;
```
--------------------------------
### Toggle Mobile Navigation Menu
Source: https://context7.com/codewithsadee/grilli/llms.txt
Handles the mobile menu overlay and body state using data attributes. Requires specific HTML elements with data-navbar, data-nav-toggler, and data-overlay attributes.
```javascript
/**
* NAVBAR - Mobile menu toggle functionality
*/
const navbar = document.querySelector("[data-navbar]");
const navTogglers = document.querySelectorAll("[data-nav-toggler]");
const overlay = document.querySelector("[data-overlay]");
const toggleNavbar = function () {
navbar.classList.toggle("active");
overlay.classList.toggle("active");
document.body.classList.toggle("nav-active");
}
addEventOnElements(navTogglers, "click", toggleNavbar);
// Usage: Required HTML elements
// ...
// ...
// ...
//
```
--------------------------------
### Spacing Variable
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
Defines the standard spacing for sections within the Grilli project.
```css
--section-space: 70px;
```
--------------------------------
### Gradient Color Definitions
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
CSS variables for defining gradient effects, including a loading text gradient and a general-purpose gradient.
```css
--loading-text-gradient: linear-gradient(90deg, transparent 0% 16.66%, var(--smoky-black-3) 33.33% 50%, transparent 66.66% 75%);
--gradient-1: linear-gradient(to top,hsla(0, 0%, 0%, 0.9),hsla(0, 0%, 0%, 0.7),transparent);
```
--------------------------------
### Border Radius Variables
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
CSS variables for defining border radius values, including a specific value for 24px and a value for creating circular elements.
```css
--radius-24: 24px;
--radius-circle: 50%;
```
--------------------------------
### Add Event Listeners to Multiple Elements
Source: https://context7.com/codewithsadee/grilli/llms.txt
A utility function to attach a single event listener to a NodeList of elements.
```javascript
/**
* Add event listener on multiple elements
* @param {NodeList} elements - Collection of DOM elements
* @param {string} eventType - Event type (click, mouseover, etc.)
* @param {Function} callback - Function to execute on event
*/
const addEventOnElements = function (elements, eventType, callback) {
for (let i = 0, len = elements.length; i < len; i++) {
elements[i].addEventListener(eventType, callback);
}
}
// Usage example:
const navTogglers = document.querySelectorAll("[data-nav-toggler]");
addEventOnElements(navTogglers, "click", toggleNavbar);
```
--------------------------------
### Define CSS Design Tokens
Source: https://context7.com/codewithsadee/grilli/llms.txt
Centralized CSS custom properties for colors, typography, spacing, and effects. Use these variables across components to maintain visual consistency.
```css
:root {
/* Colors - Dark elegant theme with gold accents */
--gold-crayola: hsl(38, 61%, 73%);
--quick-silver: hsla(0, 0%, 65%, 1);
--davys-grey: hsla(30, 3%, 34%, 1);
--smoky-black-1: hsla(40, 12%, 5%, 1);
--smoky-black-2: hsla(30, 8%, 5%, 1);
--smoky-black-3: hsla(0, 3%, 7%, 1);
--eerie-black-1: hsla(210, 4%, 9%, 1);
--eerie-black-2: hsla(210, 4%, 11%, 1);
--white: hsla(0, 0%, 100%, 1);
--white-alpha-20: hsla(0, 0%, 100%, 0.2);
--black: hsla(0, 0%, 0%, 1);
/* Typography */
--fontFamily-forum: 'Forum', cursive;
--fontFamily-dm_sans: 'DM Sans', sans-serif;
--fontSize-display-1: calc(1.3rem + 6.7vw);
--fontSize-headline-1: calc(2rem + 2.5vw);
--fontSize-headline-2: calc(1.3rem + 2.4vw);
--fontSize-title-1: calc(1.6rem + 1.2vw);
--fontSize-body-1: 2.4rem;
--fontSize-label-1: 1.4rem;
/* Spacing */
--section-space: 70px;
/* Effects */
--shadow-1: 0px 0px 25px 0px hsla(0, 0%, 0%, 0.25);
--radius-24: 24px;
--radius-circle: 50%;
/* Transitions */
--transition-1: 250ms ease;
--transition-2: 500ms ease;
--transition-3: 1000ms ease;
}
/* Usage in components */
.btn-primary {
background-color: var(--gold-crayola);
color: var(--smoky-black-1);
font-family: var(--fontFamily-forum);
transition: var(--transition-1);
}
```
--------------------------------
### Configure Hero Slider
Source: https://context7.com/codewithsadee/grilli/llms.txt
Provides an auto-sliding carousel with manual navigation controls. The auto-slide interval is set to 7 seconds and pauses on button hover.
```javascript
/**
* HERO SLIDER
* Auto-sliding carousel with manual controls
*/
const heroSlider = document.querySelector("[data-hero-slider]");
const heroSliderItems = document.querySelectorAll("[data-hero-slider-item]");
const heroSliderPrevBtn = document.querySelector("[data-prev-btn]");
const heroSliderNextBtn = document.querySelector("[data-next-btn]");
let currentSlidePos = 0;
let lastActiveSliderItem = heroSliderItems[0];
const updateSliderPos = function () {
lastActiveSliderItem.classList.remove("active");
heroSliderItems[currentSlidePos].classList.add("active");
lastActiveSliderItem = heroSliderItems[currentSlidePos];
}
const slideNext = function () {
if (currentSlidePos >= heroSliderItems.length - 1) {
currentSlidePos = 0;
} else {
currentSlidePos++;
}
updateSliderPos();
}
const slidePrev = function () {
if (currentSlidePos <= 0) {
currentSlidePos = heroSliderItems.length - 1;
} else {
currentSlidePos--;
}
updateSliderPos();
}
heroSliderNextBtn.addEventListener("click", slideNext);
heroSliderPrevBtn.addEventListener("click", slidePrev);
/**
* Auto slide - pauses on button hover
*/
let autoSlideInterval;
const autoSlide = function () {
autoSlideInterval = setInterval(function () {
slideNext();
}, 7000); // 7 second interval
}
addEventOnElements([heroSliderNextBtn, heroSliderPrevBtn], "mouseover", function () {
clearInterval(autoSlideInterval);
});
addEventOnElements([heroSliderNextBtn, heroSliderPrevBtn], "mouseout", autoSlide);
window.addEventListener("load", autoSlide);
```
--------------------------------
### Shadow Variable
Source: https://github.com/codewithsadee/grilli/blob/master/style-guide.md
Defines a standard shadow effect used for elements in the Grilli project.
```css
--shadow-1: 0px 0px 25px 0px hsla(0, 0%, 0%, 0.25);
```
--------------------------------
### Apply Parallax Effect
Source: https://context7.com/codewithsadee/grilli/llms.txt
Calculates element movement based on mouse position relative to the viewport. Requires elements with data-parallax-item and data-parallax-speed attributes.
```javascript
/**
* PARALLAX EFFECT
* Elements move based on mouse position
*/
const parallaxItems = document.querySelectorAll("[data-parallax-item]");
let x, y;
window.addEventListener("mousemove", function (event) {
x = (event.clientX / window.innerWidth * 10) - 5;
y = (event.clientY / window.innerHeight * 10) - 5;
// Reverse the values for natural movement
x = x - (x * 2);
y = y - (y * 2);
for (let i = 0, len = parallaxItems.length; i < len; i++) {
x = x * Number(parallaxItems[i].dataset.parallaxSpeed);
y = y * Number(parallaxItems[i].dataset.parallaxSpeed);
parallaxItems[i].style.transform = `translate3d(${x}px, ${y}px, 0px)`;
}
});
// Usage: Add data attributes to elements
//
// data-parallax-speed controls movement intensity (higher = more movement)
```
--------------------------------
### HTML Footer with Newsletter Form
Source: https://context7.com/codewithsadee/grilli/llms.txt
This HTML snippet defines the footer section of the Grilli template, including branding, contact information, navigation links, social media links, and a newsletter subscription form.
```html
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.