Skip to content

Commit 7fd6482

Browse files
committed
update css
1 parent 0eede11 commit 7fd6482

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/popup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ function setupEventListeners() {
5454

5555
try {
5656
const events = await fetchCalendarData(sesskey);
57+
if (events.length === 0) {
58+
document.getElementById("result").textContent = "沒有行事曆事件";
59+
return;
60+
}
5761
downloadICS(events);
5862
document.getElementById("result").textContent = `成功匯出 ${events.length} 個行事曆事件`;
5963
} catch (error) {

src/popup.html

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,34 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<link href="./css/output.css" rel="stylesheet" />
77
</head>
8-
<body class="p-4 w-52 flex items-center justify-center flex-col bg-white shadow-md rounded-lg">
8+
<body class="p-4 w-56 flex items-center justify-center flex-col bg-white shadow-md rounded-lg">
99
<h1 class="text-xl font-bold">Moodle Calendar</h1>
10-
<div class="my-2">
11-
<input type="number" id="yearInput" class="w-16 p-1 border rounded" />
12-
<input type="number" id="monthInput" class="w-12 p-1 border rounded" />
10+
<div class="my-2 flex items-center space-x-2">
11+
<input
12+
type="number"
13+
id="yearInput"
14+
class="w-20 px-2 py-1 text-center border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-violet-500 focus:border-violet-500"
15+
placeholder=""
16+
/>
17+
<span class="text-gray-700"></span>
18+
<input
19+
type="number"
20+
id="monthInput"
21+
class="w-16 px-2 py-1 text-center border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-violet-500 focus:border-violet-500"
22+
placeholder=""
23+
/>
24+
<span class="text-gray-700"></span>
1325
</div>
1426
<button
1527
id="exportBtn"
16-
class="bg-violet-400 text-white px-4 py-2 my-2 rounded cursor-pointer hover:bg-violet-700"
28+
class="bg-violet-400 text-white px-4 py-2 my-2 rounded-md shadow-md cursor-pointer hover:bg-violet-700 focus:outline-none focus:ring-2 focus:ring-violet-500"
1729
>
1830
取得行事曆
1931
</button>
2032
<pre id="result" class="text-sm whitespace-pre-wrap"></pre>
21-
<div>This tool help you to export your Moodle calendar events to a .ics file.</div>
33+
<div class="text-gray-600 text-sm text-center">
34+
This tool helps you export your Moodle calendar events to a .ics file.
35+
</div>
2236

2337
<!-- Use type="module" for ES module support -->
2438
<script type="module" src="./js/popup.js"></script>

0 commit comments

Comments
 (0)