Update index.html
Browse files- index.html +22 -29
index.html
CHANGED
|
@@ -6,23 +6,18 @@
|
|
| 6 |
<title>Chat CVNSS4.0</title>
|
| 7 |
<style>
|
| 8 |
:root{
|
| 9 |
-
/*
|
| 10 |
--bg:#f7f9fc; --card:#ffffff; --text:#1f2937; --muted:#6b7280;
|
| 11 |
--primary:#1a73e8; --danger:#d93025; --accent:#ffeb3b;
|
| 12 |
-
/*
|
| 13 |
-
--
|
| 14 |
-
|
|
|
|
| 15 |
}
|
| 16 |
*{box-sizing:border-box}
|
| 17 |
-
body{
|
| 18 |
-
margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
|
| 19 |
-
background:var(--bg); color:var(--text); display:flex; flex-direction:column; min-height:100vh;
|
| 20 |
-
}
|
| 21 |
header{padding:14px 16px;text-align:center;font-weight:700;background:#fff;border-bottom:1px solid #e5e7eb}
|
| 22 |
-
.card{
|
| 23 |
-
width:min(980px,94vw); margin:22px auto; background:var(--card);
|
| 24 |
-
border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 6px 18px rgba(0,0,0,.06); padding:18px;
|
| 25 |
-
}
|
| 26 |
h2{margin:0 0 6px} .muted{color:var(--muted)}
|
| 27 |
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
|
| 28 |
input[type=text]{flex:1 1 260px;padding:12px 14px;font-size:16px;border:1px solid #d1d5db;border-radius:10px}
|
|
@@ -33,24 +28,25 @@
|
|
| 33 |
.btn-secondary{background:#374151;color:#fff}
|
| 34 |
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
| 35 |
|
| 36 |
-
/*
|
| 37 |
.status{display:none;align-items:center;gap:10px;padding:10px 12px;border:1px dashed #d1d5db;border-radius:10px;margin-bottom:10px;background:#f9fafb}
|
| 38 |
.me-pill{display:inline-flex;align-items:center;gap:6px;background:#fff3cd;color:#7a5b00;border:1px solid #ffe8a1;padding:6px 12px;border-radius:999px;font-weight:800}
|
| 39 |
.room-pill{display:inline-block;background:#e8f0fe;color:#174ea6;padding:6px 10px;border-radius:999px}
|
| 40 |
|
| 41 |
-
/* Khung chat */
|
| 42 |
-
.chat-wrap{
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
.mask-right{
|
| 48 |
-
position:absolute;
|
| 49 |
-
pointer-events:
|
| 50 |
-
user-select:none; /* không cho bôi/copy */
|
| 51 |
}
|
| 52 |
-
.mask-top{left:0; right:0; top:0; height:var(--mask-top); box-shadow:0 8px 10px -10px rgba(0,0,0,.12)}
|
| 53 |
-
.mask-right{top:0; right:0; bottom:0; width:var(--mask-right); box-shadow:-8px 0 10px -10px rgba(0,0,0,.12)}
|
| 54 |
|
| 55 |
/* Link phòng tự ẩn */
|
| 56 |
.links{display:none;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}
|
|
@@ -59,6 +55,7 @@
|
|
| 59 |
/* Fallback khi iframe bị chặn */
|
| 60 |
.error-box{display:none;gap:10px;align-items:center;justify-content:space-between;padding:12px;border:1px solid #fecaca;background:#fef2f2;border-radius:10px;margin-top:10px}
|
| 61 |
.error-text{color:#991b1b}
|
|
|
|
| 62 |
.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);background:#111827;color:#f9fafb;border:1px solid #374151;padding:10px 14px;border-radius:10px;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s}
|
| 63 |
.toast.show{opacity:1}
|
| 64 |
footer{margin-top:auto;text-align:center;color:#6b7280;font-size:13px;padding:16px}
|
|
@@ -96,10 +93,7 @@
|
|
| 96 |
</div>
|
| 97 |
|
| 98 |
<div class="chat-wrap">
|
| 99 |
-
<!-- MASK trắng: che gọn icon mây + thanh xanh + panel phải -->
|
| 100 |
-
<div class="mask-top" aria-hidden="true"></div>
|
| 101 |
<div class="mask-right" aria-hidden="true"></div>
|
| 102 |
-
|
| 103 |
<iframe id="chatFrame" title="tlk.io chat" referrerpolicy="no-referrer"
|
| 104 |
allow="clipboard-read; clipboard-write"></iframe>
|
| 105 |
</div>
|
|
@@ -142,7 +136,6 @@
|
|
| 142 |
const timer = setTimeout(()=>{ els.err.style.display="flex"; }, 6000);
|
| 143 |
els.frame.addEventListener("load", ()=> clearTimeout(timer), {once:true});
|
| 144 |
}
|
| 145 |
-
|
| 146 |
function enterChat(){
|
| 147 |
els.login.style.display="none";
|
| 148 |
els.box.style.display="block";
|
|
@@ -170,7 +163,7 @@
|
|
| 170 |
};
|
| 171 |
});
|
| 172 |
|
| 173 |
-
// Prefill + auto-enter khi
|
| 174 |
const last = localStorage.getItem("cvnss4_name"); if(last) els.name.value = last;
|
| 175 |
syncRoomUI(); els.name.focus({preventScroll:true});
|
| 176 |
if (qs.get("room") && (last || els.name.value.trim() !== "")) enterChat();
|
|
|
|
| 6 |
<title>Chat CVNSS4.0</title>
|
| 7 |
<style>
|
| 8 |
:root{
|
| 9 |
+
/* Light theme */
|
| 10 |
--bg:#f7f9fc; --card:#ffffff; --text:#1f2937; --muted:#6b7280;
|
| 11 |
--primary:#1a73e8; --danger:#d93025; --accent:#ffeb3b;
|
| 12 |
+
/* CẮT phần đầu tlk.io (icon mây + thanh xanh) — tăng/giảm nếu cần */
|
| 13 |
+
--cut-top: 220px;
|
| 14 |
+
/* Che cột phải */
|
| 15 |
+
--mask-right: clamp(220px, 24vw, 300px);
|
| 16 |
}
|
| 17 |
*{box-sizing:border-box}
|
| 18 |
+
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);display:flex;flex-direction:column;min-height:100vh}
|
|
|
|
|
|
|
|
|
|
| 19 |
header{padding:14px 16px;text-align:center;font-weight:700;background:#fff;border-bottom:1px solid #e5e7eb}
|
| 20 |
+
.card{width:min(980px,94vw);margin:22px auto;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.06);padding:18px}
|
|
|
|
|
|
|
|
|
|
| 21 |
h2{margin:0 0 6px} .muted{color:var(--muted)}
|
| 22 |
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
|
| 23 |
input[type=text]{flex:1 1 260px;padding:12px 14px;font-size:16px;border:1px solid #d1d5db;border-radius:10px}
|
|
|
|
| 28 |
.btn-secondary{background:#374151;color:#fff}
|
| 29 |
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
| 30 |
|
| 31 |
+
/* Status gọn */
|
| 32 |
.status{display:none;align-items:center;gap:10px;padding:10px 12px;border:1px dashed #d1d5db;border-radius:10px;margin-bottom:10px;background:#f9fafb}
|
| 33 |
.me-pill{display:inline-flex;align-items:center;gap:6px;background:#fff3cd;color:#7a5b00;border:1px solid #ffe8a1;padding:6px 12px;border-radius:999px;font-weight:800}
|
| 34 |
.room-pill{display:inline-block;background:#e8f0fe;color:#174ea6;padding:6px 10px;border-radius:999px}
|
| 35 |
|
| 36 |
+
/* Khung chat: CẮT phần đầu an toàn (không chặn click/nhập) */
|
| 37 |
+
.chat-wrap{
|
| 38 |
+
position:relative; border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; background:#fff;
|
| 39 |
+
padding-top: var(--cut-top); /* chừa chỗ cho phần bị đẩy ra */
|
| 40 |
+
}
|
| 41 |
+
#chatFrame{
|
| 42 |
+
display:block; width:100%; height:72vh; min-height:640px; border:0; background:#fff;
|
| 43 |
+
transform: translateY(calc(-1 * var(--cut-top))); /* đẩy phần đầu ra ngoài khung nhìn */
|
| 44 |
+
}
|
| 45 |
+
/* Che cột phải – không chặn click (pointer-events:none) */
|
| 46 |
.mask-right{
|
| 47 |
+
position:absolute; top:0; right:0; bottom:0; width:var(--mask-right);
|
| 48 |
+
background:#fff; pointer-events:none; box-shadow:-8px 0 10px -10px rgba(0,0,0,.12); z-index:2;
|
|
|
|
| 49 |
}
|
|
|
|
|
|
|
| 50 |
|
| 51 |
/* Link phòng tự ẩn */
|
| 52 |
.links{display:none;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}
|
|
|
|
| 55 |
/* Fallback khi iframe bị chặn */
|
| 56 |
.error-box{display:none;gap:10px;align-items:center;justify-content:space-between;padding:12px;border:1px solid #fecaca;background:#fef2f2;border-radius:10px;margin-top:10px}
|
| 57 |
.error-text{color:#991b1b}
|
| 58 |
+
|
| 59 |
.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);background:#111827;color:#f9fafb;border:1px solid #374151;padding:10px 14px;border-radius:10px;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s}
|
| 60 |
.toast.show{opacity:1}
|
| 61 |
footer{margin-top:auto;text-align:center;color:#6b7280;font-size:13px;padding:16px}
|
|
|
|
| 93 |
</div>
|
| 94 |
|
| 95 |
<div class="chat-wrap">
|
|
|
|
|
|
|
| 96 |
<div class="mask-right" aria-hidden="true"></div>
|
|
|
|
| 97 |
<iframe id="chatFrame" title="tlk.io chat" referrerpolicy="no-referrer"
|
| 98 |
allow="clipboard-read; clipboard-write"></iframe>
|
| 99 |
</div>
|
|
|
|
| 136 |
const timer = setTimeout(()=>{ els.err.style.display="flex"; }, 6000);
|
| 137 |
els.frame.addEventListener("load", ()=> clearTimeout(timer), {once:true});
|
| 138 |
}
|
|
|
|
| 139 |
function enterChat(){
|
| 140 |
els.login.style.display="none";
|
| 141 |
els.box.style.display="block";
|
|
|
|
| 163 |
};
|
| 164 |
});
|
| 165 |
|
| 166 |
+
// Prefill + auto-enter khi có tên
|
| 167 |
const last = localStorage.getItem("cvnss4_name"); if(last) els.name.value = last;
|
| 168 |
syncRoomUI(); els.name.focus({preventScroll:true});
|
| 169 |
if (qs.get("room") && (last || els.name.value.trim() !== "")) enterChat();
|