From b057fa21f5f4e89328b6001db28c7045c4d35e33 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Sat, 27 Apr 2024 12:25:06 +0800 Subject: [PATCH] refactored code to nextjs --- .gitignore | 3 + README.md | 54 +- {src/components => components}/ExampleGrid.js | 12 +- {src/components => components}/Footer.js | 0 .../PubButtonList.js | 6 +- {src/components => components}/Title.js | 2 +- {src/data => data}/examples.js | 14 - src/data/pub_links.js => data/pubLinks.js | 0 next.config.mjs | 7 + package-lock.json | 32242 +--------------- package.json | 55 +- pages/_app.js | 30 + pages/_document.js | 33 + src/App.js => pages/index.js | 19 +- postcss.config.js | 6 + public/index.html | 43 - src/App.css | 38 - src/App.test.js | 8 - src/index.css | 17 - src/index.js | 17 - src/logo.svg | 1 - src/reportWebVitals.js | 13 - src/setupTests.js | 5 - styles/Home.module.css | 92 + styles/global.css | 36 + tailwind.config.js | 9 +- yarn.lock | 949 + 27 files changed, 1719 insertions(+), 31992 deletions(-) rename {src/components => components}/ExampleGrid.js (82%) rename {src/components => components}/Footer.js (100%) rename {src/components => components}/PubButtonList.js (74%) rename {src/components => components}/Title.js (89%) rename {src/data => data}/examples.js (93%) rename src/data/pub_links.js => data/pubLinks.js (100%) create mode 100644 next.config.mjs create mode 100644 pages/_app.js create mode 100644 pages/_document.js rename src/App.js => pages/index.js (64%) create mode 100644 postcss.config.js delete mode 100644 public/index.html delete mode 100644 src/App.css delete mode 100644 src/App.test.js delete mode 100644 src/index.css delete mode 100644 src/index.js delete mode 100644 src/logo.svg delete mode 100644 src/reportWebVitals.js delete mode 100644 src/setupTests.js create mode 100644 styles/Home.module.css create mode 100644 styles/global.css create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index 4d29575..b8beea6 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# next.js +.next/ diff --git a/README.md b/README.md index 56ec105..1a60afb 100644 --- a/README.md +++ b/README.md @@ -1,53 +1 @@ -# Open-Sora Gallery - -We rewrite the `nerfies`[https://github.com/google/nerfies] with React to enable people without knowledge in html to edit the web content by simply changing the data files. - -The web content will display videos given in the `src/data/video.js` file. This file contains a `videos` variable and its structure follows this format: - -```javascript -[ - // video group - { - "title": "group1" - "items": [ - // put videos here - { - "prompt": "some descriptions", - "link": "link to the video 1" - }, - { - "prompt": "some descriptions", - "link": "link to the video 2" - }, - ] - }, - - // another group of videos - { - "title": "group2" - "items": [ - // put videos here - { - "prompt": "some descriptions", - "link": "link to the video 3" - }, - { - "prompt": "some descriptions", - "link": "link to the video 4" - }, - ] - }, -] - -``` - -If you wish to add another video, just add the following data to the `items` field in a video group. - -```javascript -{ - "prompt": "your prompt", - "link": "video url" -} -``` - -If you wish to add another video group, just replicate the group structure and edit the video items inside. \ No newline at end of file +This is a starter template for [Learn Next.js](https://nextjs.org/learn). diff --git a/src/components/ExampleGrid.js b/components/ExampleGrid.js similarity index 82% rename from src/components/ExampleGrid.js rename to components/ExampleGrid.js index c98624d..c642a96 100644 --- a/src/components/ExampleGrid.js +++ b/components/ExampleGrid.js @@ -9,13 +9,13 @@ const VideoItem = ({ video }) => { position: "relative", width: "100%", height: "0px", - "padding-bottom": "100.000%", + paddingBottom: "100.000%", }} >