diff --git a/package-lock.json b/package-lock.json index 86cf7e0..7bc96b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "@vue/compiler-sfc": "latest", "@vue/eslint-config-typescript": "latest", "@vue/tsconfig": "^0.4.0", + "autoprefixer": "^10.4.17", "axios": "^1.5.1", "bootstrap": "^5.3.2", "chart.js": "^4.4.0", @@ -2475,6 +2476,43 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "node_modules/autoprefixer": { + "version": "10.4.17", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", + "integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "browserslist": "^4.22.2", + "caniuse-lite": "^1.0.30001578", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", @@ -3908,6 +3946,19 @@ "node": ">= 6" } }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, "node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -5263,6 +5314,15 @@ "node": ">=0.10.0" } }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", diff --git a/package.json b/package.json index 20a0d2e..dd5fb2a 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@vue/compiler-sfc": "latest", "@vue/eslint-config-typescript": "latest", "@vue/tsconfig": "^0.4.0", + "autoprefixer": "^10.4.17", "axios": "^1.5.1", "bootstrap": "^5.3.2", "chart.js": "^4.4.0", diff --git a/resources/assets/images/header/volena-logo.svg b/resources/assets/images/header/volena-logo.svg new file mode 100644 index 0000000..6caa6ed --- /dev/null +++ b/resources/assets/images/header/volena-logo.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/sass/fo/base/_layout.scss b/resources/sass/fo/base/_layout.scss index 2ace54e..9cce088 100644 --- a/resources/sass/fo/base/_layout.scss +++ b/resources/sass/fo/base/_layout.scss @@ -1,10 +1,129 @@ body { - .border-top-curved { - padding-top: 5rem; - border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 99' fill='none'%3E%3Cpath d='M0.5 98.5L0.499996 0.678555C124.136 38.9283 266.621 33.2224 389.5 0.650116L389.5 98.5L0.5 298.5Z' fill='#{urlencodecolor($color-primary)}' stroke='#{urlencodecolor($color-primary)}'/%3E%3C/svg%3E"); - border-image-outset: 1; - border-image-repeat: inherit; - border-image-slice: 160; - border-image-width: 6rem; + display: flex; + min-height: 100lvh; + flex-direction: column; + background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200'%3E%3Cpath d='M10 10h123v123H10z'/%3E%3C/svg%3E" ); + + #search-bar { + transition: opacity 0.7s ease; + + button { + transition: 0.1s ease-out all; + } + + input { + width: 35vw; + min-width: 8rem; + max-width: 20rem; + padding-right: 0; + padding-left: 0; + border-right: 0; + border-left: 0; + opacity: 0; + transition: 0.3s ease all; + + @include media-breakpoint-up(sm) { + width: 25vw; + } + + &::placeholder { + color: $color-white; + } + } + + .collapsing input { + transition: 0.6s ease all; + + &::placeholder { + visibility: hidden; + } + } + + .collapse.show input { + opacity: 1; + transition: 0.6s ease all; + } + } + + // * Used to hide Header bar when menu is oppened + .hide-header-bg { + border-color: transparent; + backdrop-filter: inherit; + + #search-bar { + opacity: 0; + } + } + + > header { + height: $header-height; + border-bottom: #{$color-primary} 0.2rem solid; + backdrop-filter: blur(5px); + pointer-events: none; + transition: border-bottom 0.7s ease; + transition: backdrop-filter 0.7s ease; + + .col { + flex-wrap: wrap; + + @include media-breakpoint-up(sm) { + flex-wrap: nowrap; + } + } + + .pointer-events { + pointer-events: initial; + } + + #main-menu { + top: 0.75rem; + right: 0.75rem; + bottom: inherit; + left: 0.75rem; + height: fit-content; + max-height: 90lvh; + pointer-events: all; + + @include media-breakpoint-up(sm) { + top: 2rem; + right: inherit; + bottom: inherit; + left: 2.75rem; + display: block; + height: auto; + } + + ~ .offcanvas-backdrop { + background-color: $color-primary; + opacity: 0.9; + pointer-events: all; + transition: 0.3s all; + } + + hr { + border: #{$color-primary} calc(0.1875rem / 2) solid; + opacity: 1; + } + } + } + + > main { + flex-grow: 1; + flex-shrink: 0; + background-color: #f00; + } + + > footer { + flex-grow: 0; + flex-shrink: 1; + + .border-top-curved { + padding-top: 5rem; + border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 99' fill='none'%3E%3Cpath d='M0.5 98.5L0.499996 0.678555C124.136 38.9283 266.621 33.2224 389.5 0.650116L389.5 98.5L0.5 298.5Z' fill='#{urlencodecolor($color-primary)}' stroke='#{urlencodecolor($color-primary)}'/%3E%3C/svg%3E"); + border-image-outset: 1; + border-image-repeat: inherit; + border-image-slice: 160; + border-image-width: 6rem; + } } } diff --git a/resources/sass/fo/utilities/_variables.scss b/resources/sass/fo/utilities/_variables.scss index 39ddc39..2f1070e 100644 --- a/resources/sass/fo/utilities/_variables.scss +++ b/resources/sass/fo/utilities/_variables.scss @@ -1,5 +1,8 @@ @use "sass:color"; +// * Layout +$header-height: 6.25rem; + // * COLORS $color-white: #fff; $color-light: #e1dfe2; @@ -23,7 +26,7 @@ $bg-action: $color-primary; // * FONTS COLORS $color-default-titles: $color-primary; -$color-default-texts: $color-dark; +$color-default-texts: $color-primary; // * FONTS $font-default-family-base: "Barlow", sans-serif; // - The default site font family. diff --git a/resources/sass/fo/vendor/_bootstrap.scss b/resources/sass/fo/vendor/_bootstrap.scss index a0c75c6..ac47965 100644 --- a/resources/sass/fo/vendor/_bootstrap.scss +++ b/resources/sass/fo/vendor/_bootstrap.scss @@ -36,6 +36,8 @@ @import "bootstrap/scss/type"; @import "bootstrap/scss/close"; @import "bootstrap/scss/breadcrumb"; +@import "bootstrap/scss/offcanvas"; +@import "bootstrap/scss/card"; // 6. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss` @import "bootstrap/scss/utilities/api"; diff --git a/resources/ts/fo/base/layout.ts b/resources/ts/fo/base/layout.ts new file mode 100644 index 0000000..9b1db57 --- /dev/null +++ b/resources/ts/fo/base/layout.ts @@ -0,0 +1,83 @@ +import { Collapse, Offcanvas } from "bootstrap"; + +// * Menu Bar +document.addEventListener("DOMContentLoaded", function () { + const menuBarBtn = document.getElementById("menu-bar")?.querySelector("button"), + mainMenu = document.getElementById("main-menu"), + header = document.querySelector("body > header") as HTMLElement | null; + + if (menuBarBtn && mainMenu && header) { + const offCanvas = new Offcanvas(mainMenu); + mainMenu.addEventListener("hide.bs.offcanvas", () => { + header.classList.remove("hide-header-bg"); + }); + mainMenu.addEventListener("hidden.bs.offcanvas", () => { + menuBarBtn.ariaExpanded = "false"; + }); + mainMenu.addEventListener("show.bs.offcanvas", () => { + header.classList.add("hide-header-bg"); + }); + mainMenu.addEventListener("shown.bs.offcanvas", () => { + menuBarBtn.ariaExpanded = "true"; + }); + menuBarBtn.addEventListener("click", () => { + if (menuBarBtn.ariaExpanded === "true") { + // Oppened + offCanvas.hide(); + } else { + // Closed + offCanvas.show(); + } + }); + } +}); + +// * Search Bar +document.addEventListener("DOMContentLoaded", function () { + const searchBarBtn = document.getElementById("search-bar")?.querySelector("button"), + inputSearchBoxWrapper = document.getElementById("search-textbox-wrapper"); + const headerMainMenuLogo = document.getElementById("header-main-menu-logo"), + toggleMenuLogoSm = (headerMainMenuLogo: HTMLElement ) => { + setTimeout(() => { + if (searchBarBtn?.ariaExpanded === "true") { + headerMainMenuLogo.classList.add("d-none", "d-sm-inline"); + } else { + headerMainMenuLogo.classList.remove("d-none", "d-sm-inline"); + } + }, 200); + }; + + // * Search bar collapser + if (inputSearchBoxWrapper && searchBarBtn) { + const searchCollapser = new Collapse(inputSearchBoxWrapper, { + toggle: false + }); + inputSearchBoxWrapper.addEventListener("hidden.bs.collapse", () => {searchBarBtn.ariaExpanded = "false";}); + inputSearchBoxWrapper.addEventListener("shown.bs.collapse", () => {searchBarBtn.ariaExpanded = "true";}); + searchBarBtn.addEventListener("click", () => { + if (searchBarBtn.ariaExpanded === "true") { + // Oppened + searchCollapser.hide(); + setTimeout(() => { + searchBarBtn.classList.add("rounded-pill"); + searchBarBtn.classList.remove("rounded-start-pill"); + }, 300); + } else { + // Closed + searchBarBtn.classList.remove("rounded-pill"); + searchBarBtn.classList.add("rounded-start-pill"); + setTimeout(() => { + searchCollapser.show(); + }, 90); + } + }); + } + + // * Logo Hide toggle on SM + if (searchBarBtn && headerMainMenuLogo) { + toggleMenuLogoSm(headerMainMenuLogo); + searchBarBtn.addEventListener("click", () => { + toggleMenuLogoSm(headerMainMenuLogo); + }); + } +}); diff --git a/resources/ts/fo/fo.ts b/resources/ts/fo/fo.ts index bdbe2fa..42a1497 100644 --- a/resources/ts/fo/fo.ts +++ b/resources/ts/fo/fo.ts @@ -9,3 +9,5 @@ import "./utilities/vue-fo"; // CUSTOM import "./base/common"; +import "./base/layout"; + diff --git a/resources/ts/fo/utilities/fontawesome.ts b/resources/ts/fo/utilities/fontawesome.ts index ac0d8d3..1d9cf7d 100644 --- a/resources/ts/fo/utilities/fontawesome.ts +++ b/resources/ts/fo/utilities/fontawesome.ts @@ -5,6 +5,7 @@ import { faCircleInfo, faCirclePlay, faCircleXmark, + faMagnifyingGlass, faQuestionCircle } from "@fortawesome/free-solid-svg-icons"; @@ -15,5 +16,6 @@ library.add(faCircleExclamation); library.add(faCircleInfo); library.add(faCirclePlay); library.add(faQuestionCircle); +library.add(faMagnifyingGlass); dom.watch(); diff --git a/resources/views/fo/layout.blade.php b/resources/views/fo/layout.blade.php index 3eb2ccb..30afa36 100644 --- a/resources/views/fo/layout.blade.php +++ b/resources/views/fo/layout.blade.php @@ -6,7 +6,7 @@ -
+
@include('fo.layouts.header')
diff --git a/resources/views/fo/layouts/footer.blade.php b/resources/views/fo/layouts/footer.blade.php index 2426fb7..6d72b85 100644 --- a/resources/views/fo/layouts/footer.blade.php +++ b/resources/views/fo/layouts/footer.blade.php @@ -2,7 +2,8 @@
- {{ __('Volena - Vollailers Engagés pour l\'Avenir') }}
diff --git a/resources/views/fo/layouts/header.blade.php b/resources/views/fo/layouts/header.blade.php index 0951d55..c33fffc 100644 --- a/resources/views/fo/layouts/header.blade.php +++ b/resources/views/fo/layouts/header.blade.php @@ -1 +1,12 @@ {{-- This should be bg transparent ! --}} +
+
+ + +
+
+@include('fo.layouts.nav-menu') diff --git a/resources/views/fo/layouts/main-menu-toggle.blade.php b/resources/views/fo/layouts/main-menu-toggle.blade.php new file mode 100644 index 0000000..f4a7d97 --- /dev/null +++ b/resources/views/fo/layouts/main-menu-toggle.blade.php @@ -0,0 +1,7 @@ +
+ + +
diff --git a/resources/views/fo/layouts/nav-menu.blade.php b/resources/views/fo/layouts/nav-menu.blade.php index 56bf824..9b76e71 100644 --- a/resources/views/fo/layouts/nav-menu.blade.php +++ b/resources/views/fo/layouts/nav-menu.blade.php @@ -1,12 +1,90 @@ -@auth('backend') - -@endauth + diff --git a/resources/views/fo/layouts/search.blade.php b/resources/views/fo/layouts/search.blade.php new file mode 100644 index 0000000..6b31eae --- /dev/null +++ b/resources/views/fo/layouts/search.blade.php @@ -0,0 +1,15 @@ +
+
+ +
+ + +
+
+
diff --git a/resources/views/fo/pages/home.blade.php b/resources/views/fo/pages/home.blade.php index 88193a7..63ca44c 100644 --- a/resources/views/fo/pages/home.blade.php +++ b/resources/views/fo/pages/home.blade.php @@ -8,7 +8,119 @@
-

{{ __('Hello world !') }}

+

+ {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} + {{ __('Hello world !') }} +

diff --git a/vite.config.ts b/vite.config.ts index 9be3ac6..ccc036c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,6 @@ import basicSsl from "@vitejs/plugin-basic-ssl"; import vue from "@vitejs/plugin-vue"; +import autoprefixer from "autoprefixer"; import laravel from "laravel-vite-plugin"; import path from "path"; import postcssDiscard from "postcss-discard-comments"; @@ -52,6 +53,7 @@ export default defineConfig({ postcssDiscard({ removeAll: true, }), + autoprefixer(), ], }, }, @@ -133,11 +135,7 @@ export default defineConfig({ failOnWarning: false, failOnError: false, }), - babel({ - babelConfig: { - targets: "last 3 version, not dead, >0.3%" - } - }), + babel(), vue({ isProduction: process.env.NODE_ENV !== "local" ? true : false, exclude: ["node_modules", "vendor"],