### Installation and Development Commands Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Commands for cloning the repository, installing dependencies, and managing Tailwind CSS build processes. ```bash # Clone the repository git clone https://github.com/PaulleDemon/landing-pages.git cd landing-pages # Install dependencies (use .package.json for minimal install) npm install # Or install from .package.json for minimal dev dependencies npm install --package-lock-only .package.json # Start Tailwind in development mode (watches for changes) npm run start:tailwind # Build Tailwind for production (minified) npm run build:tailwind ``` -------------------------------- ### Start Tailwind CSS Development Server Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/law/lawgroup/readme.md Run this npm command in your terminal to start the Tailwind CSS development server. This command is used during the development phase. ```bash npm run start:tailwind ``` -------------------------------- ### Tailwind CSS Configuration Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/readme.md Configure Tailwind CSS by defining prefixes, content sources, and theme extensions. Ensure Node.js is installed for modifications. ```javascript module.exports = { prefix: 'tw-', important: false, content: [ "./**/*.{html, jsx, js}", ], theme: { extend: {}, }, plugins: [], } ``` -------------------------------- ### PostCSS Configuration for Tailwind Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/readme.md Set up PostCSS with plugins like postcss-import, postcss-simple-vars, and postcss-nested for enhanced CSS processing with Tailwind. ```javascript module.exports = { plugins: { "postcss-import": {}, "postcss-simple-vars": {}, "postcss-nested": {} }, } ``` -------------------------------- ### Build Tailwind CSS for Production Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/law/lawgroup/readme.md Execute this npm command to generate a production-ready build file for Tailwind CSS. This command is used when preparing the project for deployment. ```bash npm run build:tailwind ``` -------------------------------- ### Initialize Review Swiper Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/saas/finance/index.html JavaScript configuration for the Swiper instance used in the review section. ```javascript const reviewSwiper = new Swiper('.review-container', { //effect: "coverflow", // grabCursor: true, loop: true, centeredSlides: true, slidesPerView: 'auto', autoplay: { delay: 7000, }, pagination: { el: '.dots-container', clickable: true, renderBullet: function (index, className) { return `` }, }, }) ``` -------------------------------- ### Initialize Swiper Slider Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/law/lawfire/index.html JavaScript configuration to initialize a Swiper instance with pagination and navigation settings. ```javascript const swiper = new Swiper('.swiper', { // Optional parameters direction: 'horizontal', loop: true, centeredSlides: true, // If we need pagination pagination: { el: '.pagination-container', clickable: true, renderBullet: function (index, className) { return `` }, }, // Navigation arrows navigation: { nextEl: '.testmonial-next', prevEl: '.testmonial-prev', }, }) ``` -------------------------------- ### Configure Swiper Slider and Pagination Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/apps/AISales/index.html Styles the pagination bullets and initializes the Swiper instance with navigation and custom pagination rendering. ```css .swiper-pagination-bullet { width: 10px; height: 10px; text-align: center; /* font-size: 12px; */ opacity: 1; background: #f7f7f7fa; left: auto; } .swiper-pagination-bullet:hover { color: #000; opacity: 1; background: #ede0e0bd; } .swiper-pagination-bullet-active { background: #f39696 !important; } .swiper { padding: 10px !important; } ``` ```javascript const swiper = new Swiper('.swiper', { // Optional parameters direction: 'horizontal', loop: true, centeredSlides: true, // If we need pagination pagination: { el: '.pagination-container', clickable: true, renderBullet: function (index, className) { return `` }, }, // Navigation arrows navigation: { nextEl: '.testmonial-next', prevEl: '.testmonial-prev', }, }) ``` -------------------------------- ### PostCSS Configuration Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Configuration for PostCSS plugins including import, variable, and nesting support. ```javascript // postcss.config.js module.exports = { plugins: { "postcss-import": {}, "postcss-simple-vars": {}, "postcss-nested": {} }, } ``` -------------------------------- ### Initialize Swiper Carousel Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Configures the Swiper instance with autoplay and custom pagination bullet rendering. ```javascript // Initialize Swiper const reviewSwiper = new Swiper('.review-container', { loop: true, centeredSlides: true, slidesPerView: 'auto', autoplay: { delay: 7000, }, pagination: { el: '.dots-container', clickable: true, renderBullet: function (index, className) { return `` }, }, }) ``` -------------------------------- ### Retrieve user data using Python Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/portfolio/notion/content/about.md Uses the universe module to fetch and display data for a specific user. ```py from universe import earth show(earth.get("paul")) ``` -------------------------------- ### Include Tailwind CSS Build for Production Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/law/lawgroup/readme.md Use this link tag in your head section for production builds to include the optimized Tailwind CSS file. Ensure 'tailwind-build.css' points to the correct path. ```html ``` -------------------------------- ### CSS Variables and Global Styles Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Base styles and CSS custom properties used for theming and responsive layout components. ```css /* css/index.css */ @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'); :root { --btn-color: #fdfdfd; /* Button text color */ --btn-bg: #101010; /* Button background */ --primary-text-color: #1d1b1b; } html { scroll-behavior: smooth; font-family: "Roboto", sans-serif; } .btn { padding: 10px 15px; width: max-content; border-radius: 10px; color: var(--btn-color); background-color: var(--btn-bg); justify-content: center; align-items: center; display: flex; cursor: pointer; } .input { padding: 10px; background-color: transparent; border-radius: 10px; min-width: 100px; border: 2px solid #818080; transition: border 0.3s; } .input:active, .input:focus, .input:focus-within { border: 2px solid #0c0c0c; } /* Collapsible mobile header */ @media not all and (min-width: 1024px) { header .collapsible-header { position: fixed; right: 0px; flex-direction: column; opacity: 0; height: 100vh; width: 0vw; background-color: #ffffff; overflow-y: auto; transition: width 0.3s ease; } } ``` -------------------------------- ### Run Tailwind CSS Commands Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/ngo/project-africa/readme.md Use these npm scripts to manage Tailwind CSS during development or for production builds. ```bash npm run start:tailwind ``` ```bash npm run build:tailwind ``` -------------------------------- ### Implement Dark Mode Toggle Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Uses localStorage to persist theme preference and toggles the 'tw-dark' class on the document root. ```javascript // Dark mode toggle with localStorage if (localStorage.getItem('color-mode') === 'dark' || (!('color-mode' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { document.documentElement.classList.add('tw-dark') updateToggleModeBtn() } else { document.documentElement.classList.remove('tw-dark') updateToggleModeBtn() } function toggleMode() { document.documentElement.classList.toggle("tw-dark") updateToggleModeBtn() } function updateToggleModeBtn() { const toggleIcon = document.querySelector("#toggle-mode-icon") if (document.documentElement.classList.contains("tw-dark")) { toggleIcon.classList.remove("bi-sun-fill") toggleIcon.classList.add("bi-moon-fill") localStorage.setItem("color-mode", "dark") } else { toggleIcon.classList.add("bi-sun-fill") toggleIcon.classList.remove("bi-moon-fill") localStorage.setItem("color-mode", "light") } } ``` ```html ``` -------------------------------- ### Include Tailwind CSS for Production Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/saas/pixaai/readme.md Use this link in your head tag for production builds to include the optimized Tailwind CSS. ```html ``` -------------------------------- ### Tailwind CSS Configuration Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Configuration file for customizing theme colors and setting the 'tw-' prefix to prevent CSS conflicts. ```javascript // tailwind.config.js /** @type {import('tailwindcss').Config} */ module.exports = { prefix: 'tw-', important: false, content: [ "**/*.{html,jsx,js}", "**/*.js", "**/*.html", ], darkMode: 'class', theme: { extend: { colors: { primary: '#7e22ce', // Customize primary color secondary: '#ed7a36', // Customize secondary color } }, }, plugins: [], } ``` -------------------------------- ### Implement Responsive Header Toggle Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Handles mobile menu toggling and click-outside-to-close functionality. Requires elements with IDs 'collapse-btn' and 'collapsed-header-items'. ```javascript // index.js - Responsive header toggle const RESPONSIVE_WIDTH = 1024 let isHeaderCollapsed = window.innerWidth < RESPONSIVE_WIDTH const collapseBtn = document.getElementById("collapse-btn") const collapseHeaderItems = document.getElementById("collapsed-header-items") function onHeaderClickOutside(e) { if (!collapseHeaderItems.contains(e.target)) { toggleHeader() } } function toggleHeader() { if (isHeaderCollapsed) { collapseHeaderItems.classList.add("opacity-100") collapseHeaderItems.style.width = "60vw" collapseBtn.classList.remove("bi-list") collapseBtn.classList.add("bi-x", "max-lg:tw-fixed") isHeaderCollapsed = false setTimeout(() => window.addEventListener("click", onHeaderClickOutside), 1) } else { collapseHeaderItems.classList.remove("opacity-100") collapseHeaderItems.style.width = "0vw" collapseBtn.classList.remove("bi-x", "max-lg:tw-fixed") collapseBtn.classList.add("bi-list") isHeaderCollapsed = true window.removeEventListener("click", onHeaderClickOutside) } } function responsive() { if (window.innerWidth > RESPONSIVE_WIDTH) { collapseHeaderItems.style.width = "" } else { isHeaderCollapsed = true } } window.addEventListener("resize", responsive) ``` -------------------------------- ### Template Directory Structure Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt The project organizes templates by category under the src directory. ```text src/ ├── apps/ # Mobile app landing pages ├── saas/ # SaaS product pages ├── portfolio/ # Personal portfolio sites ├── restaurant/ # Restaurant websites ├── law/ # Attorney/law firm pages ├── ngo/ # Non-profit organization pages ├── realestate/ # Real estate landing pages ├── others/ # Miscellaneous templates └── products/ # Product showcase pages ``` -------------------------------- ### Implement FAQ Accordion Functionality Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Toggles visibility of FAQ content by modifying max-height and padding styles. ```javascript // FAQ accordion functionality const faqAccordion = document.querySelectorAll('.faq-accordion') faqAccordion.forEach(function (btn) { btn.addEventListener('click', function () { this.classList.toggle('active') let content = this.nextElementSibling if (content.style.maxHeight === '200px') { content.style.maxHeight = '0px' content.style.padding = '0px 18px' } else { content.style.maxHeight = '200px' content.style.padding = '20px 18px' } }) }) ``` -------------------------------- ### Include Tailwind CSS Runtime for Development Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/law/lawgroup/readme.md Add this link tag to your head section during development to include the Tailwind CSS runtime. Replace 'tailwind-runtime.css' with the actual path to your file. ```html ``` -------------------------------- ### Configure Landing Page Data Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/src/portfolio/notion/readme.md Modify the data.json file to customize your landing page content, including name, icon, and page links. ```json { "name": "Paul's portfolio", "icon": "./assets/images/home/paul.png", "pages": [ { "icon": "./assets/images/home/paul.png", // icon can be image, a bootstrap icon class or an emoji "name": "About", "link": "/about", "content": "content/about.md" // this has to be a path to your md or your html content }, { "icon": "📖", "name": "Blogs", "link": "/blogs", "content": "content/about.md" }, { "icon": "bi bi-suitcase-lg-fill", "name": "Work Experience", "link": "/experience", "content": "content/projects.html" }, ] } ``` -------------------------------- ### Base Tailwind CSS File Source: https://github.com/paulledemon/awesome-landing-pages/blob/main/readme.md Initialize Tailwind CSS by including base, components, and utilities directives. Custom styles can be added within the @layer components block. ```css @tailwind base; @tailwind components; @tailwind utilities; @layer components{ } ``` -------------------------------- ### Implement Swiper Carousel for Testimonials Source: https://context7.com/paulledemon/awesome-landing-pages/llms.txt Requires Swiper.js CSS and JS files. The container uses specific classes for layout and pagination. ```html