Skip to main content

Posts

Showing posts from December, 2024

Vite config js

 // vite.config.js import { defineConfig } from "vite"; import { resolve } from "path"; export default defineConfig({   build: {     rollupOptions: {       input: {         main: resolve(__dirname, "index.html"), // Your main entry point (e.g., home page)         about: resolve(__dirname, "about.html"), // Additional HTML pages         contact: resolve(__dirname, "contact.html"),         products: resolve(__dirname, "products.html"),         addToCart: resolve(__dirname, "addToCart.html"),         // Add more entry points for other HTML files as needed       },     },   }, });

Uploud cart value js

 const cartValue = document.querySelector("#cartValue"); export const updateCartValue = (cartProducts) => {   return (cartValue.innerHTML = ` <i class="fa-solid fa-cart-shopping"> ${cartProducts.length} </i>`); };

Uploud cart product totale js

 import { getCartProductFromLS } from "./getCartProducts"; export const updateCartProductTotal = () => {   let productSubTotal = document.querySelector(".productSubTotal");   let productFinalTotal = document.querySelector(".productFinalTotal");   let localCartProducts = getCartProductFromLS();   let initialValue = 0;   let totalProductPrice = localCartProducts.reduce((accum, curElem) => {     let productPrice = parseInt(curElem.price) || 0;     return accum + productPrice;   }, initialValue);   //   console.log(totalProductPrice);   productSubTotal.textContent = `₹${totalProductPrice}`;   productFinalTotal.textContent = `₹${totalProductPrice + 50}`; };

Style. Css

 * {   margin: 0;   padding: 0;   box-sizing: border-box; } :root {   font-family: "Urbanist", sans-serif;   line-height: 1.5;   font-weight: 400;   font-synthesis: none;   text-rendering: optimizeLegibility;   -webkit-font-smoothing: antialiased;   -moz-osx-font-smoothing: grayscale;   --buttonColor: #2a2c30;   --secondaryColor: #4b4f56;   --borderColor: #e3eaf0;   --backgroundColor: #f7f7f7;   --backgroundSecondary: #fefefe;   --textColor: #1e1f23;   --anchorColor: #535bf2;   --main-color: #535bf2;   --supporting-color: #ebf3fe;   --glow-color: hsl(186, 91%, 4%); } html {   font-size: 62.5%;   color: var(--textColor); } /* have a look into body once after we done with rest of the styling  */ body {   margin: 0 auto;   padding: 0 32px;   min-width: 320px;   background-color: var(--backgroundColor); } h1, h2, h3, h4, h5, h6 {   line-height: 1.1...

Setup md

  Skip to content Navigation Menu Sign in thaa technical / jsecom_youtube Public Notifications Fork  22  Star  42 Code Issues Pull requests 1 Actions Projects Security Insights  master Breadcrumbs jsecom_youtube / steps.md Latest commit thapatechnical eocmmerce website by thapa technical 5320b4a  ·  9 months ago History 351 lines (204 loc) · 13.1 KB File metadata and controls Preview Code Blame Raw ====================================================================  _ Building an Ecommerce Website with Vanilla JavaScript _ _ Folder structure _ my-vanilla-js-project/ ├── public/ │ ├── images/ │ │ ├── logo.png │ │ └── background.jpg │ └── index.html ├── src/ │ ├── index.html │ ├── main.js │ ├── utils.js │ └── styles.css ├── vite.config.js └── package.json _ or we can also use _ my-vanilla-js-project/ ├── public/ │ ├── images/ │ │ ├── logo.png │ │ └── background.jpg │ └── index.html ├── index.html ├── main.js ├── styles.css ├── vite.config.js └── pa...