-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
112 lines (100 loc) · 4.25 KB
/
Copy pathindex.html
File metadata and controls
112 lines (100 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="学務情報システムの単位修得状況から現在必要単位数を満たしているかを一発で確認するブックマークレット">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sakura.css/css/sakura.css" type="text/css">
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.13.5/dist/cdn.min.js"></script>
<style>
table {
background-color: #ddd;
font-size: 12pt;
text-align: center;
color: black;
}
@media (max-width: 684px) {
table {
font-size: 10pt;
}
}
td,
th {
border: 2px #f9f9f9 solid;
padding: 3px;
}
tr:first-child {
background-color: #99CC33;
}
</style>
<script>
const records = [
{ name: "大学院基礎教育科目", required: "2.0", acquired: "0.0" },
{ name: "大学院実践教育科目", required: "8.0", acquired: "3.0" },
{ name: "大学院輪講", required: "4.0", acquired: "1.0" },
{ name: "大学院技術英語", required: "2.0", acquired: "2.0" },
{ name: "大学院産学連携科目", required: "2.0", acquired: "0.0" },
{ name: "大学院専門教育科目", required: "18.0", acquired: "13.0" },
{ name: "専門科目Ⅰ", required: "10.0", acquired: "7.0" },
{ name: "必修科目", required: "4.0", acquired: "1.0" },
{ name: "選択科目", required: "6.0", acquired: "6.0" },
{ name: "専門科目Ⅱ", required: "8.0", acquired: "12.0" },
{ name: "所属専攻", required: "6.0", acquired: "6.0" },
{ name: "他所属専攻", required: "0.0", acquired: "0.0" },
{ name: "他専攻", required: "0.0", acquired: "0.0" },
{ name: "他大学院", required: "0.0", acquired: "3.0" },
];
const isDebug = new URLSearchParams(window.location.search).get('debug') === 'true';
if (!isDebug) {
console.log('開発者向け: このページにクエリパラメータ `?debug=true` をつけると、ブックマークレットのリンクが開発モードになります');
console.log('https://trpfrog.github.io/uec-fulfilled/demo?debug=true');
}
const bookmarklet = `javascript:(function(){var s=document.createElement('script');s.src='${isDebug ? 'http://localhost:3000' : 'https://trpfrog.github.io/uec-fulfilled/index.js'}';document.body.appendChild(s);})();`;
</script>
<title>uec-fulfilled</title>
</head>
<body>
<h1>uec-fulfilled</h1>
<main x-data="{ isDebug, bookmarklet }">
<template x-if="isDebug">
<p>
<span style="color: red; font-weight: bold;">開発者モード</span>
<span><a href="./demo.html">通常のページに戻る</a></span>
</p>
</template>
<p>
<a href="https://www.uec.ac.jp/campus/academic/">学務情報システム</a>の単位修得状況から、現在自分が必要単位数を満たしているかを一発で確認するブックマークレット
</p>
<p>
GitHub: <a href="https://github.com/trpfrog/uec-fulfilled">https://github.com/trpfrog/uec-fulfilled</a>
</p>
<h2>Installation</h2>
<p>
「<a x-bind:href="bookmarklet">残り単位数の表示</a>」←このリンクをブックマークバーにドラッグするか、下のコードをブックマークレットとして登録してください。
</p>
<pre x-text="bookmarklet"></pre>
<h2>Demo</h2>
<p>
導入したブックマークレットを使用するか、
「<a x-bind:href="bookmarklet" style="font-weight: bold">残り単位数の表示</a>」←これをクリックすると下の単位修得状況の表が変化します。
(スクリプトの読み込みに数秒かかります)
</p>
<table x-data="{ records }">
<tbody>
<tr>
<th>区分</th>
<th>所要単位</th>
<th>修得単位</th>
</tr>
<template x-for="{ name, required, acquired } in records">
<tr>
<td x-text="name"></td>
<td x-text="required"></td>
<td x-text="acquired"></td>
</tr>
</template>
</tbody>
</table>
</main>
</body>
</html>