diff --git a/addLicense.cjs b/addLicense.cjs index 30f4bdd..ee8f0df 100644 --- a/addLicense.cjs +++ b/addLicense.cjs @@ -1,7 +1,19 @@ +/** + * @license + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * All contributors who participated in development before September 26, 2024, retain full copyright over their contributions. + * These contributors are granted the right, under a Contributor License Agreement (CLA), to use, modify, and distribute their contributions + * under additional or alternative licensing terms of their choosing, while the project as a whole remains licensed under the MPL 2.0. + * + * Any contributions made after September 26, 2024, are subject to the terms of the MPL 2.0 and are licensed accordingly. + */ + const fs = require("fs"); const path = require("path"); -const licenseText = `/** +const LICENSE_TEXT = `/** * @license * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. @@ -14,34 +26,52 @@ const licenseText = `/** */ `; -const directoryPath = path.join(__dirname, "src"); +const UNIQUE_LICENSE_STRING = "This Source Code Form"; +const TARGET_EXTENSIONS = [".ts", ".tsx"]; +const MAX_FILE_CONTENT_PREVIEW = 100; + +function hasLicense(fileContent) { + return fileContent.slice(0, MAX_FILE_CONTENT_PREVIEW).includes(UNIQUE_LICENSE_STRING); +} + +function prependLicense(filePath) { + try { + const fileContent = fs.readFileSync(filePath, "utf8").trim(); -function addLicenseToFile(filePath) { - const fileContent = fs.readFileSync(filePath, "utf8"); - if (!fileContent.startsWith("/* This Source Code Form")) { - const newContent = licenseText + "\n" + fileContent; - fs.writeFileSync(filePath, newContent, "utf8"); - console.log(`License added to: ${filePath}`); - } else { - console.log(`License already present in: ${filePath}`); + if (!hasLicense(fileContent)) { + const updatedContent = LICENSE_TEXT + "\n" + fileContent; + fs.writeFileSync(filePath, updatedContent, "utf8"); + console.log(`License added to: ${filePath}`); + } else { + console.log(`License already present in: ${filePath}`); + } + } catch (err) { + console.error(`Error processing file: ${filePath} - ${err.message}`); } } function processDirectory(directory) { - fs.readdir(directory, (err, files) => { - if (err) return; + try { + const items = fs.readdirSync(directory); - files.forEach((file) => { - const filePath = path.join(directory, file); - const stat = fs.statSync(filePath); + items.forEach((item) => { + const itemPath = path.join(directory, item); + const stat = fs.statSync(itemPath); - if (stat.isDirectory() && file !== "node_modules") { - processDirectory(filePath); - } else if (file.endsWith(".ts") || file.endsWith(".tsx")) { - addLicenseToFile(filePath); + if (stat.isDirectory() && item !== "node_modules") { + processDirectory(itemPath); + } else if (TARGET_EXTENSIONS.some((ext) => item.endsWith(ext))) { + prependLicense(itemPath); } }); - }); + } catch (err) { + console.error(`Error processing directory: ${directory} - ${err.message}`); + } +} + +function main() { + const srcDirectory = path.join(__dirname, "src"); + processDirectory(srcDirectory); } -processDirectory(directoryPath); +main(); diff --git a/package-lock.json b/package-lock.json index a7e54ef..c485e66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1942,9 +1942,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz", - "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.22.5.tgz", + "integrity": "sha512-SU5cvamg0Eyu/F+kLeMXS7GoahL+OoizlclVFX3l5Ql6yNlywJJ0OuqTzUx0v+aHhPHEB/56CT06GQrRrGNYww==", "cpu": [ "arm" ], @@ -1955,9 +1955,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz", - "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.22.5.tgz", + "integrity": "sha512-S4pit5BP6E5R5C8S6tgU/drvgjtYW76FBuG6+ibG3tMvlD1h9LHVF9KmlmaUBQ8Obou7hEyS+0w+IR/VtxwNMQ==", "cpu": [ "arm64" ], @@ -1968,9 +1968,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz", - "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.5.tgz", + "integrity": "sha512-250ZGg4ipTL0TGvLlfACkIxS9+KLtIbn7BCZjsZj88zSg2Lvu3Xdw6dhAhfe/FjjXPVNCtcSp+WZjVsD3a/Zlw==", "cpu": [ "arm64" ], @@ -1981,9 +1981,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz", - "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.5.tgz", + "integrity": "sha512-D8brJEFg5D+QxFcW6jYANu+Rr9SlKtTenmsX5hOSzNYVrK5oLAEMTUgKWYJP+wdKyCdeSwnapLsn+OVRFycuQg==", "cpu": [ "x64" ], @@ -1994,9 +1994,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz", - "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.22.5.tgz", + "integrity": "sha512-PNqXYmdNFyWNg0ma5LdY8wP+eQfdvyaBAojAXgO7/gs0Q/6TQJVXAXe8gwW9URjbS0YAammur0fynYGiWsKlXw==", "cpu": [ "arm" ], @@ -2007,9 +2007,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz", - "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.22.5.tgz", + "integrity": "sha512-kSSCZOKz3HqlrEuwKd9TYv7vxPYD77vHSUvM2y0YaTGnFc8AdI5TTQRrM1yIp3tXCKrSL9A7JLoILjtad5t8pQ==", "cpu": [ "arm" ], @@ -2020,9 +2020,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.2.tgz", - "integrity": "sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.22.5.tgz", + "integrity": "sha512-oTXQeJHRbOnwRnRffb6bmqmUugz0glXaPyspp4gbQOPVApdpRrY/j7KP3lr7M8kTfQTyrBUzFjj5EuHAhqH4/w==", "cpu": [ "arm64" ], @@ -2033,9 +2033,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.2.tgz", - "integrity": "sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.22.5.tgz", + "integrity": "sha512-qnOTIIs6tIGFKCHdhYitgC2XQ2X25InIbZFor5wh+mALH84qnFHvc+vmWUpyX97B0hNvwNUL4B+MB8vJvH65Fw==", "cpu": [ "arm64" ], @@ -2046,9 +2046,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.2.tgz", - "integrity": "sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.22.5.tgz", + "integrity": "sha512-TMYu+DUdNlgBXING13rHSfUc3Ky5nLPbWs4bFnT+R6Vu3OvXkTkixvvBKk8uO4MT5Ab6lC3U7x8S8El2q5o56w==", "cpu": [ "ppc64" ], @@ -2059,9 +2059,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.2.tgz", - "integrity": "sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.22.5.tgz", + "integrity": "sha512-PTQq1Kz22ZRvuhr3uURH+U/Q/a0pbxJoICGSprNLAoBEkyD3Sh9qP5I0Asn0y0wejXQBbsVMRZRxlbGFD9OK4A==", "cpu": [ "riscv64" ], @@ -2072,9 +2072,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.2.tgz", - "integrity": "sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.22.5.tgz", + "integrity": "sha512-bR5nCojtpuMss6TDEmf/jnBnzlo+6n1UhgwqUvRoe4VIotC7FG1IKkyJbwsT7JDsF2jxR+NTnuOwiGv0hLyDoQ==", "cpu": [ "s390x" ], @@ -2085,9 +2085,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.2.tgz", - "integrity": "sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.5.tgz", + "integrity": "sha512-N0jPPhHjGShcB9/XXZQWuWBKZQnC1F36Ce3sDqWpujsGjDz/CQtOL9LgTrJ+rJC8MJeesMWrMWVLKKNR/tMOCA==", "cpu": [ "x64" ], @@ -2098,9 +2098,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.2.tgz", - "integrity": "sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.5.tgz", + "integrity": "sha512-uBa2e28ohzNNwjr6Uxm4XyaA1M/8aTgfF2T7UIlElLaeXkgpmIJ2EitVNQxjO9xLLLy60YqAgKn/AqSpCUkE9g==", "cpu": [ "x64" ], @@ -2111,9 +2111,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.2.tgz", - "integrity": "sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.22.5.tgz", + "integrity": "sha512-RXT8S1HP8AFN/Kr3tg4fuYrNxZ/pZf1HemC5Tsddc6HzgGnJm0+Lh5rAHJkDuW3StI0ynNXukidROMXYl6ew8w==", "cpu": [ "arm64" ], @@ -2124,9 +2124,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.2.tgz", - "integrity": "sha512-5rA4vjlqgrpbFVVHX3qkrCo/fZTj1q0Xxpg+Z7yIo3J2AilW7t2+n6Q8Jrx+4MrYpAnjttTYF8rr7bP46BPzRw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.22.5.tgz", + "integrity": "sha512-ElTYOh50InL8kzyUD6XsnPit7jYCKrphmddKAe1/Ytt74apOxDq5YEcbsiKs0fR3vff3jEneMM+3I7jbqaMyBg==", "cpu": [ "ia32" ], @@ -2137,9 +2137,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.2.tgz", - "integrity": "sha512-6UUxd0+SKomjdzuAcp+HAmxw1FlGBnl1v2yEPSabtx4lBfdXHDVsW7+lQkgz9cNFJGY3AWR7+V8P5BqkD9L9nA==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.22.5.tgz", + "integrity": "sha512-+lvL/4mQxSV8MukpkKyyvfwhH266COcWlXE/1qxwN08ajovta3459zrjLghYMgDerlzNwLAcFpvU+WWE5y6nAQ==", "cpu": [ "x64" ], @@ -2404,9 +2404,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/node": { @@ -4564,12 +4564,12 @@ } }, "node_modules/rollup": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz", - "integrity": "sha512-e3TapAgYf9xjdLvKQCkQTnbTKd4a6jwlpQSJJFokHGaX2IVjoEqkIIhiQfqsi0cdwlOD+tQGuOd5AJkc5RngBw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.22.5.tgz", + "integrity": "sha512-WoinX7GeQOFMGznEcWA1WrTQCd/tpEbMkc3nuMs9BT0CPjMdSjPMTVClwWd4pgSQwJdP65SK9mTCNvItlr5o7w==", "dev": true, "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -4579,22 +4579,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.2", - "@rollup/rollup-android-arm64": "4.21.2", - "@rollup/rollup-darwin-arm64": "4.21.2", - "@rollup/rollup-darwin-x64": "4.21.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.2", - "@rollup/rollup-linux-arm-musleabihf": "4.21.2", - "@rollup/rollup-linux-arm64-gnu": "4.21.2", - "@rollup/rollup-linux-arm64-musl": "4.21.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.2", - "@rollup/rollup-linux-riscv64-gnu": "4.21.2", - "@rollup/rollup-linux-s390x-gnu": "4.21.2", - "@rollup/rollup-linux-x64-gnu": "4.21.2", - "@rollup/rollup-linux-x64-musl": "4.21.2", - "@rollup/rollup-win32-arm64-msvc": "4.21.2", - "@rollup/rollup-win32-ia32-msvc": "4.21.2", - "@rollup/rollup-win32-x64-msvc": "4.21.2", + "@rollup/rollup-android-arm-eabi": "4.22.5", + "@rollup/rollup-android-arm64": "4.22.5", + "@rollup/rollup-darwin-arm64": "4.22.5", + "@rollup/rollup-darwin-x64": "4.22.5", + "@rollup/rollup-linux-arm-gnueabihf": "4.22.5", + "@rollup/rollup-linux-arm-musleabihf": "4.22.5", + "@rollup/rollup-linux-arm64-gnu": "4.22.5", + "@rollup/rollup-linux-arm64-musl": "4.22.5", + "@rollup/rollup-linux-powerpc64le-gnu": "4.22.5", + "@rollup/rollup-linux-riscv64-gnu": "4.22.5", + "@rollup/rollup-linux-s390x-gnu": "4.22.5", + "@rollup/rollup-linux-x64-gnu": "4.22.5", + "@rollup/rollup-linux-x64-musl": "4.22.5", + "@rollup/rollup-win32-arm64-msvc": "4.22.5", + "@rollup/rollup-win32-ia32-msvc": "4.22.5", + "@rollup/rollup-win32-x64-msvc": "4.22.5", "fsevents": "~2.3.2" } }, diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 617f977..2ffff73 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -21,14 +21,9 @@ export function Footer() { - - 사이트 문의 - + + 사이트 정보 +

COPYRIGHT Ⓒ 2024 LIKELION KANGWON NATIONAL UNIV. ALL RIGHTS RESERVED. diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 21ce842..bbc57c0 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -16,7 +16,7 @@ import Header from "../Header"; import { Footer } from "../Footer"; import ScrollToTop from "./scrollContol"; -// TODO: 모든 페이지에 공통으로 들어가는 레이아웃을 작성합니다. 필요 없으면 삭제해주세요 +// 모든 페이지에 공통으로 들어가는 레이아웃을 작성합니다. export default function Layout() { return (

diff --git a/src/components/SiteInfo/.css.ts b/src/components/SiteInfo/.css.ts new file mode 100644 index 0000000..88fda84 --- /dev/null +++ b/src/components/SiteInfo/.css.ts @@ -0,0 +1,146 @@ +/** + * @license + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * All contributors who participated in development before September 26, 2024, retain full copyright over their contributions. + * These contributors are granted the right, under a Contributor License Agreement (CLA), to use, modify, and distribute their contributions + * under additional or alternative licensing terms of their choosing, while the project as a whole remains licensed under the MPL 2.0. + * + * Any contributions made after September 26, 2024, are subject to the terms of the MPL 2.0 and are licensed accordingly. + */ + +import { style } from "@vanilla-extract/css"; + +// 공통 스타일: 글꼴, 색상, 기본 박스 쉐도우 등을 재사용할 수 있도록 변수화 +const commonColors = { + primary: "#0781CD", + secondary: "#029FD7", + accent: "#04D1C3", + background: "#F0F8FF", + white: "#FFFFFF", + shadow: "rgba(7, 129, 205, 0.1)", + hoverShadow: "rgba(7, 129, 205, 0.15)", +}; + +const fontStyles = { + headingFont: "pyeongChangBold, sans-serif", + subHeadingFont: "pyeongChangLight, sans-serif", + bodyFont: "pretendard, sans-serif", +}; + +export const container = style({ + maxWidth: "1000px", + margin: "0 auto", + padding: "2rem", + backgroundColor: "rgba(255,255,255,0.32)", + color: commonColors.primary, + fontFamily: fontStyles.bodyFont, + boxShadow: `0 4px 6px ${commonColors.shadow}`, + borderRadius: "8px", +}); + +export const heading = style({ + fontSize: "2.5rem", + color: commonColors.secondary, + marginBottom: "1.5rem", + fontFamily: fontStyles.headingFont, + textAlign: "center", + position: "relative", + ":after": { + content: '""', + display: "block", + width: "50px", + height: "3px", + backgroundColor: commonColors.accent, + margin: "0.5rem auto", + }, +}); + +export const section = style({ + marginBottom: "2rem", + background: commonColors.background, + padding: "1.5rem", + borderRadius: "6px", + transition: "transform 0.3s ease", + ":hover": { + transform: "translateY(-5px)", + }, +}); + +export const subHeading = style({ + fontSize: "1.8rem", + color: commonColors.primary, + marginBottom: "1rem", + fontFamily: fontStyles.subHeadingFont, + borderBottom: `2px solid ${commonColors.accent}`, + paddingBottom: "0.5rem", +}); + +export const list = style({ + listStyleType: "none", + padding: 0, + display: "grid", + gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))", + gap: "1.5rem", +}); + +export const listItem = style({ + backgroundColor: commonColors.white, + padding: "1rem", + borderRadius: "6px", + boxShadow: `0 2px 4px ${commonColors.shadow}`, + transition: "box-shadow 0.3s ease", + ":hover": { + boxShadow: `0 4px 8px ${commonColors.hoverShadow}`, + }, +}); + +export const personName = style({ + fontWeight: "bold", + color: commonColors.secondary, + fontSize: "1.2rem", + marginBottom: "0.5rem", +}); + +// contactInfo 스타일 추가 +export const contactInfo = style({ + display: "flex", + flexWrap: "wrap", + gap: "0.5rem", + fontSize: "0.875rem", + marginBottom: "0.5rem", +}); + +// responsibilities 스타일 추가 +export const responsibilities = style({ + marginTop: "0.75rem", + paddingLeft: "1rem", + color: commonColors.primary, + fontSize: "0.9rem", +}); + +export const link = style({ + color: "transparent", + backgroundImage: `linear-gradient(90deg, ${commonColors.primary}, #00CFFD, ${commonColors.secondary}, #00274D)`, + backgroundClip: "text", + WebkitBackgroundClip: "text", + textDecoration: "none", + padding: "0.25rem 0.5rem", + borderRadius: "4px", + transition: "background-color 0.3s ease", + ":hover": { + backgroundColor: commonColors.secondary, + }, +}); + +export const responsibilityItem = style({ + marginBottom: "0.25rem", + position: "relative", + ":before": { + content: '"•"', + position: "absolute", + left: "-1rem", + color: commonColors.accent, + }, +}); diff --git a/src/components/SiteInfo/Info.ts b/src/components/SiteInfo/Info.ts new file mode 100644 index 0000000..0882b6e --- /dev/null +++ b/src/components/SiteInfo/Info.ts @@ -0,0 +1,90 @@ +/** + * @license + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * All contributors who participated in development before September 26, 2024, retain full copyright over their contributions. + * These contributors are granted the right, under a Contributor License Agreement (CLA), to use, modify, and distribute their contributions + * under additional or alternative licensing terms of their choosing, while the project as a whole remains licensed under the MPL 2.0. + * + * Any contributions made after September 26, 2024, are subject to the terms of the MPL 2.0 and are licensed accordingly. + */ + +import { siteDataProps } from "../../shared/types/stieInfoTypes.ts"; + +export const siteData: siteDataProps = { + creators: { + label: "제작자", + manager: { + label: "담당자", + people: [ + { + name: "홍지환", + email: "flareseek@gmail.com", + github: "https://github.com/flareseek", + responsibilities: [ + "PR / CI / CD / 어드민 페이지", + "폰트 최적화(PyeongChangPeace)", + "및 타임테이블 유지 보수", + ], + }, + ], + }, + developers: { + label: "개발진", + people: [ + { + name: "조준환", + email: "jjh4450git@gmail.com", + github: "https://jeje.work/github", + website: "https://blog.jeje.work", + responsibilities: [ + "페이지: 메인 / 타임 테이블", + "요소: 헤더 /푸터", + "최적화: 이미지 / 메타태그 / 번들링 / 라우팅 / 폰트(pretendard)", + ], + }, + { + name: "정다연", + email: "glue0440@gmail.com", + github: "https://github.com/dandamdandam", + responsibilities: [ + "페이지: 부스 & 푸드 트럭 / 지도 세부 목록", + "요소: 레이어 및 라우터 구성", + ], + }, + { + name: "김재연", + email: "hyeseonchoi0512@gmail.com", + github: "https://github.com/Kim-jaeyeon", + responsibilities: ["페이지: 공지사항 / QnA / 아티스트 / maker's 페이지 제작"], + }, + { + name: "이진호", + email: "ych0486666@gmail.com", + github: "https://github.com/treasure-sky", + responsibilities: ["공지사항 백엔드 서버 구축 및 연동"], + }, + ], + }, + designers: { + label: "디자인", + people: [ + { + name: "하나", + email: "farhanahaslan@gmail.com", + }, + { + name: "이예지", + email: "ydw082504211@gmail.com", + }, + { + name: "최혜선", + email: "jy020507@kangwon.ac.kr", + github: "https://github.com/hyeseon-cpu", + responsibilities: ["타임테이블 UI 요소 개선"], + }, + ], + }, + }, +}; diff --git a/src/components/SiteInfo/index.tsx b/src/components/SiteInfo/index.tsx new file mode 100644 index 0000000..570f789 --- /dev/null +++ b/src/components/SiteInfo/index.tsx @@ -0,0 +1,79 @@ +/** + * @license + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * All contributors who participated in development before September 26, 2024, retain full copyright over their contributions. + * These contributors are granted the right, under a Contributor License Agreement (CLA), to use, modify, and distribute their contributions + * under additional or alternative licensing terms of their choosing, while the project as a whole remains licensed under the MPL 2.0. + * + * Any contributions made after September 26, 2024, are subject to the terms of the MPL 2.0 and are licensed accordingly. + */ + +import { + container, + heading, + subHeading, + section, + list, + listItem, + personName, + contactInfo, + responsibilities, + link, + responsibilityItem, +} from "./.css.ts"; +import { siteData } from "./Info"; +import { personProps, categoryProps } from "../../shared/types/stieInfoTypes"; + +export default function SiteInfo() { + return ( +
+

Site Information

+ +

{siteData.creators.label}

+ + {(Object.entries(siteData.creators) as [string, categoryProps][]).map(([key, value]) => { + if (key === "label") return null; + return ( +
+

{value.label}

+
    + {value.people.map((person: personProps, index) => ( +
  • + {person.name} +
    + {person.email && ( + + {person.email} + + )} + {person.github && ( + + GitHub + + )} + {person.website && ( + + Website + + )} +
    + {person.responsibilities && ( +
      + {person.responsibilities.map((resp, idx) => ( +
    • + {resp} +
    • + ))} +
    + )} +
  • + ))} +
+
+ ); + })} +
+ ); +} diff --git a/src/pages/Notice/index.tsx b/src/pages/Notice/index.tsx index d446835..56b710c 100644 --- a/src/pages/Notice/index.tsx +++ b/src/pages/Notice/index.tsx @@ -28,9 +28,9 @@ import { activePageButton, emptyListAlert, } from "./notice.css.ts"; // 스타일 가져오기 -import { getNoticeList } from "../../shared/firebase/noticeService"; // Firebase에서 getNoticeList 가져오기 import { NoticeDto } from "../../shared/types/notice"; // NoticeDto 타입 정의 import { Loading } from "../../components/Loading/index.tsx"; +import { noticeData } from "../../shared/firebase/mockData.ts"; function Notice() { const [notices, setNotices] = useState([]); // 공지사항 목록 상태 @@ -43,7 +43,7 @@ function Notice() { // Firebase에서 공지사항 데이터를 가져오는 함수 const fetchNotices = async () => { try { - const noticeList = await getNoticeList(); // Firebase에서 데이터 가져오기 + const noticeList = noticeData; // Firebase에서 데이터 가져오기(chage to mock data 2024.09.28) setNotices(noticeList); // 데이터를 상태에 저장 setLoading(false); // 로딩 완료 } catch (error) { @@ -142,8 +142,11 @@ function Notice() { {expandedNoticeId === noticeItem.id && (
+ //@build-time-remove: dangerouslySetInnerHTML={{ __html: noticeItem.contents }} // HTML로 렌더링 + //@build-time-remove: (off and change to text after 2024.09.28 for security by jjh4450git@gmail.com) + > + {noticeItem.contents} +
)}
)) diff --git a/src/pages/Timetable/index.tsx b/src/pages/Timetable/index.tsx index 5f5ce59..041360a 100644 --- a/src/pages/Timetable/index.tsx +++ b/src/pages/Timetable/index.tsx @@ -14,7 +14,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from "react" import { timeTableInfo } from "./timeTableInfo.ts"; import * as styles from "./.css.ts"; import { FilterButton, TimeTableItem } from "./subComponents.tsx"; -import { clearTime, END_DATE, START_DATE, TIME_TABLE_FILTER } from "./utils.tsx"; +import { clearTime, DEMO_DATE, END_DATE, START_DATE, TIME_TABLE_FILTER } from "./utils.tsx"; /** * 타임테이블 페이지 @@ -35,7 +35,7 @@ export default function Timetable() { if (today >= start && today <= end) { setViewTime(today); } else { - setViewTime(start); + setViewTime(DEMO_DATE); // 축제기간이 아닐 경우 데모용 날짜로 설정 } // 현재 시간을 1분마다 업데이트 diff --git a/src/pages/Timetable/timeTableInfo.ts b/src/pages/Timetable/timeTableInfo.ts index 5c93998..d3bb607 100644 --- a/src/pages/Timetable/timeTableInfo.ts +++ b/src/pages/Timetable/timeTableInfo.ts @@ -30,6 +30,7 @@ import { ARTIST_ROY_URL, } from "../../shared/mainPageConst.ts"; import { timeTableInfoProps } from "../../shared/types/timeTable.ts"; +import { DEMO_DATE } from "./utils.tsx"; const apink: artistInfoListProps = { name: "에이핑크", @@ -79,6 +80,25 @@ const futurePubInfo: artistInfoListProps = { url: `/booth_foodtruck_list/booth/a`, }; +function fillDemoData(): timeTableInfoProps[] { + const ret: timeTableInfoProps[] = []; + for (let i = 0; i < 24; i += 2) { + ret.push({ + title: `${i}시 ~ ${i + 2}시 일정`, + description: "시연용 데이터", + link: { + text: "(코드 보러가기)", + url: "https://github.com/flareseek/KNU-festival24/tree/release/src/pages/Timetable", + }, + descriptionShow: true, + date: DEMO_DATE, + startTime: new Date(DEMO_DATE.getTime() + i * 60000 * 60), + endTime: new Date(DEMO_DATE.getTime() + (i + 2) * 60000 * 60), + }); + } + return ret; +} + export const timeTableInfo: timeTableInfoProps[] = [ { title: "상시 프로그램 진행", @@ -530,4 +550,5 @@ export const timeTableInfo: timeTableInfoProps[] = [ startTime: new Date("2024-09-26 18:00"), endTime: new Date("2024-09-27 01:00"), }, + ...fillDemoData(), ]; diff --git a/src/pages/Timetable/utils.tsx b/src/pages/Timetable/utils.tsx index 09d4551..2c84b1c 100644 --- a/src/pages/Timetable/utils.tsx +++ b/src/pages/Timetable/utils.tsx @@ -12,18 +12,6 @@ import { timeTableFilterProps, timeTableInfoProps } from "../../shared/types/timeTable.ts"; -/** - * 일별 필터 버튼 - * name: 버튼 이름 - * date: 필터링할 날짜 - */ -export const TIME_TABLE_FILTER: timeTableFilterProps[] = [ - { name: "1일차", date: new Date("2024-09-23T00:00:00+09:00") }, - { name: "2일차", date: new Date("2024-09-24T00:00:00+09:00") }, - { name: "3일차", date: new Date("2024-09-25T00:00:00+09:00") }, - { name: "4일차", date: new Date("2024-09-26T00:00:00+09:00") }, -]; - /** * 축제 시작일 */ @@ -42,6 +30,24 @@ export const clearTime = (date: Date): Date => { return new Date(date.getFullYear(), date.getMonth(), date.getDate()); }; +/** + * 데모용 날짜(현재 날짜) + */ +export const DEMO_DATE = clearTime(new Date()); + +/** + * 일별 필터 버튼 + * name: 버튼 이름 + * date: 필터링할 날짜 + */ +export const TIME_TABLE_FILTER: timeTableFilterProps[] = [ + { name: "1일차", date: new Date("2024-09-23T00:00:00+09:00") }, + { name: "2일차", date: new Date("2024-09-24T00:00:00+09:00") }, + { name: "3일차", date: new Date("2024-09-25T00:00:00+09:00") }, + { name: "4일차", date: new Date("2024-09-26T00:00:00+09:00") }, + { name: "demo", date: DEMO_DATE }, +]; + /** * Date 객체가 들어왔을때 시간을 mm:hh 형식으로 변환 * @param date diff --git a/src/shared/firebase/mockData.ts b/src/shared/firebase/mockData.ts new file mode 100644 index 0000000..76d72b1 --- /dev/null +++ b/src/shared/firebase/mockData.ts @@ -0,0 +1,88 @@ +/** + * @license + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * All contributors who participated in development before September 26, 2024, retain full copyright over their contributions. + * These contributors are granted the right, under a Contributor License Agreement (CLA), to use, modify, and distribute their contributions + * under additional or alternative licensing terms of their choosing, while the project as a whole remains licensed under the MPL 2.0. + * + * Any contributions made after September 26, 2024, are subject to the terms of the MPL 2.0 and are licensed accordingly. + */ + +import { NoticeDto } from "../types/notice.ts"; + +export const noticeData: NoticeDto[] = [ + { + id: "1", + createdAt: new Date(), + order: 1, + renewal: true, + title: "2024 강원대학교 백령대동제 개최 안내", + contents: "백엔드 서버 서비스 종료에 따라 임시 데이터를 제공합니다. a", + }, + { + id: "2", + createdAt: new Date(), + order: 2, + renewal: true, + title: "2024 강원대학교 백령대동제 개최 안내", + contents: "백엔드 서버 서비스 종료에 따라 임시 데이터를 제공합니다. b", + }, + { + id: "3", + createdAt: new Date(), + order: 3, + renewal: true, + title: "신규 게시물", + contents: "백엔드 서버 서비스 종료에 따라 임시 데이터를 제공합니다. c", + }, + { + id: "4", + createdAt: new Date(), + order: 4, + renewal: false, + title: "2024 강원대학교 백령대동제 개최 안내", + contents: "백엔드 서버 서비스 종료에 따라 임시 데이터를 제공합니다. d", + }, + { + id: "5", + createdAt: new Date(), + order: 5, + renewal: false, + title: "신규 게시물", + contents: "백엔드 서버 서비스 종료에 따라 임시 데이터를 제공합니다. e", + }, + { + id: "6", + createdAt: new Date(), + order: 6, + renewal: false, + title: "2024 강원대학교 백령대동제 개최 안내", + contents: "백엔드 서버 서비스 종료에 따라 임시 데이터를 제공합니다. f", + }, + { + id: "7", + createdAt: new Date(), + order: 7, + renewal: false, + title: "신규 게시물", + contents: "백엔드 서버 서비스 종료에 따라 임시 데이터를 제공합니다. g", + }, + { + id: "8", + createdAt: new Date(), + order: 8, + renewal: false, + title: "2024 강원대학교 백령대동제 개최 안내", + contents: "여기는 룰루입니다. Notice 1에 대한 정보가 더 있습니다. h", + }, + { + id: "9", + createdAt: new Date(), + order: 9, + renewal: false, + title: "신규 게시물", + contents: "여기는 부스내용입니다. Notice 1에 대한 정보가 더 있습니다. i", + }, +]; diff --git a/src/shared/routing/routerInfo.ts b/src/shared/routing/routerInfo.ts index a3ce0f7..c94db9c 100644 --- a/src/shared/routing/routerInfo.ts +++ b/src/shared/routing/routerInfo.ts @@ -96,6 +96,14 @@ export const routerInfo: routerInfoType[] = [ mainPage: true, scrollOptions: "never", }, + { + path: "site_info", + element: lazy(() => import("../../components/SiteInfo")), + english: "Site Information", + korean: "사이트 정보", + expose: false, + mainPage: false, + }, ]; export default routerInfo; diff --git a/src/shared/types/stieInfoTypes.ts b/src/shared/types/stieInfoTypes.ts new file mode 100644 index 0000000..1bb6904 --- /dev/null +++ b/src/shared/types/stieInfoTypes.ts @@ -0,0 +1,33 @@ +/** + * @license + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * All contributors who participated in development before September 26, 2024, retain full copyright over their contributions. + * These contributors are granted the right, under a Contributor License Agreement (CLA), to use, modify, and distribute their contributions + * under additional or alternative licensing terms of their choosing, while the project as a whole remains licensed under the MPL 2.0. + * + * Any contributions made after September 26, 2024, are subject to the terms of the MPL 2.0 and are licensed accordingly. + */ + +export interface personProps { + name: string; + email: string; + github?: string; + website?: string; + responsibilities?: string[]; +} + +export interface categoryProps { + label: string; + people: personProps[]; +} + +export interface siteDataProps { + creators: { + label: string; + manager: categoryProps; + developers: categoryProps; + designers: categoryProps; + }; +}