]> _ Git - miranui.git/commitdiff
wait #7515 @0h22
authorsoufiane <soufiane@cubedesigners.com>
Mon, 5 May 2025 15:17:18 +0000 (17:17 +0200)
committersoufiane <soufiane@cubedesigners.com>
Mon, 5 May 2025 15:17:18 +0000 (17:17 +0200)
wp-content/themes/miranui_new/package.json [new file with mode: 0644]
wp-content/themes/miranui_new/resources/js/app.js [new file with mode: 0644]

diff --git a/wp-content/themes/miranui_new/package.json b/wp-content/themes/miranui_new/package.json
new file mode 100644 (file)
index 0000000..a5eb656
--- /dev/null
@@ -0,0 +1,30 @@
+{
+  "name": "sage",
+  "private": true,
+  "engines": {
+    "node": ">=20.0.0"
+  },
+  "scripts": {
+    "dev": "vite",
+    "build": "vite build",
+    "mix": "webpack --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
+    "translate": "npm run translate:pot && npm run translate:update",
+    "translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"theme.json,patterns,app,resources\"",
+    "translate:update": "for file in ./resources/lang/*.po; do wp i18n update-po ./resources/lang/sage.pot $file; done",
+    "translate:compile": "npm run translate:mo && npm run translate:js",
+    "translate:js": "wp i18n make-json ./resources/lang --pretty-print",
+    "translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
+  },
+  "devDependencies": {
+    "@roots/bud-postcss": "^6.24.0",
+    "@roots/bud-tailwindcss": "^6.24.0",
+    "@roots/vite-plugin": "^1.0.2",
+    "@tailwindcss/vite": "^4.0.9",
+    "autoprefixer": "^10.4.21",
+    "laravel-mix": "^6.0.49",
+    "laravel-vite-plugin": "^1.2.0",
+    "postcss": "^8.5.3",
+    "tailwindcss": "^4.1.4",
+    "vite": "^6.2.0"
+  }
+}
diff --git a/wp-content/themes/miranui_new/resources/js/app.js b/wp-content/themes/miranui_new/resources/js/app.js
new file mode 100644 (file)
index 0000000..172bf0b
--- /dev/null
@@ -0,0 +1,84 @@
+import AOS from 'aos';
+import 'aos/dist/aos.css';
+import { CountUp } from 'countup.js';
+
+import '@splidejs/splide/css/core';
+import Splide from '@splidejs/splide';
+import { AutoScroll } from '@splidejs/splide-extension-auto-scroll';
+
+document.addEventListener("DOMContentLoaded", () => {
+  AOS.init({
+    offset: 5,
+    mirror: false
+  });
+
+  let sectionStat = document.querySelector(".elementor-widget-cube-statistics"),
+      hasAnimated = false
+
+  window.addEventListener("scroll", function() {
+    // Header
+    if(window.scrollY >= 50) {
+      document.getElementById("app").classList.add("clear","scrolling")
+    }else {
+      document.getElementById("app").classList.remove("clear","scrolling")
+    }
+
+
+    // Section chiffre
+    let sectionStatTop = sectionStat.getBoundingClientRect().top
+
+    if (!hasAnimated && (window.scrollY + window.innerHeight) >= (window.scrollY + sectionStatTop)) {
+      hasAnimated = true
+
+      document.querySelectorAll('[id^="stat-"]').forEach((e) => {
+        var num = parseFloat(e.innerText.replace(',', '.'))
+        var numAnim = new CountUp(e, num, {
+          decimalPlaces: Number(num) === num && num % 1 !== 0 ? 1 : 0,
+          decimal: ","
+        })
+        if (!numAnim.error) {
+          numAnim.start()
+        } else {
+          console.error(numAnim.error)
+        }
+      })
+    }
+  })
+
+  const el = document.getElementById("toggleMenu")
+  el.addEventListener("click", () => {
+    document.querySelector("nav").classList.toggle("active");
+    el.classList.toggle("open");
+  });
+
+  document.querySelectorAll('.menu-item').forEach((e) => {
+    e.addEventListener("click", () => {
+      document.querySelector("nav").classList.remove("active")
+      el.classList.remove("open");
+    })
+  })
+
+  //
+  new Splide( '.splide', {
+    drag: false,
+    autoWidth: true,
+    type: 'loop',
+    gap: 39,
+    pagination: false,
+    arrows: false,
+    autoScroll: {
+      speed: 1,
+    },
+    mediaQuery: 'min',
+    breakpoints: {
+      992: {
+        destroy: true,
+      },
+    }
+  } ).mount({ AutoScroll });
+})
+
+import.meta.glob([
+  '../images/**',
+  '../fonts/**',
+]);