From 2cb4696ca3ab84281260f7538f8cbe39c7816c3c Mon Sep 17 00:00:00 2001 From: ImAlpha Date: Tue, 14 Nov 2023 00:56:47 -0800 Subject: [PATCH] added color change to navbar --- .DS_Store | Bin 0 -> 6148 bytes Websites/.DS_Store | Bin 0 -> 6148 bytes Websites/UnusedPages/.DS_Store | Bin 0 -> 6148 bytes Websites/UnusedPages/AddToCart.tsx | 2 +- .../UnusedPages/ProductCard/ProductCard.tsx | 34 +++--- Websites/UnusedPages/api/.DS_Store | Bin 0 -> 6148 bytes Websites/UnusedPages/api/issues/route.ts | 27 +++++ Websites/UnusedPages/issues/new/page.tsx | 102 +++++++++--------- Websites/UnusedPages/issues/page.tsx | 38 +++---- Websites/UnusedPages/prisma/client.ts | 19 ++++ .../20231021063954_create_issue/migration.sql | 0 .../prisma/migrations/migration_lock.toml | 0 .../prisma/schema.prisma | 0 Websites/UnusedPages/prisma/scripts.txt | 3 + .../prisma/seed.ts | 0 Websites/UnusedPages/users/nested/page.tsx | 14 +-- Websites/UnusedPages/users/page.tsx | 90 ++++++++-------- Websites/jefes-nextjs/app/api/issues/route.ts | 27 ----- .../app/components/NavBar/NavBar.css | 25 +++-- .../app/components/NavBar/NavBar.tsx | 24 ++++- .../jefes-nextjs/app/menu/Appetizers/page.tsx | 4 +- Websites/jefes-nextjs/app/menu/layout.tsx | 7 +- Websites/jefes-nextjs/app/menu/page.tsx | 7 +- Websites/jefes-nextjs/app/page.tsx | 29 ++--- Websites/jefes-nextjs/app/reviews/page.tsx | 15 ++- Websites/jefes-nextjs/bun.lockb | Bin 163815 -> 162180 bytes Websites/jefes-nextjs/package-lock.json | 48 --------- Websites/jefes-nextjs/package.json | 5 - Websites/jefes-nextjs/prisma/client.ts | 19 ---- 29 files changed, 261 insertions(+), 278 deletions(-) create mode 100644 .DS_Store create mode 100644 Websites/.DS_Store create mode 100644 Websites/UnusedPages/.DS_Store create mode 100644 Websites/UnusedPages/api/.DS_Store create mode 100644 Websites/UnusedPages/api/issues/route.ts create mode 100644 Websites/UnusedPages/prisma/client.ts rename Websites/{jefes-nextjs => UnusedPages}/prisma/migrations/20231021063954_create_issue/migration.sql (100%) rename Websites/{jefes-nextjs => UnusedPages}/prisma/migrations/migration_lock.toml (100%) rename Websites/{jefes-nextjs => UnusedPages}/prisma/schema.prisma (100%) create mode 100644 Websites/UnusedPages/prisma/scripts.txt rename Websites/{jefes-nextjs => UnusedPages}/prisma/seed.ts (100%) delete mode 100644 Websites/jefes-nextjs/app/api/issues/route.ts delete mode 100644 Websites/jefes-nextjs/prisma/client.ts diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2523093b7acaac8ec6ce9ccfe3078bd5617a059f GIT binary patch literal 6148 zcmeHK%}T>S5T0$TO({wb3LXPqi`HKhFR|*un;5YNmD<=~gE3p0)FP#jvp$ShpTyVE zncb}@QM_r98JPWMXJ>Y^UzYs=08#I^R{$yiV4)J`N?3d$)J~d_obeP8h3Z2>1Wj<^ z3VNAnc1$7z^zUZj2<{<)4t)H70d&z9ABOVE3#Er~v`BVQmtK{iMGK<=K6nsAfYE*? z{^_T9ZxDA)|Ic1G4C16#dl9*OVQRW)6|J&$;dbP}Oi>U0q1@gdB}!n{y~8Xfz$RX7MoBbUqoGw_*#yslR0{6F~q{r@?M zYs>&M@UIvUg?)Fwj#DycYi4qE*4n6-s3a7ZYJ5*YLmkB!OGohnsuJ|uWFR^QQ;q0B P;fsKxfeU8fR~dK%bJl3T literal 0 HcmV?d00001 diff --git a/Websites/.DS_Store b/Websites/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f398b6eafde3a2546d8c2c2fbf87d1fd037afab1 GIT binary patch literal 6148 zcmeHK&ui2`6n?Ya+H6-L2ZdgQfY++4)l%^iV-;Eu#Q5W&vL+_Bu`yFNSyxyVa&G?^ zul-B>UwUf4H!};}Yztl#EA!yZH<@|g%;XF6CPPFb7$*0KTq1JdjO}F<=NR|1&soc~ zaHmjXydX&lr8J;oF4{I&1*`)9ngYCcmnonKJ9dxG?BA_ievWe)qo0$*6ZoAIWvCG? z(zfCx^t=)I^PI?(z91`l2UO) z-QjecPTyS_kJmPOtKNf$8UuVl{FxtHU!)`Ne7vvFLlQBhEs i<5*SrC|-dpL!ZYLpl`6&h!&Xr5l}MN!Yc4r6*vW~5}@S( literal 0 HcmV?d00001 diff --git a/Websites/UnusedPages/.DS_Store b/Websites/UnusedPages/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9768a19442b3fcf7f6e6bb309fce3e25573b5f38 GIT binary patch literal 6148 zcmeHKL2uJA6n<{IE~T2(14z3}io|sqg#p^cCF{n48zK`N0F|VvAR>#aIH5>YrJTo) z;mR-Jzi@)@*`Cz2`>6a|^{a#{KLY*0L=< zpwMGTI;DsTD(PT@?HZf{PJw?-0e*LP=!6n{&S~}iElJVmXPKPDnT)~WE#d@z@KYNi zqBh?48Kq5D>;3htc&=u4tZ(rwOI0}>eiyBFXREvIZF_z1ZTLaX!!jx>HHwPYTsxOC zi?8A+ewj|^D zj+XoW;`jl_hmV)bo_FW&y(cfmAG3>GUg}kmz;32($Kn-yL15RMs7V%McHCu~K7~b| z$()zZ19T~cgo-Mfl4?psU(vrRWEV0Pntwr2lPmVtxP5vKuEZBs(F9wq*>aP$ES~D> z6Slxsm`Sld7x80_iK?@kpn(0Ad;OcRShq%}fK%X)6yW{AhcgBiYlC|0K%uVyzz&+V zA?7~{oa0*zEY=3m0~00{Xi|l}VhEFtcHi;>i?uClMHQ zrBlEu&{Uvpssld%pZ@;--%N5fr+`!7zfwSS&cd@1mSoS?jm7a<>%-r{*_c-w)F~+J iajXMAig)4K(C2di3@p|L(E@XS1hfpUa0>iY1%3hC5t&;6 literal 0 HcmV?d00001 diff --git a/Websites/UnusedPages/AddToCart.tsx b/Websites/UnusedPages/AddToCart.tsx index 4331614..1efc4f6 100644 --- a/Websites/UnusedPages/AddToCart.tsx +++ b/Websites/UnusedPages/AddToCart.tsx @@ -1,5 +1,5 @@ "use client"; -import React from 'react' +// import React from 'react' const AddToCart = () => { return ( diff --git a/Websites/UnusedPages/ProductCard/ProductCard.tsx b/Websites/UnusedPages/ProductCard/ProductCard.tsx index f489d32..5fa544d 100644 --- a/Websites/UnusedPages/ProductCard/ProductCard.tsx +++ b/Websites/UnusedPages/ProductCard/ProductCard.tsx @@ -1,21 +1,21 @@ -import React from 'react'; -import AddToCart from '../AddToCart'; -// import styles from './ProductCard.module.css'; +// import React from 'react'; +// import AddToCart from '../AddToCart'; +// // import styles from './ProductCard.module.css'; -const ProductCard = () => { - return ( - //
style using css file +// const ProductCard = () => { +// return ( +// //
style using css file - // style using tailwind - //
- // - //
+// // style using tailwind +// //
+// // +// //
- // style using daisyUi component instead -
- -
- ) -} +// // style using daisyUi component instead +//
+// +//
+// ) +// } -export default ProductCard \ No newline at end of file +// export default ProductCard \ No newline at end of file diff --git a/Websites/UnusedPages/api/.DS_Store b/Websites/UnusedPages/api/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..076fb1a9d983bfbe9e0d69d15cf9575aecccc21a GIT binary patch literal 6148 zcmeHK%}T>S5Z-NTn^J@v6nYGJEm*Be#Y>3w1&ruHr6we3FlI}Wm_sS#tS{t~_&m<+ zZVthKHxWBicE8#A+0A^={b7u8Cl3x7GZ|wBG(?U{gP^(5)zZO;T+R`))GyM79}B-> zqQ7XuZ||~*rSQvH{rf-sMI5Esc>Kv*?ao%WXY`DLaqm8f!p*!aPaSW0i=!(cV!zTo z|2hhbxw&&LlFW;ea48d_AcT;+nJpV7?FVpzQ zucy$67$64z83VjCb7u||rO(!H<>6UtL3@CPf^j7(AfVSS0WiRQWGJ1=Z=nuxw#HH+ U&VqKC4oDXPNeFesz%MZH1^*RHUH||9 literal 0 HcmV?d00001 diff --git a/Websites/UnusedPages/api/issues/route.ts b/Websites/UnusedPages/api/issues/route.ts new file mode 100644 index 0000000..9783bcc --- /dev/null +++ b/Websites/UnusedPages/api/issues/route.ts @@ -0,0 +1,27 @@ +// import { NextRequest, NextResponse } from "next/server"; +// import { z } from 'zod'; +// import prisma from "@/prisma/client"; + +// // validate the request with zod +// const createIssueSchema = z.object({ +// title: z.string().min(1).max(255), // confirms string is between 1-255 characters +// description: z.string().min(1), // confirms string has min length of 1 +// }); + +// // send request +// export async function POST(request: NextRequest) { +// // return request with a promise +// const body = await request.json(); + +// // validate the data +// const validation = createIssueSchema.safeParse(body); +// if (!validation.success) +// return NextResponse.json(validation.error.errors, {status: 400}) // Send error 400 if data is invalid + +// const newIssue = await prisma.issue.create({ +// data: { title: body.title, description: body.description } +// }); + +// // return the issue to the client +// return NextResponse.json(newIssue, {status: 201}); // status 201 means an object was created +// } \ No newline at end of file diff --git a/Websites/UnusedPages/issues/new/page.tsx b/Websites/UnusedPages/issues/new/page.tsx index f98d5f0..5d689f2 100644 --- a/Websites/UnusedPages/issues/new/page.tsx +++ b/Websites/UnusedPages/issues/new/page.tsx @@ -1,58 +1,58 @@ -"use client"; -import React from "react"; -import SimpleMDE from "react-simplemde-editor"; -import "easymde/dist/easymde.min.css"; -import { useForm, Controller } from "react-hook-form"; -import { FormEvent } from "react"; +// "use client"; +// import React from "react"; +// import SimpleMDE from "react-simplemde-editor"; +// import "easymde/dist/easymde.min.css"; +// import { useForm, Controller } from "react-hook-form"; +// import { FormEvent } from "react"; -interface IssueForm { - title: string; - description: string; -} +// interface IssueForm { +// title: string; +// description: string; +// } -const NewIssuePage = () => { - const { register, control, handleSubmit } = useForm(); - // console.log(register('title')) +// const NewIssuePage = () => { +// const { register, control, handleSubmit } = useForm(); +// // console.log(register('title')) - // handle form submit - async function onSubmit(event: FormEvent) { - event.preventDefault(); +// // handle form submit +// async function onSubmit(event: FormEvent) { +// event.preventDefault(); - const formData = new FormData(event.currentTarget); - const response = await fetch("/api/issues", { - method: "POST", - body: formData, - }); +// const formData = new FormData(event.currentTarget); +// const response = await fetch("/api/issues", { +// method: "POST", +// body: formData, +// }); - // Handle response if necessary - // const data = await response.json(); - // ... - } +// // Handle response if necessary +// // const data = await response.json(); +// // ... +// } - return ( -
console.log(data))} - onSubmit={onSubmit} - > - - ( - - )} - /> - - - ); -}; +// return ( +//
console.log(data))} +// onSubmit={onSubmit} +// > +// +// ( +// +// )} +// /> +// +// +// ); +// }; -export default NewIssuePage; +// export default NewIssuePage; diff --git a/Websites/UnusedPages/issues/page.tsx b/Websites/UnusedPages/issues/page.tsx index b8a9d23..092730e 100644 --- a/Websites/UnusedPages/issues/page.tsx +++ b/Websites/UnusedPages/issues/page.tsx @@ -1,22 +1,22 @@ -import Link from 'next/link' -import React from 'react' -import type { NextApiRequest, NextApiResponse } from 'next' +// import Link from 'next/link' +// import React from 'react' +// import type { NextApiRequest, NextApiResponse } from 'next' -const IssuesPage = () => { - async function handler( - req: NextApiRequest, - res: NextApiResponse, - ) { - const data = req.body - console.log(...data) - res.redirect(307, '/issues') - } +// const IssuesPage = () => { +// async function handler( +// req: NextApiRequest, +// res: NextApiResponse, +// ) { +// const data = req.body +// console.log(...data) +// res.redirect(307, '/issues') +// } - return ( -
- -
- ) -} +// return ( +//
+// +//
+// ) +// } -export default IssuesPage \ No newline at end of file +// export default IssuesPage \ No newline at end of file diff --git a/Websites/UnusedPages/prisma/client.ts b/Websites/UnusedPages/prisma/client.ts new file mode 100644 index 0000000..672810a --- /dev/null +++ b/Websites/UnusedPages/prisma/client.ts @@ -0,0 +1,19 @@ +// import { PrismaClient } from '@prisma/client' + +// // ensures there is only one instance of prisma at any given moment + +// const prismaClientSingleton = () => { +// return new PrismaClient() +// } + +// type PrismaClientSingleton = ReturnType + +// const globalForPrisma = globalThis as unknown as { +// prisma: PrismaClientSingleton | undefined +// } + +// const prisma = globalForPrisma.prisma ?? prismaClientSingleton() + +// export default prisma + +// if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma \ No newline at end of file diff --git a/Websites/jefes-nextjs/prisma/migrations/20231021063954_create_issue/migration.sql b/Websites/UnusedPages/prisma/migrations/20231021063954_create_issue/migration.sql similarity index 100% rename from Websites/jefes-nextjs/prisma/migrations/20231021063954_create_issue/migration.sql rename to Websites/UnusedPages/prisma/migrations/20231021063954_create_issue/migration.sql diff --git a/Websites/jefes-nextjs/prisma/migrations/migration_lock.toml b/Websites/UnusedPages/prisma/migrations/migration_lock.toml similarity index 100% rename from Websites/jefes-nextjs/prisma/migrations/migration_lock.toml rename to Websites/UnusedPages/prisma/migrations/migration_lock.toml diff --git a/Websites/jefes-nextjs/prisma/schema.prisma b/Websites/UnusedPages/prisma/schema.prisma similarity index 100% rename from Websites/jefes-nextjs/prisma/schema.prisma rename to Websites/UnusedPages/prisma/schema.prisma diff --git a/Websites/UnusedPages/prisma/scripts.txt b/Websites/UnusedPages/prisma/scripts.txt new file mode 100644 index 0000000..2a6c2ec --- /dev/null +++ b/Websites/UnusedPages/prisma/scripts.txt @@ -0,0 +1,3 @@ +"prisma": { + "seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts" + } \ No newline at end of file diff --git a/Websites/jefes-nextjs/prisma/seed.ts b/Websites/UnusedPages/prisma/seed.ts similarity index 100% rename from Websites/jefes-nextjs/prisma/seed.ts rename to Websites/UnusedPages/prisma/seed.ts diff --git a/Websites/UnusedPages/users/nested/page.tsx b/Websites/UnusedPages/users/nested/page.tsx index 91b9bc9..ceba6f6 100644 --- a/Websites/UnusedPages/users/nested/page.tsx +++ b/Websites/UnusedPages/users/nested/page.tsx @@ -1,9 +1,9 @@ -import React from 'react' +// import React from 'react' -const Nested = () => { - return ( -
Nested
- ) -} +// const Nested = () => { +// return ( +//
Nested
+// ) +// } -export default Nested \ No newline at end of file +// export default Nested \ No newline at end of file diff --git a/Websites/UnusedPages/users/page.tsx b/Websites/UnusedPages/users/page.tsx index 821617c..c57d0ac 100644 --- a/Websites/UnusedPages/users/page.tsx +++ b/Websites/UnusedPages/users/page.tsx @@ -1,51 +1,51 @@ -import { userInfo } from 'os'; -import React, { useState, useEffect } from 'react' +// import { userInfo } from 'os'; +// import React, { useState, useEffect } from 'react' -interface User { - id: number; - name: string; - email: string; -} +// interface User { +// id: number; +// name: string; +// email: string; +// } -const UsersPage = async () => { - // Get the json file - const res = await fetch( - 'https://jsonplaceholder.typicode.com/users', - // Option to disable caching entirely, useful for data that changes frequently. - {cache: 'no-store'} +// const UsersPage = async () => { +// // Get the json file +// const res = await fetch( +// 'https://jsonplaceholder.typicode.com/users', +// // Option to disable caching entirely, useful for data that changes frequently. +// {cache: 'no-store'} - // Option to store the data within the cache for a certain period of time - // { next: { revalidate: 10 }} // get fresh data every 10 seconds - ); - // Create an object that will hold the users within the json file - const users: User[] = await res.json(); - // Create a cache in order to hold the data for later(useful for tokens) +// // Option to store the data within the cache for a certain period of time +// // { next: { revalidate: 10 }} // get fresh data every 10 seconds +// ); +// // Create an object that will hold the users within the json file +// const users: User[] = await res.json(); +// // Create a cache in order to hold the data for later(useful for tokens) - return ( - <> -

Users

- {/*

{new Date().toLocaleTimeString()}

*/} - {/* instead of an unordered list, we'll use a table -
    - {users.map(user =>
  • {user.name}
  • )} -
*/} - - - - - - - - - {users.map(user=> - - - )} - -
NameEmail
{user.name}{user.email}
- - ) -} +// return ( +// <> +//

Users

+// {/*

{new Date().toLocaleTimeString()}

*/} +// {/* instead of an unordered list, we'll use a table +//
    +// {users.map(user =>
  • {user.name}
  • )} +//
*/} +// +// +// +// +// +// +// +// +// {users.map(user=> +// +// +// )} +// +//
NameEmail
{user.name}{user.email}
+// +// ) +// } -export default UsersPage \ No newline at end of file +// export default UsersPage \ No newline at end of file diff --git a/Websites/jefes-nextjs/app/api/issues/route.ts b/Websites/jefes-nextjs/app/api/issues/route.ts deleted file mode 100644 index c0924ef..0000000 --- a/Websites/jefes-nextjs/app/api/issues/route.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { NextRequest, NextResponse } from "next/server"; -import { z } from 'zod'; -import prisma from "@/prisma/client"; - -// validate the request with zod -const createIssueSchema = z.object({ - title: z.string().min(1).max(255), // confirms string is between 1-255 characters - description: z.string().min(1), // confirms string has min length of 1 -}); - -// send request -export async function POST(request: NextRequest) { - // return request with a promise - const body = await request.json(); - - // validate the data - const validation = createIssueSchema.safeParse(body); - if (!validation.success) - return NextResponse.json(validation.error.errors, {status: 400}) // Send error 400 if data is invalid - - const newIssue = await prisma.issue.create({ - data: { title: body.title, description: body.description } - }); - - // return the issue to the client - return NextResponse.json(newIssue, {status: 201}); // status 201 means an object was created -} \ No newline at end of file diff --git a/Websites/jefes-nextjs/app/components/NavBar/NavBar.css b/Websites/jefes-nextjs/app/components/NavBar/NavBar.css index 9799072..e2accea 100644 --- a/Websites/jefes-nextjs/app/components/NavBar/NavBar.css +++ b/Websites/jefes-nextjs/app/components/NavBar/NavBar.css @@ -1,9 +1,18 @@ -.nav_background{ - z-index: -1; - filter: brightness(.17); - /* align-items: baseline; */ +.nav_background { + z-index: -1; + filter: brightness(0.17); + /* align-items: baseline; */ +} +.logo { + margin: 0 auto; + align-items: center; +} + +.active { + background: green; + position: fixed; + width: 100%; + justify-content: space-around; + display: flex; + align-items: center; } -.logo{ - margin: 0 auto; - align-items: center; -} \ No newline at end of file diff --git a/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx b/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx index 8d12a82..834a77b 100644 --- a/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx +++ b/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx @@ -1,5 +1,5 @@ "use client"; -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import Link from "next/link"; import Image from "next/image"; import { usePathname } from "next/navigation"; @@ -16,8 +16,9 @@ import { FaTiktok } from "react-icons/fa"; const NavBar = () => { const currentPath = usePathname(); - console.log(currentPath); + // console.log(currentPath); const [menu_open, set_menu_open] = useState(false); + const [navbar, setNavbar] = useState(false); const handleNav = () => { set_menu_open(!menu_open); @@ -39,10 +40,24 @@ const NavBar = () => { // { label: "Issues", href: "/issues" }, ]; + const changeBackground = () => { + // console.log(window.scrollY); + if (window.scrollY >= 20) { + setNavbar(true); + } else { + setNavbar(false); + } + }; + if (typeof window !== "undefined") { + // Your client-side code that uses window goes here + window.addEventListener("scroll", changeBackground); + } + return ( -