diff --git a/app/aboutus/page.tsx b/app/aboutus/page.tsx index 6238133..12f83e0 100644 --- a/app/aboutus/page.tsx +++ b/app/aboutus/page.tsx @@ -3,6 +3,7 @@ import ResponsiveNav from "@/components/Navbar/ResponsiveNav"; import { fetchCourses, fetchSettings, fetchAboutus } from "@/utils"; import {AboutusProps } from "@/types"; import Home from '@/components/Aboutus/Home'; + async function getCourses() { const courses = await fetchCourses(); return courses; @@ -31,6 +32,7 @@ export default async function Page() { return (
+ diff --git a/app/app.config.tsx b/app/app.config.tsx deleted file mode 100644 index c0a422e..0000000 --- a/app/app.config.tsx +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - colors:{ - - }, - api_link: "http://localhost/api/v1/", - } \ No newline at end of file diff --git a/app/courses/[slug]/page.tsx b/app/courses/[slug]/page.tsx index 08e6ef2..3b0970f 100644 --- a/app/courses/[slug]/page.tsx +++ b/app/courses/[slug]/page.tsx @@ -2,6 +2,7 @@ import React from 'react' import ResponsiveNav from "@/components/Navbar/ResponsiveNav"; import { fetchCourses, fetchCourse, fetchSettings } from "@/utils"; import dynamic from 'next/dynamic' + const DynamicComponent = dynamic(() => import('@/components/Course/Course'), { ssr: false, }) @@ -19,10 +20,6 @@ async function getSettings() { return settings; } -export const metadata = { - title: "All In One", - description: "**", -} export default async function Page({ params }: { params: { slug: string } }) { const courses = await getCourses(); @@ -34,6 +31,7 @@ export default async function Page({ params }: { params: { slug: string } }) { } return (
+
diff --git a/app/favicon.ico b/app/favicon.ico index c2a2a04..d32eda9 100644 Binary files a/app/favicon.ico and b/app/favicon.ico differ diff --git a/app/globals.css b/app/globals.css index 9fb8c81..4209828 100644 --- a/app/globals.css +++ b/app/globals.css @@ -15,6 +15,20 @@ .mainColor{ color: #D60050; } + .navigation-loader { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: flex; + align-items: center; + justify-content: center; + background: #0006; + color: #fff; + font-size: 18px; + font-weight: 700; + } .dots { li{ diff --git a/app/layout.tsx b/app/layout.tsx index 2e4ab4c..20c6d37 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,6 +1,8 @@ import type { Metadata } from "next"; import localFont from "next/font/local"; import "./globals.css"; +import Head from 'next/head'; +import NextTopLoader from 'nextjs-toploader'; import { Toaster } from "react-hot-toast"; const geistSans = localFont({ src: "./fonts/GeistVF.woff", @@ -13,9 +15,31 @@ const geistMono = localFont({ weight: "100 900", }); + + + export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "All And One Music", + description: "發掘你的音樂之路", + icons: [ + { + rel: 'icon', + type: 'image/png', + sizes: '32x32', + url: '/favicon/favicon-32x32.png', + }, + { + rel: 'icon', + type: 'image/png', + sizes: '16x16', + url: '/favicon/favicon-16x16.png', + }, + { + rel: 'apple-touch-icon', + sizes: '180x180', + url: '/favicon/apple-touch-icon.png', + }, + ], }; export default function RootLayout({ @@ -26,9 +50,12 @@ export default function RootLayout({ }>) { return ( + + + {children} diff --git a/app/page.tsx b/app/page.tsx index 2d43971..aea706b 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,21 +1,24 @@ import Home from "../components/Home/Home"; -import { fetchCourses, fetchSettings} from "../utils/index"; +import { fetchCourses, fetchSettings } from "../utils/index"; import ResponsiveNav from "../components/Navbar/ResponsiveNav"; - +import Head from "next/head"; async function getCourses() { const courses = await fetchCourses(); return courses; } -async function getSettings(){ +async function getSettings() { const settings = await fetchSettings(); return settings; } export const metadata = { - title: "All In One", + title: "All And One Music", description: "**", + icons: { + icon: '/favicon.ico', + }, } export default async function HomePage() { @@ -23,7 +26,9 @@ export default async function HomePage() { const settings = await getSettings(); return (
- + + +
); diff --git a/components/Aboutus/AboutusContent.tsx b/components/Aboutus/AboutusContent.tsx index a1c54ee..99ac9d9 100644 --- a/components/Aboutus/AboutusContent.tsx +++ b/components/Aboutus/AboutusContent.tsx @@ -75,7 +75,7 @@ const AboutusContent = ({ aboutus }: { aboutus: AboutusProps[] }) => { />
-

+

{item.title}

{/*

diff --git a/components/Aboutus/Banner.tsx b/components/Aboutus/Banner.tsx index c85f6e1..88f66a0 100644 --- a/components/Aboutus/Banner.tsx +++ b/components/Aboutus/Banner.tsx @@ -7,7 +7,7 @@ const Banner = () => {

-

+

{"關於我們"}

diff --git a/components/ContactForm.tsx b/components/ContactForm.tsx index 9289a29..c017644 100644 --- a/components/ContactForm.tsx +++ b/components/ContactForm.tsx @@ -17,7 +17,7 @@ const ContactForm = ({ startLoading, stopLoading }: Props) => { register, handleSubmit, reset, - formState: {}, + formState: { }, } = useForm() const onSubmit: SubmitHandler = async (data) => { try { @@ -25,7 +25,7 @@ const ContactForm = ({ startLoading, stopLoading }: Props) => { const result = await postMessage(data); if (result.success) { toast.success('已收到您的訊息,我們會盡快回覆您!'); - reset(); // Reset form fields + reset(); // Reset form fields // Reset form or perform any other actions on success } else { toast.error('Failed to send message. Please try again.'); @@ -55,7 +55,7 @@ const ContactForm = ({ startLoading, stopLoading }: Props) => {
-
+
diff --git a/components/Course/Accordion.tsx b/components/Course/Accordion.tsx index 1dcd540..8bad5d2 100644 --- a/components/Course/Accordion.tsx +++ b/components/Course/Accordion.tsx @@ -39,7 +39,7 @@ const Accordion = async ({ courseData }: { courseData: CoursesProps }) => { -

+

{"課程時間表"}

{ diff --git a/components/Course/Banner.tsx b/components/Course/Banner.tsx index 0937142..f79dfbe 100644 --- a/components/Course/Banner.tsx +++ b/components/Course/Banner.tsx @@ -6,7 +6,7 @@ const Banner = ({ courseData }: { courseData: CoursesProps }) => {
-

+

{courseData?.title}

diff --git a/components/Course/Collapse.tsx b/components/Course/Collapse.tsx index 6229667..8a91f56 100644 --- a/components/Course/Collapse.tsx +++ b/components/Course/Collapse.tsx @@ -89,7 +89,7 @@ const Collapse: React.FC = ({ title, children, className, info, i className={`flex justify-between items-center w-full p-6 text-left ${isOpen ? "rounded-t-lg bg-mainColor" : "rounded-lg bg-[#F2D6D5] "}`} onClick={() => setIsOpen(!isOpen)} > - {title} + {title} {isOpen ? ( ) : ( @@ -153,7 +153,7 @@ const Collapse: React.FC = ({ title, children, className, info, i : (
)}
diff --git a/components/Course/CourseImagesSilder.tsx b/components/Course/CourseImagesSilder.tsx index 0132fb6..f4eb3b0 100644 --- a/components/Course/CourseImagesSilder.tsx +++ b/components/Course/CourseImagesSilder.tsx @@ -125,7 +125,7 @@ const CourseImagesSilder = ({ courseData }: { courseData: CoursesProps }) => { {courseData.images.map((image, index) => { return (
-
+
{`Course { return (
-

+

{courseData.title}

diff --git a/components/Course/ScheduleCollapse.tsx b/components/Course/ScheduleCollapse.tsx index 5369e04..703a49f 100644 --- a/components/Course/ScheduleCollapse.tsx +++ b/components/Course/ScheduleCollapse.tsx @@ -51,7 +51,7 @@ const ScheduleCollapse: React.FC = ({ title, rerganizedSchedule }
{rerganizedSchedule.schedules.map((schedule, index) => (
-

+

{ moment.utc(schedule.date).format("MM月DD日")}

{schedule.title}

diff --git a/components/CoursesSilder.tsx b/components/CoursesSilder.tsx index cb70324..d84d008 100644 --- a/components/CoursesSilder.tsx +++ b/components/CoursesSilder.tsx @@ -5,6 +5,7 @@ import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; import Slider from "react-slick"; import './slick.css' +import Link from "next/link"; //npm i --save-dev @types/react-slick @@ -62,12 +63,13 @@ const CoursesSilder = ({ courses }: { courses: CoursesProps[] }) => { {course.sort_description}

- +
@@ -86,12 +88,13 @@ const CoursesSilder = ({ courses }: { courses: CoursesProps[] }) => {

{course.sort_description}

- + + {"了解更多"} +
diff --git a/components/RouteLoader.tsx b/components/RouteLoader.tsx new file mode 100644 index 0000000..2ed56cd --- /dev/null +++ b/components/RouteLoader.tsx @@ -0,0 +1,24 @@ +"use client" +import React, { useState, useEffect } from 'react' +import { usePathname, useSearchParams } from 'next/navigation' +import Loading from './Loading' +// const Loader = () => ( +//
+//
+//
+// ); + +export default function RouteLoader() { + const pathname = usePathname() + const searchParams = useSearchParams() + const [loading, setLoading] = useState(false) + + useEffect(() => { + setLoading(true) + const timer = setTimeout(() => setLoading(false), 300) // Adjust timeout as needed + + return () => clearTimeout(timer) + }, [pathname, searchParams]) + + return loading ? : null +} diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index c2a2a04..0000000 Binary files a/favicon.ico and /dev/null differ diff --git a/package-lock.json b/package-lock.json index f1e2715..5cc13a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "moment": "^2.30.1", "next": "14.2.13", "nextjs-cors": "^2.2.0", + "nextjs-toploader": "^3.7.15", "react": "^18", "react-animate-on-scroll": "^2.1.9", "react-dom": "^18", @@ -3899,6 +3900,24 @@ "next": "^8.1.1-canary.54 || ^9.0.0 || ^10.0.0-0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0" } }, + "node_modules/nextjs-toploader": { + "version": "3.7.15", + "resolved": "https://registry.npmjs.org/nextjs-toploader/-/nextjs-toploader-3.7.15.tgz", + "integrity": "sha512-DvvXEJVRPfE2j1HVXgFhmPl8pRcLb/4mvyVBDuYdMdkbEY7KJghp0fG5iOZ002cV6awbBw9j/Di7vQL8LRazxQ==", + "license": "MIT", + "dependencies": { + "nprogress": "^0.2.0", + "prop-types": "^15.8.1" + }, + "funding": { + "url": "https://buymeacoffee.com/thesgj" + }, + "peerDependencies": { + "next": ">= 6.0.0", + "react": ">= 16.0.0", + "react-dom": ">= 16.0.0" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3909,6 +3928,12 @@ "node": ">=0.10.0" } }, + "node_modules/nprogress": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", + "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==", + "license": "MIT" + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", diff --git a/package.json b/package.json index 6ad3ed9..3606a50 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "moment": "^2.30.1", "next": "14.2.13", "nextjs-cors": "^2.2.0", + "nextjs-toploader": "^3.7.15", "react": "^18", "react-animate-on-scroll": "^2.1.9", "react-dom": "^18", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index c2a2a04..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/favicon/apple-touch-icon.png b/public/favicon/apple-touch-icon.png new file mode 100644 index 0000000..c7e0831 Binary files /dev/null and b/public/favicon/apple-touch-icon.png differ diff --git a/public/favicon/favicon-48x48.png b/public/favicon/favicon-48x48.png new file mode 100644 index 0000000..a3dd84d Binary files /dev/null and b/public/favicon/favicon-48x48.png differ diff --git a/public/favicon/favicon.ico b/public/favicon/favicon.ico new file mode 100644 index 0000000..d32eda9 Binary files /dev/null and b/public/favicon/favicon.ico differ diff --git a/public/favicon/favicon.svg b/public/favicon/favicon.svg new file mode 100644 index 0000000..3e56959 --- /dev/null +++ b/public/favicon/favicon.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/public/favicon/site.webmanifest b/public/favicon/site.webmanifest new file mode 100644 index 0000000..ccf313a --- /dev/null +++ b/public/favicon/site.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "MyWebSite", + "short_name": "MySite", + "icons": [ + { + "src": "/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/public/favicon/web-app-manifest-192x192.png b/public/favicon/web-app-manifest-192x192.png new file mode 100644 index 0000000..4a76145 Binary files /dev/null and b/public/favicon/web-app-manifest-192x192.png differ diff --git a/public/favicon/web-app-manifest-512x512.png b/public/favicon/web-app-manifest-512x512.png new file mode 100644 index 0000000..3c501fc Binary files /dev/null and b/public/favicon/web-app-manifest-512x512.png differ