From 65df47ea42b0e6abb4c6252ccd0f412d239aafcc Mon Sep 17 00:00:00 2001 From: Huyu2239 Date: Sat, 19 Oct 2024 12:34:05 +0900 Subject: [PATCH 1/2] add: IndexPage --- package-lock.json | 44 +++++++++++++++++++++++++++++++++++++++++++- package.json | 3 ++- src/main.tsx | 19 ++++++++++++++++++- src/pages/index.tsx | 3 +++ 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 src/pages/index.tsx diff --git a/package-lock.json b/package-lock.json index 44c2eec..d395e08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "0.0.0", "dependencies": { "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "react-router-dom": "^6.27.0" }, "devDependencies": { "@biomejs/biome": "1.9.3", @@ -734,6 +735,15 @@ "node": ">= 8" } }, + "node_modules/@remix-run/router": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.20.0.tgz", + "integrity": "sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.24.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", @@ -2412,6 +2422,38 @@ "react": "^18.3.1" } }, + "node_modules/react-router": { + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.27.0.tgz", + "integrity": "sha512-YA+HGZXz4jaAkVoYBE98VQl+nVzI+cVI2Oj/06F5ZM+0u3TgedN9Y9kmMRo2mnkSK2nCpNQn0DVob4HCsY/WLw==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.20.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.27.0.tgz", + "integrity": "sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.20.0", + "react-router": "6.27.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", diff --git a/package.json b/package.json index d786e28..fc758fa 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ }, "dependencies": { "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "react-router-dom": "^6.27.0" }, "devDependencies": { "@biomejs/biome": "1.9.3", diff --git a/src/main.tsx b/src/main.tsx index 2785e3a..c7f9b80 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,8 +1,25 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; +import { RouterProvider, createBrowserRouter } from "react-router-dom"; +import { IndexPage } from "./pages/index.tsx"; import "./styles/theme.css"; const root = document.getElementById("root"); if (!root) throw new Error("No root element"); -createRoot(root).render(); +const router = createBrowserRouter([ + { + children: [ + { + index: true, + element: , + }, + ], + }, +]); + +createRoot(root).render( + + + , +); diff --git a/src/pages/index.tsx b/src/pages/index.tsx new file mode 100644 index 0000000..f6644b5 --- /dev/null +++ b/src/pages/index.tsx @@ -0,0 +1,3 @@ +export function IndexPage() { + return <>; +} From c92c78e434ca0cc529a002f4410abc6508dcc8ce Mon Sep 17 00:00:00 2001 From: Huyu2239 Date: Wed, 6 Nov 2024 04:03:29 +0900 Subject: [PATCH 2/2] =?UTF-8?q?add:=20=E8=80=81=E5=AE=B3=E3=81=AE=E5=80=8B?= =?UTF-8?q?=E4=BA=BA=E7=9A=84=E4=BE=A1=E5=80=A4=E8=A6=B3=E3=81=AB=E3=82=88?= =?UTF-8?q?=E3=82=8B[=E3=81=9F=E3=81=9F=E3=81=8D=E5=8F=B0=E3=83=87?= =?UTF-8?q?=E3=82=B6=E3=82=A4=E3=83=B3]=E3=81=A7=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index.tsx | 116 +++++++++++++++++++++++++++++++++++++++- src/styles/index.css | 14 +++++ src/styles/linkcard.css | 57 ++++++++++++++++++++ src/styles/loading.css | 67 +++++++++++++++++++++++ src/styles/theme.css | 21 ++++++++ 5 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 src/styles/index.css create mode 100644 src/styles/linkcard.css create mode 100644 src/styles/loading.css diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f6644b5..10c86de 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,3 +1,117 @@ +import { useEffect } from "react"; +import "../styles/loading.css"; +import "../styles/linkcard.css"; +import "../styles/index.css"; + + +const links = [ + { + index: 0, + icon: "https://ichipol.g.hiroshima-cu.ac.jp/uprx/images/favicon.ico", + title: "UNIPA スマホ版", + url: "https://ichipol.g.hiroshima-cu.ac.jp/uprx/MobileShibbolethAuthServlet", + }, + { + index: 1, + icon: "https://ichipol.g.hiroshima-cu.ac.jp/uprx/images/favicon.ico", + title: "UNIPA PC版", + url: "https://ichipol.g.hiroshima-cu.ac.jp/uprx/ShibbolethAuthServlet", + }, + { + index: 2, + icon: "https://etext.g.hiroshima-cu.ac.jp/favicon.ico", + title: "UniText", + url: "https://app.d-text-service.jp/browser/start?uneidantai_ryakugo=MZ&soshiki_cd=hcity", + }, + { + index: 3, + icon: "https://outlook.office.com/favicon.ico", + title: "メール", + url: "https://outlook.office.com/mail/", + }, + { + index: 4, + icon: "https://www.hiroshima-cu.ac.jp/favicon.ico", + title: "大学公式ウェブサイト", + url: "https://www.hiroshima-cu.ac.jp/", + }, + { + index: 5, + icon: "https://www.hiroshima-cu.ac.jp/favicon.ico", + title: "学修の手引", + url: "https://www.hiroshima-cu.ac.jp/uploads/2022/03/655003d325eec272181262bc44a62d0e-20240331034513692.pdf", + }, + { + index: 6, + icon: "https://www.hiroshima-cu.ac.jp/favicon.ico", + title: "教育課程", + url: "https://www.hiroshima-cu.ac.jp/uploads/2022/03/fe9e63aa036d3e706dbab00e4ca51390-2024033103474682.pdf", + }, + { + index: 7, + icon: "https://www.hiroshima-cu.ac.jp/favicon.ico", + title: "時間割・集中講義日程", + url: "https://www.hiroshima-cu.ac.jp/campuslife/c00025986/", + }, +]; + +type LinkCardProps = { + icon: string; + title: string; + url: string; +}; + +const LinkCard = ({ icon, title, url}: LinkCardProps) => { + return ( +
+ +
+ +

{title}

+
+
+
+ ); +}; + +const Footer = () => { + return
© 2024 いちぴろ・エクスプローラ
; +}; + export function IndexPage() { - return <>; + useEffect(() => { + const ichipeerDiv = document.getElementById("ichipeer"); + if (!ichipeerDiv) return; + const script = document.createElement("script"); + script.type = "text/javascript"; + script.src = "https://platform.twitter.com/widgets.js"; + script.async = true; + ichipeerDiv.appendChild(script); + + return () => { + ichipeerDiv.removeChild(script); + }; + }, []); + return ( + <> + +
+ + HCU_ichipeerさんのポスト +
+ +
+