327 lines
8.5 KiB
Plaintext
327 lines
8.5 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Poke | Subscriptions</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<link href="/css/yt-ukraine.svg?v=6" rel="icon">
|
|
<link href="/css/app.main.css?v=44600" rel="stylesheet">
|
|
|
|
<style>
|
|
:root {
|
|
--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;
|
|
--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{
|
|
font-family:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu;
|
|
color:var(--ink);
|
|
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%}
|
|
50%{background-position:100% 50%}
|
|
100%{background-position:0 50%}
|
|
}
|
|
|
|
a{color:inherit;text-decoration:none}
|
|
|
|
.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-right:1px solid var(--border);
|
|
display:flex;
|
|
flex-direction:column;
|
|
box-shadow:var(--shadow);
|
|
}
|
|
|
|
header{
|
|
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.5rem;
|
|
font-weight:800;
|
|
background:linear-gradient(90deg,#a5e1ff,#66ccff 70%);
|
|
-webkit-background-clip:text;
|
|
-webkit-text-fill-color:transparent;
|
|
margin:0;
|
|
}
|
|
.uid{
|
|
font-size:12px;
|
|
color:var(--muted);
|
|
background:rgba(255,255,255,0.08);
|
|
padding:4px 10px;
|
|
border-radius:999px;
|
|
border:1px solid var(--border);
|
|
}
|
|
|
|
.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);
|
|
}
|
|
.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;
|
|
}
|
|
|
|
main{
|
|
background:rgba(255,255,255,0.03);
|
|
backdrop-filter:blur(var(--blur));
|
|
-webkit-backdrop-filter:blur(var(--blur));
|
|
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;
|
|
}
|
|
iframe{
|
|
width:100%;
|
|
height:100%;
|
|
border:none;
|
|
border-radius:0;
|
|
}
|
|
.placeholder{
|
|
color:var(--muted);
|
|
font-size:15px;
|
|
text-align:center;
|
|
padding:20px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="layout">
|
|
<aside>
|
|
<header>
|
|
<h1>Subscriptions</h1>
|
|
<span class="uid"><%= userid %></span>
|
|
</header>
|
|
|
|
<div class="search-bar">
|
|
<input id="search" type="text" placeholder="Search channels">
|
|
<button id="clearSearch">Clear</button>
|
|
</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 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");
|
|
|
|
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);
|
|
});
|
|
});
|
|
|
|
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>
|
|
</html>
|