Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion online_class_platform_v4/class_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 수업 상세</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 수업 목록</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/create_class.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 수업 생성</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 홈</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
8 changes: 6 additions & 2 deletions online_class_platform_v4/live_class.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 라이브</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<!-- LiveKit 웹 클라이언트 (vendor 복사본 사용) -->
<script src="vendor/livekit-client.umd.js"></script>
<script src="vendor/livekit-client.umd.js" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 로그인</title>
<link rel="stylesheet" href="style.css" />
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<!-- Supabase SDK must be loaded before our script -->
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 로그아웃</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
27 changes: 17 additions & 10 deletions online_class_platform_v4/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,14 @@ function sleep(ms = 0) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

function scheduleIdleTask(fn, timeout = 800) {
if (typeof fn !== "function") return null;
if (typeof requestIdleCallback === "function") {
return requestIdleCallback(() => fn(), { timeout });
}
return setTimeout(fn, Math.min(timeout, 300));
}

function isHttpLike(u) {
return /^https?:\/\//i.test(u || "");
}
Expand Down Expand Up @@ -1468,8 +1476,6 @@ async function loadLocalSampleClasses() {

async function ensureSeedData() {
const sessionPromise = syncLocalUserFromSupabaseSession().catch(() => {});
await Promise.race([sessionPromise, sleep(1200)]);

const detailOnly = !!document.getElementById("detailRoot") && !document.getElementById("classGrid") && !document.getElementById("homePopular");

const cached = loadCachedClasses();
Expand Down Expand Up @@ -1507,7 +1513,7 @@ async function ensureSeedData() {

// 원격 수업 목록
if (!detailOnly) {
(async () => {
scheduleIdleTask(() => (async () => {
try {
const classes = await apiGet("/api/classes", { silent: true });
const normalized = (classes || []).map(c => ({
Expand All @@ -1521,7 +1527,7 @@ async function ensureSeedData() {
} catch (e) {
console.error("classes fetch failed", e);
}
})();
})());
}

let enrollFetchPromise = null;
Expand Down Expand Up @@ -1556,11 +1562,13 @@ async function ensureSeedData() {
try {
const u = getUser();
if (u) {
try {
await loadEnrollmentsFor(u);
} catch (e) {
console.error("enrollments fetch failed (late)", e);
}
scheduleIdleTask(async () => {
try {
await loadEnrollmentsFor(u);
} catch (e) {
console.error("enrollments fetch failed (late)", e);
}
});
}
rerenderVisible();
updateNav();
Expand Down Expand Up @@ -4924,4 +4932,3 @@ function init() {

document.addEventListener("DOMContentLoaded", init);


6 changes: 5 additions & 1 deletion online_class_platform_v4/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 설정</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 회원가입</title>
<link rel="stylesheet" href="style.css" />
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<!-- Load Supabase SDK before our script -->
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/student_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 학생 대시보드</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion online_class_platform_v4/teacher_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LessonBay - 선생님 대시보드</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://pqvdexhxytahljultmjd.supabase.co" />
<link rel="dns-prefetch" href="https://pqvdexhxytahljultmjd.supabase.co" />
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" defer></script>
<script src="script.js" defer></script>
</head>
<body>
Expand Down