diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit deleted file mode 100644 index 2cb1185..0000000 --- a/.git-hooks/pre-commit +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -fileList=$(git diff --staged --name-only :^package-lock.json :^README.md :^client :^server) - -echo '----- Checking Root...' - -if [ ! -z "$fileList" ] -then - echo "error: Unauthorized modifications\n" - - echo "$fileList\n" - - echo "use 'git restore --staged ...' to fix the problem" - echo "(and ask your instructor why you should not change these files)\n" - - exit 1 -fi - -echo '----- Done!' - -npx validate-branch-name -npm run check diff --git a/.github/workflows/deploy-traefik.yml b/.github/workflows/deploy-traefik.yml deleted file mode 100644 index 08ccdf9..0000000 --- a/.github/workflows/deploy-traefik.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: CD-traefik - -on: - push: - branches: - - staging - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Deploy to VPS - uses: appleboy/ssh-action@master - with: - username: ${{ secrets.SSH_USER }} - host: ${{ secrets.SSH_HOST }} - password: ${{ secrets.SSH_PASSWORD }} - script: cd && cd traefik/deploy && bash ./js-project.sh ${{ github.event.repository.owner.name }} ${{ github.event.repository.name }} ${{ vars.PROJECT_NAME }} '${{ toJSON(vars) }}' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 30e0cbd..81f1964 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,12 +19,18 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + - name: Setup known_hosts + run: | + mkdir -p ~/.ssh + echo "${{ secrets.VPS_KNOWN_HOST }}" > ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + - name: Deploy run: | if [ "${{ github.ref }}" = "refs/heads/main" ]; then echo "🚀 Deploying PRODUCTION" - ssh -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "bash /home/ubuntu/deploy-triptogether.sh" + ssh ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "bash /home/ubuntu/deploy-triptogether.sh" else echo "đŸ§Ș Deploying STAGING" - ssh -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "bash /home/ubuntu/deploy-triptogether-staging.sh" + ssh ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "bash /home/ubuntu/deploy-triptogether-staging.sh" fi diff --git a/.github/workflows/remove.yml b/.github/workflows/remove.yml deleted file mode 100644 index 3c99c36..0000000 --- a/.github/workflows/remove.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Remove-from-Traefik - -on: - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Remove from VPS - uses: appleboy/ssh-action@master - with: - username: ${{ secrets.SSH_USER }} - host: ${{ secrets.SSH_HOST }} - password: ${{ secrets.SSH_PASSWORD }} - script: cd && cd traefik/deploy && bash ./remove-project.sh ${{ github.event.repository.name }} diff --git a/client/src/components/Navbar.tsx b/client/src/components/Navbar.tsx index 776d885..bffff1a 100644 --- a/client/src/components/Navbar.tsx +++ b/client/src/components/Navbar.tsx @@ -56,15 +56,11 @@ export default function Navbar() { className="navbar-cta" onClick={navigateToCreateTrip} > - CrĂ©e ton voyage ! + CrĂ©er un voyage )} -
setOpenNavBar(true)} - onMouseLeave={() => setOpenNavBar(false)} - > +
{auth ? (
diff --git a/client/src/pages/Home.tsx b/client/src/pages/Home.tsx index 4e5b4b4..1ea2031 100644 --- a/client/src/pages/Home.tsx +++ b/client/src/pages/Home.tsx @@ -6,20 +6,25 @@ function Home() { const [countTrip, setCountTrip] = useState(null); useEffect(() => { - fetch(`${import.meta.env.VITE_API_URL}/api/trips/count`).then( - async (response) => { + const fetchTripCount = async () => { + try { + const response = await fetch( + `${import.meta.env.VITE_API_URL}/api/trips/count`, + ); + if (!response.ok) { - console.error( - "Backend erreur:", - response.status, - await response.json(), - ); throw new Error(`Erreur ${response.status}`); } + const count = await response.json(); setCountTrip(count); - }, - ); + } catch (error) { + console.error("Erreur rĂ©cupĂ©ration nombre de voyages:", error); + setCountTrip(0); + } + }; + + fetchTripCount(); }, []); return ( @@ -35,10 +40,10 @@ function Home() { prĂ©fĂ©rĂ©es et partagez les dĂ©penses. Tout ça au mĂȘme endroit.

- - Commencer maintenant + + Créer un voyage - + Voir mes voyages
@@ -87,7 +92,7 @@ function Home() { {countTrip !== null ? `${countTrip} voyages ont dĂ©jĂ  Ă©tĂ© créés` - : "0"} + : "—"}
@@ -108,7 +113,6 @@ function Home() { className="feature-icon-img" width="40" height="40" - aria-label="Voyager en groupe" />

Voyager en groupe

@@ -125,7 +129,6 @@ function Home() { className="feature-icon-img" width="40" height="40" - aria-label="Voter pour les destinations" />

Voter pour les destinations

@@ -142,7 +145,6 @@ function Home() { className="feature-icon-img" width="40" height="40" - aria-label="Gérer les dépenses" />

Gérez les dépenses

diff --git a/client/src/pages/styles/CreateTrip.css b/client/src/pages/styles/CreateTrip.css index 8103bd7..c955365 100644 --- a/client/src/pages/styles/CreateTrip.css +++ b/client/src/pages/styles/CreateTrip.css @@ -77,8 +77,11 @@ background-color: #ffffff; padding: 2rem; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); + transition: box-shadow 0.3s ease; +} +.create-trip-form:hover { + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); } - .form-group { display: flex; flex-direction: column; @@ -175,27 +178,20 @@ flex: 1; } -#start-date { - color: #999; -} - -#end-date { - color: #999; +input[type="date"]:not(:placeholder-shown) { + color: var(--black); } .astuces-container { - display: flex; - justify-content: center; - align-items: center; - width: 25vw; - height: 9vh; + width: 100%; + max-width: 480px; background-color: rgba(217, 217, 217, 0.3); border: 1px solid rgba(217, 217, 217, 0.5); border-radius: 8px; padding: 1rem; - margin-top: 2.5rem; + margin-top: 2rem; font-family: var(--body-text); - font-size: 1rem; + font-size: 0.95rem; color: var(--black); text-align: center; } @@ -218,6 +214,8 @@ cursor: pointer; border: none; transition: all 0.2s ease; + flex: 1; + max-width: 200px; } .button-container button[type="submit"] { diff --git a/client/src/pages/styles/Footer.css b/client/src/pages/styles/Footer.css index 0ec262c..aa5ef40 100644 --- a/client/src/pages/styles/Footer.css +++ b/client/src/pages/styles/Footer.css @@ -15,13 +15,15 @@ align-items: center; justify-content: space-between; gap: 20px; - height: 100px; + min-height: 100px; + padding: 20px 0; } .footer-left { display: flex; align-items: center; font-size: 18px; + font-weight: 500; cursor: pointer; } @@ -57,4 +59,4 @@ text-align: center; justify-content: center; } -} +} \ No newline at end of file diff --git a/client/src/pages/styles/Guests.css b/client/src/pages/styles/Guests.css index 9e8ecc8..7cf5364 100644 --- a/client/src/pages/styles/Guests.css +++ b/client/src/pages/styles/Guests.css @@ -117,7 +117,7 @@ li:last-child { color: #b91c1c; } -.btn-primary, +/* .btn-primary, */ .btn-danger, .btn-role { border-radius: 10px; @@ -130,14 +130,14 @@ li:last-child { min-height: 14px; } -.btn-primary { +/* .btn-primary { background-color: var(--primary-button); color: #ffffff; } .btn-primary:hover { background-color: var(--primary-button); -} +} */ .btn-danger { background-color: #b91c1c; @@ -195,7 +195,7 @@ li:last-child { padding: 3px 8px; } - .btn-primary, + .btn-primairy, .btn-danger, .btn-role { padding: 6px 10px; diff --git a/client/src/pages/styles/Home.css b/client/src/pages/styles/Home.css index 27ab155..0fe9e46 100644 --- a/client/src/pages/styles/Home.css +++ b/client/src/pages/styles/Home.css @@ -48,33 +48,35 @@ font-weight: 600; border-radius: 10px; text-decoration: none; - display: inline-block; + display: flex; + align-items: center; + justify-content: center; transition: all 0.3s ease; cursor: pointer; border: 2px solid transparent; - min-width: 394px; + width: 280px; + box-sizing: border-box; } -.btn-primairy { +.btn-primary { background-color: var(--primary-button); color: var(--white); border-color: var(--primary-button); font-size: var(--font-size-M); } -.btn-primairy:hover { - background-color: var(--primary-button); - border-color: var(--primary-button); +.btn-primary:hover { + opacity: 0.9; } -.btn-secondairy { +.btn-secondary { background-color: var(--white); color: var(--primary-button); border-color: var(--primary-button); font-size: var(--font-size-M); } -.btn-secondairy:hover { +.btn-secondary:hover { background-color: #f8f8f8; } @@ -133,9 +135,9 @@ } .features { - display: flex; - justify-content: center; - gap: 3vw; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 32px; margin-top: 48px; } @@ -145,7 +147,6 @@ border-radius: 12px; padding: 32px 24px; transition: all 0.3s ease; - max-width: 400px; } .feature-card:hover { @@ -161,7 +162,7 @@ .feature-card-title { font-size: 1.25rem; font-weight: 700; - margin: 12px 0 12px; + margin: 12px 0; color: var(--black); text-align: left; } @@ -175,7 +176,7 @@ } @media (max-width: 968px) { - .features-grid { + .features { grid-template-columns: repeat(2, 1fr); } } @@ -196,11 +197,12 @@ .btn-cta { width: 100%; + max-width: 320px; + font-size: 0.95rem; } - .features-grid { + .features { grid-template-columns: 1fr; - gap: 24px; } .trips-badge { diff --git a/client/src/pages/styles/Navbar.css b/client/src/pages/styles/Navbar.css index 656975d..9cc83e7 100644 --- a/client/src/pages/styles/Navbar.css +++ b/client/src/pages/styles/Navbar.css @@ -1,49 +1,44 @@ +/* ================= RESET ================= */ + li { list-style: none; + padding: 0; + margin: 0; } + +/* ================= NAVBAR BASE ================= */ + .navbar { width: 100%; background: var(--background); border-bottom: 1px solid #e8e8e8; + position: sticky; + top: 0; z-index: 5000; } .navbar-container { width: 100%; - height: 20vh; + min-height: 80px; display: flex; align-items: center; justify-content: space-between; - padding-left: 2rem; + padding: 0 2rem; + box-sizing: border-box; } +/* ================= LEFT ================= */ + .navbar-left { display: flex; - flex-direction: row; align-items: center; - margin-top: -2rem; gap: 0.75rem; } -.navbar-right { - display: flex; - align-items: center; - margin-right: 4rem; - margin-top: -2rem; - gap: 1rem; -} - -.navbar-center { - flex: 1; - display: flex; - justify-content: center; - margin-left: 8.5rem; - margin-top: -2rem; -} - .navbar-logo { - width: 5rem; - height: 5rem; + width: 4rem; + height: 4rem; + object-fit: contain; } .website-name { @@ -54,78 +49,94 @@ li { white-space: nowrap; } +/* ================= CENTER ================= */ + +.navbar-center { + flex: 1; + display: flex; + justify-content: center; +} + .navbar-page-title { - margin: 0; font-weight: 500; font-family: var(--body-text); font-size: var(--font-size-S); color: #8b8b8b; white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + text-decoration: none; +} + +/* ================= RIGHT ================= */ + +.navbar-right { + display: flex; + align-items: center; + gap: 1rem; } +/* ================= CTA ================= */ + .navbar-cta { - background: #2f5d2f; + background: var(--primary-button); color: #fff; border: none; cursor: pointer; - width: 15vw; - height: 5.5vh; font-weight: 500; font-family: var(--body-text); - font-size: var(--font-size-M); + font-size: var(--font-size-XS); padding: 0.6rem 1.25rem; - border-radius: 0.5rem; - line-height: 1; -} - -.navbar-cta:after { - visibility: hidden; + border-radius: var(--button-radius); + transition: 0.2s ease; + white-space: nowrap; } .navbar-cta:hover { - filter: brightness(0.95); + background: var(--button-hover); } +/* ================= PROFILE ================= */ + .navbar-profile { position: relative; - height: auto; } .navbar-profile-Button { - width: 3.5rem; - height: 3.5rem; + width: 3rem; + height: 3rem; border-radius: 50%; border: none; background-color: rgba(153, 153, 153, 0.35); cursor: pointer; display: grid; - padding: 0; place-items: center; + padding: 0; overflow: hidden; - transition: transform 220ms ease, border-radius 220ms ease; + transition: transform 0.2s ease; +} + +.navbar-profile-Button:hover { + transform: scale(1.05); } .user-icone { - width: 2rem; - height: 2rem; + width: 1.8rem; + height: 1.8rem; object-fit: contain; - display: block; } +/* ================= DROPDOWN ================= */ + .navbar-menu { display: none; position: absolute; top: calc(100% + 0.5rem); right: 0; - min-width: 10rem; + min-width: 180px; background: #fff; border: 1px solid #e8e8e8; border-radius: 0.75rem; padding: 0.5rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); - z-index: 50000; } .navbar-menu.is-open { @@ -133,15 +144,10 @@ li { flex-direction: column; } -.navbar-profile:has(.navbar-menu.is-open) .navbar-profile-Button { - transform: scale(1.2); - border-radius: 1rem; -} - .navbar-username { font-weight: 600; font-family: var(--body-text); - font-size: var(--font-size-S); + font-size: var(--font-size-XS); padding: 0.5rem; border-bottom: 1px solid #e8e8e8; margin-bottom: 0.5rem; @@ -150,22 +156,18 @@ li { .navbar-menu-links { display: flex; flex-direction: column; + gap: 0.25rem; } .navbar-menu-link { display: block; - font-weight: 200; font-family: var(--body-text); - font-size: var(--font-size-S); + font-size: var(--font-size-XS); padding: 0.5rem; border-radius: 0.5rem; text-decoration: none; color: #111; -} - -.navbar-menu-links { - display: flex; - flex-direction: column; + transition: background 0.2s ease; } .navbar-menu-links button { @@ -176,24 +178,23 @@ li { padding: 0.5rem; border-radius: 0.5rem; cursor: pointer; - font-weight: 200; font-family: var(--body-text); - font-size: var(--font-size-S); + font-size: var(--font-size-XS); color: #111; border-top: 1px solid #e8e8e8; margin-top: 0.5rem; - padding-top: 0.5rem; } .navbar-menu-link:hover, .navbar-menu-links button:hover { background: #f3f3f3; } + /* ================= AUTH LINKS ================= */ .navbar-auth-links { display: flex; - gap: 1.5rem; + gap: 1.2rem; align-items: center; } @@ -201,24 +202,64 @@ li { text-decoration: none; font-family: var(--body-text); font-weight: 600; - font-size: 1rem; + font-size: var(--font-size-XS); color: #111; transition: color 0.2s; - white-space: nowrap; } .navbar-auth-link:hover { - color: #2f5d2f; /* Ta couleur verte */ + color: var(--primary-button); } .navbar-auth-register { - background-color: #2f5d2f; /* Ta couleur verte */ + background-color: var(--primary-button); color: white !important; - padding: 0.6rem 1.2rem; - border-radius: 8px; - transition: opacity 0.2s; + padding: 0.5rem 1rem; + border-radius: var(--button-radius); + transition: 0.2s ease; } .navbar-auth-register:hover { - opacity: 0.9; + background-color: var(--button-hover); +} + +/* ================= RESPONSIVE ================= */ + +@media (max-width: 1024px) { + .website-name { + display: none; + } + + .navbar-center { + display: none; + } + + .navbar-cta { + padding: 0.5rem 0.9rem; + font-size: 0.9rem; + } } + +@media (max-width: 768px) { + .navbar-container { + padding: 0 1rem; + } + + .navbar-logo { + width: 3rem; + height: 3rem; + } + + .navbar-cta { + display: none; + /* CTA masqué sur mobile */ + } + + .navbar-auth-links { + gap: 0.8rem; + } + + .navbar-auth-register { + padding: 0.4rem 0.8rem; + } +} \ No newline at end of file diff --git a/package.json b/package.json index 16555d9..31608c1 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { - "name": "p3-remote-vert-triptogether", - "version": "0.0.1", + "name": "triptogether", + "version": "0.1.0", "description": "Ce projet est un monorepo JS, suivant l'architecture React-Express-MySQL telle qu'enseignée à la Wild Code School (v7.2.4) :", - "homepage": "https://github.com/ (hit Enter to use an empty string)/p3-remote-vert-triptogether#readme", + "homepage": "https://github.com/earzalien/triptogether#readme", "bugs": { - "url": "https://github.com/ (hit Enter to use an empty string)/p3-remote-vert-triptogether/issues" + "url": "https://github.com/earzalien/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/ (hit Enter to use an empty string)/p3-remote-vert-triptogether.git" + "url": "git+https://github.com/earzalien/triptogether.git" }, "workspaces": [ "client",