Update html/account-me.ejs
This commit is contained in:
parent
b170ea4713
commit
59b2369507
@ -9,25 +9,26 @@
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--bg1:#0e0820; --bg2:#150c29; --bg3:#08121c; --bg4:#0c101b;
|
||||
--glass:rgba(255,255,255,0.06);
|
||||
--glass-border:rgba(255,255,255,0.12);
|
||||
--bg1:#10081e; --bg2:#1a0b28; --bg3:#06131a; --bg4:#0f132b;
|
||||
--glass:rgba(255,255,255,0.05);
|
||||
--border:rgba(255,255,255,0.1);
|
||||
--accent:#66ccff;
|
||||
--muted:#c9c9c9;
|
||||
--ink:#fff;
|
||||
--radius:18px;
|
||||
--blur:24px;
|
||||
--radius:16px;
|
||||
--shadow:0 4px 30px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;padding:0;height:100%}
|
||||
body{
|
||||
background:radial-gradient(circle at 20% 20%,var(--bg1),var(--bg2),var(--bg3),var(--bg4));
|
||||
background-size:400% 400%;
|
||||
animation:bg-pan 40s ease infinite;
|
||||
font-family:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu;
|
||||
color:var(--ink);
|
||||
overflow-x:hidden;
|
||||
background:radial-gradient(circle at 15% 15%,var(--bg1),var(--bg2),var(--bg3),var(--bg4));
|
||||
background-size:400% 400%;
|
||||
animation:bg-pan 60s ease infinite;
|
||||
overflow:hidden;
|
||||
}
|
||||
@keyframes bg-pan{
|
||||
0%{background-position:0 50%}
|
||||
@ -37,163 +38,288 @@
|
||||
|
||||
a{color:inherit;text-decoration:none}
|
||||
|
||||
.wrap{
|
||||
max-width:1200px;
|
||||
margin:40px auto;
|
||||
padding:20px;
|
||||
background:rgba(255,255,255,0.05);
|
||||
border:1px solid var(--glass-border);
|
||||
.layout{
|
||||
display:grid;
|
||||
grid-template-columns:300px 1fr;
|
||||
height:100vh;
|
||||
}
|
||||
@media(max-width:780px){
|
||||
.layout{grid-template-columns:1fr}
|
||||
aside{height:40vh;overflow-y:auto}
|
||||
main{height:60vh}
|
||||
}
|
||||
|
||||
aside{
|
||||
background:var(--glass);
|
||||
backdrop-filter:blur(var(--blur)) saturate(180%);
|
||||
-webkit-backdrop-filter:blur(var(--blur)) saturate(180%);
|
||||
border-radius:var(--radius);
|
||||
border-right:1px solid var(--border);
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
box-shadow:var(--shadow);
|
||||
}
|
||||
|
||||
header{
|
||||
display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:18px;
|
||||
padding:16px;
|
||||
border-bottom:1px solid var(--border);
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:space-between;
|
||||
}
|
||||
h1{
|
||||
font-family:"poketube flex",system-ui;
|
||||
font-size:1.8rem;
|
||||
font-size:1.5rem;
|
||||
font-weight:800;
|
||||
background:linear-gradient(90deg,#9fe6ff,#66ccff);
|
||||
background:linear-gradient(90deg,#a5e1ff,#66ccff 70%);
|
||||
-webkit-background-clip:text;
|
||||
-webkit-text-fill-color:transparent;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.tabs{
|
||||
display:flex;
|
||||
overflow-x:auto;
|
||||
gap:10px;
|
||||
background:rgba(255,255,255,0.04);
|
||||
border-radius:var(--radius);
|
||||
padding:8px 10px;
|
||||
border:1px solid var(--glass-border);
|
||||
scrollbar-width:none;
|
||||
}
|
||||
.tabs::-webkit-scrollbar{display:none}
|
||||
.tab{
|
||||
flex:0 0 auto;
|
||||
padding:10px 16px;
|
||||
border-radius:12px;
|
||||
font-size:15px;
|
||||
.uid{
|
||||
font-size:12px;
|
||||
color:var(--muted);
|
||||
background:rgba(255,255,255,0.08);
|
||||
border:1px solid transparent;
|
||||
transition:all .25s ease;
|
||||
cursor:pointer;
|
||||
white-space:nowrap;
|
||||
padding:4px 10px;
|
||||
border-radius:999px;
|
||||
border:1px solid var(--border);
|
||||
}
|
||||
.tab:hover{
|
||||
|
||||
.search-bar{
|
||||
display:flex;
|
||||
align-items:center;
|
||||
gap:8px;
|
||||
background:rgba(255,255,255,0.06);
|
||||
border:1px solid var(--border);
|
||||
border-radius:12px;
|
||||
margin:12px;
|
||||
padding:6px 10px;
|
||||
}
|
||||
.search-bar input{
|
||||
all:unset;
|
||||
flex:1;
|
||||
font-size:14px;
|
||||
}
|
||||
.search-bar button{
|
||||
all:unset;
|
||||
cursor:pointer;
|
||||
font-size:12px;
|
||||
padding:4px 8px;
|
||||
border-radius:8px;
|
||||
background:rgba(255,255,255,0.1);
|
||||
border:1px solid var(--border);
|
||||
transition:background .2s ease;
|
||||
}
|
||||
.search-bar button:hover{background:rgba(255,255,255,0.2)}
|
||||
|
||||
.sort{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
gap:8px;
|
||||
margin:0 12px 10px;
|
||||
}
|
||||
.sort button{
|
||||
all:unset;
|
||||
padding:6px 10px;
|
||||
border-radius:8px;
|
||||
background:rgba(255,255,255,0.08);
|
||||
border:1px solid var(--border);
|
||||
font-size:13px;
|
||||
cursor:pointer;
|
||||
}
|
||||
.sort button.active{
|
||||
background:rgba(255,255,255,0.25);
|
||||
border-color:var(--accent);
|
||||
}
|
||||
|
||||
.channel-list{
|
||||
flex:1;
|
||||
overflow-y:auto;
|
||||
padding:6px 8px;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
gap:6px;
|
||||
}
|
||||
.channel{
|
||||
display:flex;
|
||||
align-items:center;
|
||||
gap:10px;
|
||||
padding:8px 10px;
|
||||
border-radius:10px;
|
||||
background:rgba(255,255,255,0.05);
|
||||
border:1px solid transparent;
|
||||
transition:all .2s ease;
|
||||
cursor:pointer;
|
||||
}
|
||||
.channel:hover{
|
||||
background:rgba(255,255,255,0.15);
|
||||
}
|
||||
.tab.active{
|
||||
background:linear-gradient(120deg,rgba(102,204,255,0.25),rgba(102,204,255,0.05));
|
||||
border:1px solid var(--accent);
|
||||
box-shadow:0 0 10px rgba(102,204,255,0.3);
|
||||
.channel.active{
|
||||
border-color:var(--accent);
|
||||
background:linear-gradient(135deg,rgba(102,204,255,0.15),rgba(102,204,255,0.05));
|
||||
box-shadow:0 0 8px rgba(102,204,255,0.25);
|
||||
}
|
||||
.channel img{
|
||||
width:34px;
|
||||
height:34px;
|
||||
border-radius:50%;
|
||||
object-fit:cover;
|
||||
}
|
||||
.channel-name{
|
||||
flex:1;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.content{
|
||||
margin-top:18px;
|
||||
border-radius:var(--radius);
|
||||
border:1px solid var(--glass-border);
|
||||
background:var(--glass);
|
||||
main{
|
||||
background:rgba(255,255,255,0.03);
|
||||
backdrop-filter:blur(var(--blur));
|
||||
-webkit-backdrop-filter:blur(var(--blur));
|
||||
box-shadow:var(--shadow);
|
||||
height:70vh;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
height:100%;
|
||||
}
|
||||
.toolbar{
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:space-between;
|
||||
padding:12px 16px;
|
||||
border-bottom:1px solid var(--border);
|
||||
background:rgba(255,255,255,0.04);
|
||||
}
|
||||
.toolbar .btn{
|
||||
all:unset;
|
||||
padding:6px 12px;
|
||||
border-radius:8px;
|
||||
background:rgba(255,255,255,0.08);
|
||||
border:1px solid var(--border);
|
||||
font-size:13px;
|
||||
cursor:pointer;
|
||||
transition:background .2s ease;
|
||||
}
|
||||
.toolbar .btn:hover{background:rgba(255,255,255,0.2)}
|
||||
|
||||
.viewer{
|
||||
flex:1;
|
||||
overflow:hidden;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
iframe{
|
||||
width:100%;
|
||||
height:100%;
|
||||
border:none;
|
||||
border-radius:inherit;
|
||||
border-radius:0;
|
||||
}
|
||||
|
||||
.placeholder{
|
||||
color:var(--muted);
|
||||
font-size:15px;
|
||||
text-align:center;
|
||||
padding:20px;
|
||||
}
|
||||
|
||||
.uid{
|
||||
display:inline-flex;align-items:center;gap:6px;
|
||||
background:rgba(255,255,255,0.08);
|
||||
border-radius:999px;
|
||||
padding:4px 10px;
|
||||
border:1px solid var(--glass-border);
|
||||
font-size:12px;
|
||||
color:var(--muted);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<header>
|
||||
<h1>My Subscriptions</h1>
|
||||
<span class="uid">User: <%= userid %></span>
|
||||
</header>
|
||||
<div class="layout">
|
||||
<aside>
|
||||
<header>
|
||||
<h1>Subscriptions</h1>
|
||||
<span class="uid"><%= userid %></span>
|
||||
</header>
|
||||
|
||||
<%
|
||||
const subKeys = (userSubs && Object.keys(userSubs)) || [];
|
||||
const subCount = subKeys.length;
|
||||
const channels = subKeys.map(id => ({
|
||||
id,
|
||||
name: userSubs[id]?.channelName || "Unknown",
|
||||
avatar: userSubs[id]?.avatar
|
||||
}));
|
||||
channels.sort((a,b)=>a.name.localeCompare(b.name,'en',{sensitivity:'base'}));
|
||||
%>
|
||||
|
||||
<div class="tabs" id="tabs">
|
||||
<% channels.forEach(c => { %>
|
||||
<div class="tab" data-channel="<%= c.id %>">
|
||||
<img src="<%= c.avatar %>" alt="" width="20" height="20" style="border-radius:50%;vertical-align:middle;margin-right:6px">
|
||||
<%= c.name %>
|
||||
</div>
|
||||
<% }) %>
|
||||
</div>
|
||||
|
||||
<div class="content" id="content">
|
||||
<div class="placeholder">
|
||||
Select a channel tab above to view its content.
|
||||
<div class="search-bar">
|
||||
<input id="search" type="text" placeholder="Search channels">
|
||||
<button id="clearSearch">Clear</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sort">
|
||||
<button id="sortAZ" class="active">A→Z</button>
|
||||
<button id="sortZA">Z→A</button>
|
||||
</div>
|
||||
|
||||
<%
|
||||
const subKeys = (userSubs && Object.keys(userSubs)) || [];
|
||||
const subs = subKeys.map(id => ({
|
||||
id,
|
||||
name: userSubs[id]?.channelName || "Unknown",
|
||||
avatar: userSubs[id]?.avatar
|
||||
}));
|
||||
subs.sort((a,b)=>a.name.localeCompare(b.name,'en',{sensitivity:'base'}));
|
||||
%>
|
||||
|
||||
<div class="channel-list" id="channelList">
|
||||
<% subs.forEach(c => { %>
|
||||
<div class="channel" data-id="<%= c.id %>" data-name="<%= c.name.toLowerCase() %>">
|
||||
<img src="<%= c.avatar %>" alt="">
|
||||
<div class="channel-name"><%= c.name %></div>
|
||||
</div>
|
||||
<% }) %>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main>
|
||||
<div class="toolbar">
|
||||
<span id="channelTitle">Select a channel</span>
|
||||
<a href="/api/get-channel-subs?ID=<%= encodeURIComponent(userid) %>" class="btn">View JSON</a>
|
||||
</div>
|
||||
<div class="viewer" id="viewer">
|
||||
<div class="placeholder">Choose a channel from the sidebar to view its content.</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded",()=>{
|
||||
const tabs=document.querySelectorAll(".tab");
|
||||
const content=document.getElementById("content");
|
||||
const channels=[...document.querySelectorAll(".channel")];
|
||||
const search=document.getElementById("search");
|
||||
const clear=document.getElementById("clearSearch");
|
||||
const sortAZ=document.getElementById("sortAZ");
|
||||
const sortZA=document.getElementById("sortZA");
|
||||
const list=document.getElementById("channelList");
|
||||
const viewer=document.getElementById("viewer");
|
||||
const title=document.getElementById("channelTitle");
|
||||
|
||||
tabs.forEach(tab=>{
|
||||
tab.addEventListener("click",()=>{
|
||||
tabs.forEach(t=>t.classList.remove("active"));
|
||||
tab.classList.add("active");
|
||||
const id=tab.dataset.channel;
|
||||
content.innerHTML=
|
||||
`<iframe src="/channel?id=${encodeURIComponent(id)}" allowfullscreen loading="lazy"></iframe>`;
|
||||
function renderIframe(id,name){
|
||||
viewer.innerHTML=`<iframe src="/channel?id=${encodeURIComponent(id)}" loading="lazy" allowfullscreen></iframe>`;
|
||||
title.textContent=name;
|
||||
}
|
||||
|
||||
channels.forEach(ch=>{
|
||||
ch.addEventListener("click",()=>{
|
||||
channels.forEach(c=>c.classList.remove("active"));
|
||||
ch.classList.add("active");
|
||||
renderIframe(ch.dataset.id,ch.querySelector(".channel-name").textContent);
|
||||
});
|
||||
});
|
||||
|
||||
// Keyboard navigation
|
||||
document.addEventListener("keydown",(e)=>{
|
||||
const active=document.querySelector(".tab.active");
|
||||
const index=[...tabs].indexOf(active);
|
||||
if(e.key==="ArrowRight"&&index<tabs.length-1){
|
||||
tabs[index+1].click();
|
||||
}else if(e.key==="ArrowLeft"&&index>0){
|
||||
tabs[index-1].click();
|
||||
}else if(e.key==="Home"){tabs[0].click();}
|
||||
else if(e.key==="End"){tabs[tabs.length-1].click();}
|
||||
function filter(){
|
||||
const term=search.value.toLowerCase();
|
||||
channels.forEach(c=>{
|
||||
c.style.display=c.dataset.name.includes(term)?'flex':'none';
|
||||
});
|
||||
}
|
||||
search.addEventListener("input",filter);
|
||||
clear.addEventListener("click",()=>{search.value='';filter();search.focus();});
|
||||
|
||||
sortAZ.addEventListener("click",()=>{
|
||||
sortAZ.classList.add("active");sortZA.classList.remove("active");
|
||||
sortList(true);
|
||||
});
|
||||
sortZA.addEventListener("click",()=>{
|
||||
sortZA.classList.add("active");sortAZ.classList.remove("active");
|
||||
sortList(false);
|
||||
});
|
||||
|
||||
function sortList(asc){
|
||||
const items=[...channels];
|
||||
items.sort((a,b)=>{
|
||||
return asc? a.dataset.name.localeCompare(b.dataset.name)
|
||||
: b.dataset.name.localeCompare(a.dataset.name);
|
||||
});
|
||||
items.forEach(i=>list.appendChild(i));
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user