-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from itsu-dev/create-timetable
Create timetable
- Loading branch information
Showing
18 changed files
with
1,036 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ | ||
"files": { | ||
"main.css": "/scs-migration-checker/static/css/main.dade9586.css", | ||
"main.js": "/scs-migration-checker/static/js/main.fb1af705.js", | ||
"main.js": "/scs-migration-checker/static/js/main.33ffe542.js", | ||
"index.html": "/scs-migration-checker/index.html", | ||
"main.dade9586.css.map": "/scs-migration-checker/static/css/main.dade9586.css.map", | ||
"main.fb1af705.js.map": "/scs-migration-checker/static/js/main.fb1af705.js.map" | ||
"main.33ffe542.js.map": "/scs-migration-checker/static/js/main.33ffe542.js.map" | ||
}, | ||
"entrypoints": [ | ||
"static/css/main.dade9586.css", | ||
"static/js/main.fb1af705.js" | ||
"static/js/main.33ffe542.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="ja"><head><meta charset="utf-8"/><title>ITF.scs 移行要件チェックツール</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Sans+JP"/><link rel="stylesheet" href="css/core.css"/><meta name="google-site-verification" content="qX9Nx5fsCuoBuFc2rnAZcqVvuLZoxwaBuSiQkk-snuA"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="筑波大学 総合学域群 移行要件チェックツール"/><meta name="keywords" content="筑波大学,総合学域群,移行,移行要件,scs,scs-migration-checker,KdB,kdb"/><meta name="author" content="ちゅるり"/><meta name="twitter:card" content="summary"/><meta name="twitter:creator" content="@chururi_"/><meta name="twitter:site" content="@chururi_"/><meta property="og:url" content="https://itsu-dev.github.io/scs-migration-checker/"/><meta property="og:title" content="筑波大学 総合学域群 移行要件チェックツール"/><meta property="og:description" content="筑波大学 総合学域群 移行要件チェックツール"/><script type="text/javascript">!function(n){if("/"===n.search[1]){var a=n.search.slice(1).split("&").map((function(n){return n.replace(/~and~/g,"&")})).join("?");window.history.replaceState(null,null,n.pathname.slice(0,-1)+a+n.hash)}}(window.location)</script><script defer="defer" src="/scs-migration-checker/static/js/main.fb1af705.js"></script><link href="/scs-migration-checker/static/css/main.dade9586.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> | ||
<!doctype html><html lang="ja"><head><meta charset="utf-8"/><title>ITF.scs 移行要件チェックツール</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Sans+JP"/><link rel="stylesheet" href="css/core.css"/><meta name="google-site-verification" content="qX9Nx5fsCuoBuFc2rnAZcqVvuLZoxwaBuSiQkk-snuA"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="筑波大学 総合学域群 移行要件チェックツール"/><meta name="keywords" content="筑波大学,総合学域群,移行,移行要件,scs,scs-migration-checker,KdB,kdb"/><meta name="author" content="ちゅるり"/><meta name="twitter:card" content="summary"/><meta name="twitter:creator" content="@chururi_"/><meta name="twitter:site" content="@chururi_"/><meta property="og:url" content="https://itsu-dev.github.io/scs-migration-checker/"/><meta property="og:title" content="筑波大学 総合学域群 移行要件チェックツール"/><meta property="og:description" content="筑波大学 総合学域群 移行要件チェックツール"/><script type="text/javascript">!function(n){if("/"===n.search[1]){var a=n.search.slice(1).split("&").map((function(n){return n.replace(/~and~/g,"&")})).join("?");window.history.replaceState(null,null,n.pathname.slice(0,-1)+a+n.hash)}}(window.location)</script><script defer="defer" src="/scs-migration-checker/static/js/main.33ffe542.js"></script><link href="/scs-migration-checker/static/css/main.dade9586.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import {KdB, kdb} from "./App"; | ||
|
||
const seasons = ["春", "秋"]; | ||
const seasonModules = ["A", "B", "C"]; | ||
const weeks = ["月", "火", "水", "木", "金"]; | ||
|
||
export const searchKdBWithModule = (module: string, time: string): Array<Array<string>> => { | ||
const result: Array<Array<string>> = []; | ||
Array.from(kdb.data.values()) | ||
.filter(kdbData => { | ||
return getSeasonsArray(kdbData).includes(module) && getTimesArray(kdbData)[0].includes(time); | ||
}) | ||
.forEach(kdbData => { | ||
/* | ||
if (result.filter(data => data[0] === kdbData[0]).length == 0) { | ||
result.push(kdbData); | ||
} | ||
*/ | ||
result.push(kdbData); | ||
}) | ||
return result; | ||
} | ||
|
||
export const getSeasonsArray = (kdbData: Array<string>): Array<string> => { | ||
// 開講時期をパース | ||
let season = ""; | ||
const seasonsArray: string[] = []; // 結果 | ||
|
||
// 1文字ずつ調べる | ||
for (let i = 0; i < kdbData[1].length; i++) { | ||
const char = kdbData[1].charAt(i); // i文字目 | ||
// 春または秋だったら | ||
if (seasons.includes(char)) { | ||
season = char; // 保存しておく | ||
|
||
// A, B, Cのいずれかだったら | ||
} else if (seasonModules.includes(char)) { | ||
seasonsArray.push(season + char); // 結果として保存(ex.春A) | ||
} | ||
} | ||
|
||
return seasonsArray; | ||
} | ||
|
||
export const getTimesArray = (kdbData: Array<string>): [Array<string>, boolean] => { | ||
let week = ""; | ||
let needConsul = false; | ||
const timesArray: string[] = []; // 結果 | ||
|
||
// 生データ,で区切られているので,で区切る | ||
kdbData[2].split(",").forEach((split) => { | ||
// 応談じゃなかったら | ||
if (split !== "応談") { | ||
// 1文字ずつ調べる | ||
for (let i = 0; i < split.length; i++) { | ||
const char = split.charAt(i); // i文字目 | ||
// 月~金のいずれかだったら | ||
if (weeks.includes(char)) { | ||
week = char; // 保存しておく | ||
|
||
// そうでなければ数字と判断する | ||
} else { | ||
timesArray.push(week + char) // 結果として保存(ex.月6) | ||
} | ||
} | ||
|
||
// 応談だったらその旨をメッセージに記載 | ||
} else { | ||
needConsul = true; | ||
} | ||
}); | ||
return [timesArray, needConsul] | ||
} | ||
|
||
export const getSeasonByName = (name: string): string | null => { | ||
const filtered = Array.from(kdb.data.values()).filter((value) => value[0] === name) | ||
return filtered ? `${filtered[0][1]} ${filtered[0][2]}` : null | ||
} | ||
|
||
export const isOnline = (kdbData: Array<string>): boolean => { | ||
return kdbData[4].includes("オンライン") || kdbData[4].includes("オンデマンド"); | ||
} | ||
|
||
export const needSubscribe = (kdbData: Array<string>): boolean => { | ||
return kdbData[4].includes("事前登録対象"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export type MenuItem = { | ||
text: string, | ||
selectedCondition: (text: string) => boolean, | ||
onClick: () => void | ||
} | ||
|
||
export type MenuBarProps = { | ||
menuItems: MenuItem[] | ||
} | ||
|
||
const MenuBar: React.FC<MenuBarProps> = (props: MenuBarProps) => { | ||
return ( | ||
<div className={"menu menu-bar"}> | ||
{props.menuItems.map((menuItem, index) => | ||
<div key={index} className={`menu-item ${menuItem.selectedCondition(menuItem.text) && "selected"}`} onClick={menuItem.onClick}> | ||
{menuItem.text} | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default MenuBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
th { | ||
background-color: #00c0d4; | ||
color: white; | ||
font-weight: normal; | ||
border-style: none; | ||
} | ||
|
||
td.time, th.time { | ||
background-color: #00c0d4; | ||
color: white; | ||
font-weight: normal; | ||
border-style: none; | ||
width: 1.0em; | ||
} | ||
|
||
div.section { | ||
margin-bottom: 1.0em; | ||
} | ||
|
||
.section p { | ||
margin: 0 0 0.25em; | ||
} | ||
|
||
.contents-box h3 { | ||
padding: 0; | ||
margin: 0 0 0.25em; | ||
background: transparent; | ||
border: none; | ||
font-weight: normal; | ||
font-size: 1.2em; | ||
} | ||
|
||
.timetable-base { | ||
display: flex; | ||
width: 100%; | ||
} | ||
|
||
.timetable-box { | ||
width: 70%; | ||
margin-right: 0.5em; | ||
} | ||
|
||
.timetable-box table { | ||
table-layout: fixed; | ||
} | ||
|
||
.contents-box { | ||
width: 30%; | ||
margin-left: 0.5em; | ||
} | ||
|
||
.departments-box { | ||
max-height: 150px; | ||
overflow-y: scroll; | ||
} | ||
|
||
.departments-box label { | ||
margin-left: 1.0em; | ||
cursor: pointer; | ||
} | ||
|
||
.department-checkbox { | ||
display: block; | ||
cursor: pointer; | ||
} | ||
|
||
.selected-departments-box { | ||
margin-left: 1.0em; | ||
} |
Oops, something went wrong.