From 18a85a30f4282b5d07528eb8e1dd8ff7617190d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Feb 2026 23:48:10 +0000 Subject: Add 4 CSS style themes with runtime switcher Adds a style theme system that layers additional CSS files on top of the base stylesheet. Themes are loaded/unloaded dynamically via tags. - Default: existing look, unchanged - Refined: typographic rhythm fixes, consistent spacing on settings page - Terminal: monospace, dark phosphor CRT aesthetic (scanlines, cyan glow) - Codex: book/Tufte-inspired with warm paper tones, serif type, fleurons - Sakura: Japanese-inspired calm aesthetic (named for neko = cat) Each theme supports both light and dark mode. Style selection persists in localStorage and is independent of the light/dark toggle. https://claude.ai/code/session_01Jv3c8GdaDQMm5WYwHUJMVe --- web/dist/v3/assets/index-CRt-Evnh.js | 175 +++++++++++++ web/dist/v3/assets/index-CSmzFfW5.js | 161 ------------ web/dist/v3/index.html | 2 +- web/dist/v3/themes/codex.css | 451 +++++++++++++++++++++++++++++++++ web/dist/v3/themes/refined.css | 265 ++++++++++++++++++++ web/dist/v3/themes/sakura.css | 466 +++++++++++++++++++++++++++++++++++ web/dist/v3/themes/terminal.css | 446 +++++++++++++++++++++++++++++++++ 7 files changed, 1804 insertions(+), 162 deletions(-) create mode 100644 web/dist/v3/assets/index-CRt-Evnh.js delete mode 100644 web/dist/v3/assets/index-CSmzFfW5.js create mode 100644 web/dist/v3/themes/codex.css create mode 100644 web/dist/v3/themes/refined.css create mode 100644 web/dist/v3/themes/sakura.css create mode 100644 web/dist/v3/themes/terminal.css (limited to 'web') diff --git a/web/dist/v3/assets/index-CRt-Evnh.js b/web/dist/v3/assets/index-CRt-Evnh.js new file mode 100644 index 0000000..3349411 --- /dev/null +++ b/web/dist/v3/assets/index-CRt-Evnh.js @@ -0,0 +1,175 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();function C(t){const i=`; ${document.cookie}`.split(`; ${t}=`);if(i.length===2)return i.pop()?.split(";").shift()}async function f(t,e){const i=e?.method?.toUpperCase()||"GET",a=["POST","PUT","DELETE"].includes(i),s=new Headers(e?.headers||{});if(a){const o=C("csrf_token");o&&s.set("X-CSRF-Token",o)}return fetch(t,{...e,headers:s,credentials:"include"})}function B(){const t=document.cookie.split("; ").find(e=>e.startsWith("neko_sidebar="));return t?t.split("=")[1]==="1":null}function H(t){document.cookie=`neko_sidebar=${t?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function P(){const t=B();return t!==null?t:window.innerWidth>1024}class M extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";styleTheme=localStorage.getItem("neko-style-theme")||"default";sidebarVisible=P();setFeeds(e){this.feeds=e,this.emit("feeds-updated")}setTags(e){this.tags=e,this.emit("tags-updated")}setItems(e,i=!1){i?this.items=[...this.items,...e]:this.items=e,this.emit("items-updated")}setActiveFeed(e){this.activeFeedId=e,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(e){this.activeTagName=e,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(e){this.filter!==e&&(this.filter=e,this.emit("filter-updated"))}setSearchQuery(e){this.searchQuery!==e&&(this.searchQuery=e,this.emit("search-updated"))}setLoading(e){this.loading=e,this.emit("loading-state-changed")}setHasMore(e){this.hasMore=e}setTheme(e){this.theme=e,localStorage.setItem("neko-theme",e),this.emit("theme-updated")}setFontTheme(e){this.fontTheme=e,localStorage.setItem("neko-font-theme",e),this.emit("theme-updated")}setHeadingFontTheme(e){this.headingFontTheme=e,localStorage.setItem("neko-heading-font-theme",e),this.emit("theme-updated")}setStyleTheme(e){this.styleTheme=e,localStorage.setItem("neko-style-theme",e),this.emit("style-theme-updated")}setSidebarVisible(e){this.sidebarVisible=e,H(e),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(e,i){this.dispatchEvent(new CustomEvent(e,{detail:i}))}on(e,i){this.addEventListener(e,i)}}const n=new M;class O extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const e=new URL(window.location.href),a=e.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const o={};return a[0]==="feed"&&a[1]?(s="/feed",o.feedId=a[1]):a[0]==="tag"&&a[1]?(s="/tag",o.tagName=decodeURIComponent(a[1])):a[0]==="settings"&&(s="/settings"),{path:s,params:o,query:e.searchParams}}navigate(e,i){let a=`/v3${e}`;if(i){const s=new URLSearchParams(i);a+=`?${s.toString()}`}window.history.pushState({},"",a),this.handleRouteChange()}updateQuery(e){const i=new URL(window.location.href);for(const[a,s]of Object.entries(e))s?i.searchParams.set(a,s):i.searchParams.delete(a);window.history.pushState({},"",i.toString()),this.handleRouteChange()}}const r=new O;function D(t,e=!1){const i=new Date(t.publish_date).toLocaleDateString();return` +
  • + + + ${t.full_content||t.description?` +
    + ${t.full_content||t.description} +
    + `:""} +
  • + `}const q=["default","refined","terminal","codex","sakura"];function L(t){const e=document.getElementById("style-theme-link");if(e&&e.remove(),t==="default")return;const i=document.createElement("link");i.id="style-theme-link",i.rel="stylesheet",i.href=`/v3/themes/${t}.css`,document.head.appendChild(i)}let c=null,g=null;function N(){g=document.querySelector("#app"),g&&(g.className=`theme-${n.theme} font-${n.fontTheme} heading-font-${n.headingFontTheme}`,g.innerHTML=` +
    + + + +
    +
    +
    +
    + `,x())}function x(){document.getElementById("search-input")?.addEventListener("input",s=>{const o=s.target.value;r.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>r.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",s=>{s.preventDefault(),W()}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{n.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{n.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(s=>{s.addEventListener("click",()=>{s.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",s=>{const o=s.target,d=o.closest("a");if(!d){o.classList.contains("logo")&&(s.preventDefault(),r.navigate("/",{}));return}const h=d.getAttribute("data-nav"),m=Object.fromEntries(r.getCurrentRoute().query.entries());if(h==="filter"){s.preventDefault();const u=d.getAttribute("data-value");r.getCurrentRoute().path==="/settings"?r.navigate("/",{...m,filter:u}):r.updateQuery({filter:u})}else if(h==="tag"){s.preventDefault();const u=d.getAttribute("data-value");r.navigate(`/tag/${encodeURIComponent(u)}`,m)}else if(h==="feed"){s.preventDefault();const u=d.getAttribute("data-value"),l=r.getCurrentRoute();n.activeFeedId===parseInt(u)&&l.path!=="/settings"?r.navigate("/",m):r.navigate(`/feed/${u}`,m)}else h==="settings"&&(s.preventDefault(),r.getCurrentRoute().path==="/settings"?r.navigate("/",m):r.navigate("/settings",m));window.innerWidth<=768&&n.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",s=>{const o=s.target,d=o.closest('[data-action="toggle-star"]');if(d){const l=d.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));V(v)}return}const h=o.closest('[data-action="scrape"]');if(h){const l=h.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));X(v)}return}const m=o.closest('[data-action="open"]'),u=o.closest(".feed-item");if(u&&!m){const l=parseInt(u.getAttribute("data-id"));c=l,document.querySelectorAll(".feed-item").forEach(y=>{const A=parseInt(y.getAttribute("data-id")||"0");y.classList.toggle("selected",A===c)});const v=n.items.find(y=>y._id===l);v&&!v.read&&p(l,{read:!0})}})}function $(){const{feeds:t,activeFeedId:e}=n,i=document.getElementById("feed-list");i&&(i.innerHTML=t.map(a=>` +
  • + + ${a.title||a.url} + +
  • + `).join(""))}function F(){}function _(){const{filter:t}=n,e=document.getElementById("filter-list");e&&e.querySelectorAll("li").forEach(i=>{i.classList.toggle("active",i.getAttribute("data-filter")===t)})}function S(){const{items:t,loading:e}=n,i=document.getElementById("content-area");if(!i||r.getCurrentRoute().path==="/settings")return;if(e&&t.length===0){i.innerHTML='

    Loading items...

    ';return}if(t.length===0){i.innerHTML='

    No items found.

    ';return}i.innerHTML=` + + ${n.hasMore?'
    Loading more...
    ':""} + `;const a=document.getElementById("main-content");if(a){let s=null;a.onscroll=()=>{!n.loading&&n.hasMore&&a.scrollHeight>a.clientHeight&&a.scrollHeight-a.scrollTop-a.clientHeight<200&&I(),s===null&&(s=window.setTimeout(()=>{R(a),s=null},250))}}}function R(t){const e=t.getBoundingClientRect();n.items.forEach(i=>{if(i.read)return;const a=document.querySelector(`.feed-item[data-id="${i._id}"]`);a&&a.getBoundingClientRect().bottom{const t=document.getElementById("main-content");if(n.loading||!n.hasMore)return;if(t&&(R(t),t.scrollHeight>t.clientHeight&&t.scrollHeight-t.scrollTop-t.clientHeight<200)){I();return}const e=document.documentElement.scrollHeight||document.body.scrollHeight,i=window.innerHeight,a=window.scrollY||document.documentElement.scrollTop;e>i&&e-i-a<200&&I()},1e3);function b(){const t=document.getElementById("content-area");if(!t)return;t.innerHTML=` +
    +

    Settings

    + +
    +
    +

    Data

    + +
    +
    + + + +
    + +
    +
    + +
    +

    Theme

    +
    +
    + + +
    +
    +
    + +
    +

    Style

    +
    +
    + ${q.map(a=>``).join(` + `)} +
    +
    +
    + +
    +

    Fonts

    +
    + + + + + +
    +
    +
    + +
    +

    Manage Feeds

    + +
    + + +
    + +
      + ${n.feeds.map(a=>` +
    • +
      +
      ${a.title||a.url}
      +
      ${a.url}
      +
      +
      + + +
      +
    • + `).join("")} +
    +
    +
    + `,document.getElementById("theme-options")?.addEventListener("click",a=>{const s=a.target.closest("button");s&&(n.setTheme(s.getAttribute("data-theme")),b())}),document.getElementById("style-theme-options")?.addEventListener("click",a=>{const s=a.target.closest("button");s&&n.setStyleTheme(s.getAttribute("data-style-theme"))}),document.getElementById("heading-font-selector")?.addEventListener("change",a=>{n.setHeadingFontTheme(a.target.value)}),document.getElementById("font-selector")?.addEventListener("change",a=>{n.setFontTheme(a.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const a=document.getElementById("new-feed-url"),s=a.value.trim();s&&(await j(s)?(a.value="",alert("Feed added successfully!"),E()):alert("Failed to add feed."))});let e="opml";const i=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(a=>{a.addEventListener("click",s=>{e=s.currentTarget.getAttribute("data-format")||"opml",i.click()})}),i?.addEventListener("change",async a=>{const s=a.target.files?.[0];s&&(await Q(s,e)?(alert(`Import (${e}) started! check logs.`),E()):alert("Failed to import.")),i.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(a=>{a.addEventListener("click",async s=>{const o=parseInt(s.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await U(o),await E(),b())})})}async function j(t){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t})})).ok}catch(e){return console.error("Failed to add feed",e),!1}}async function Q(t,e){try{const i=new FormData;i.append("file",t),i.append("format",e);const a=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":a||""},body:i})).ok}catch(i){return console.error("Failed to import",i),!1}}async function U(t){try{return(await f(`/api/feed/${t}`,{method:"DELETE"})).ok}catch(e){return console.error("Failed to delete feed",e),!1}}async function V(t){const e=n.items.find(i=>i._id===t);e&&p(t,{starred:!e.starred})}async function X(t){if(n.items.find(i=>i._id===t))try{const i=await f(`/api/item/${t}/content`);if(i.ok){const a=await i.json();a.full_content&&p(t,{full_content:a.full_content})}}catch(i){console.error("Failed to fetch full content",i)}}async function p(t,e){try{if((await f(`/api/item/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){const a=n.items.find(s=>s._id===t);if(a){Object.assign(a,e);const s=document.querySelector(`.feed-item[data-id="${t}"]`);if(s){if(e.read!==void 0&&s.classList.toggle("read",e.read),e.starred!==void 0){const o=s.querySelector(".star-btn");o&&(o.classList.toggle("is-starred",e.starred),o.classList.toggle("is-unstarred",!e.starred),o.setAttribute("title",e.starred?"Unstar":"Star"))}e.full_content&&S()}}}}catch(i){console.error("Failed to update item",i)}}async function E(){const t=await f("/api/feed/");if(t.ok){const e=await t.json();n.setFeeds(e)}}async function J(){const t=await f("/api/tag");if(t.ok){const e=await t.json();n.setTags(e)}}async function T(t,e,i=!1){n.setLoading(!0);try{const a=new URLSearchParams;t&&a.append("feed_id",t),e&&a.append("tag",e),n.searchQuery&&a.append("q",n.searchQuery),(n.filter==="starred"||n.filter==="all")&&a.append("read_filter","all"),n.filter==="starred"&&a.append("starred","true"),i&&n.items.length>0&&a.append("max_id",String(n.items[n.items.length-1]._id));const s=await f(`/api/stream?${a.toString()}`);if(s.ok){const o=await s.json();n.setHasMore(o.length>0),n.setItems(o,i)}}finally{n.setLoading(!1)}}async function I(){const t=r.getCurrentRoute();T(t.params.feedId,t.params.tagName,!0)}async function W(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function w(){const t=r.getCurrentRoute(),e=t.query.get("filter");n.setFilter(e||"unread");const i=t.query.get("q");if(i!==null&&n.setSearchQuery(i),t.path==="/settings"){b();return}if(t.path==="/feed"&&t.params.feedId){const a=parseInt(t.params.feedId);n.setActiveFeed(a),T(t.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else t.path==="/tag"&&t.params.tagName?(n.setActiveTag(t.params.tagName),T(void 0,t.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(n.setActiveFeed(null),n.setActiveTag(null),T())}window.addEventListener("keydown",t=>{if(!["INPUT","TEXTAREA"].includes(t.target.tagName))switch(t.key){case"j":k(1);break;case"k":k(-1);break;case"r":if(c){const e=n.items.find(i=>i._id===c);e&&p(e._id,{read:!e.read})}break;case"s":if(c){const e=n.items.find(i=>i._id===c);e&&p(e._id,{starred:!e.starred})}break;case"/":t.preventDefault(),document.getElementById("search-input")?.focus();break}});function k(t){if(n.items.length===0)return;const e=n.items.findIndex(a=>a._id===c);let i;if(e===-1?i=t>0?0:n.items.length-1:i=e+t,i>=0&&i{const o=parseInt(s.getAttribute("data-id")||"0");s.classList.toggle("selected",o===c)});const a=document.querySelector(`.feed-item[data-id="${c}"]`);a&&a.scrollIntoView({block:"start",behavior:"smooth"}),n.items[i].read||p(c,{read:!0})}}n.on("feeds-updated",$);n.on("tags-updated",F);n.on("active-feed-updated",$);n.on("active-tag-updated",F);n.on("filter-updated",_);n.on("search-updated",()=>{const t=document.getElementById("search-input");t&&t.value!==n.searchQuery&&(t.value=n.searchQuery),w()});n.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${n.theme} font-${n.fontTheme} heading-font-${n.headingFontTheme}`),r.getCurrentRoute().path==="/settings"&&b()});n.on("sidebar-toggle",()=>{const t=document.querySelector(".layout");t&&(n.sidebarVisible?(t.classList.remove("sidebar-hidden"),t.classList.add("sidebar-visible")):(t.classList.remove("sidebar-visible"),t.classList.add("sidebar-hidden")))});n.on("style-theme-updated",()=>{L(n.styleTheme),r.getCurrentRoute().path==="/settings"&&b()});n.on("items-updated",S);n.on("loading-state-changed",S);r.addEventListener("route-changed",w);window.app={navigate:t=>r.navigate(t)};async function G(){const t=await f("/api/auth");if(!t||t.status===401){window.location.href="/login/";return}N(),L(n.styleTheme),_();try{await Promise.all([E(),J()])}catch(e){console.error("Initial fetch failed",e)}w()}typeof window<"u"&&!window.__VITEST__&&G(); diff --git a/web/dist/v3/assets/index-CSmzFfW5.js b/web/dist/v3/assets/index-CSmzFfW5.js deleted file mode 100644 index a335a13..0000000 --- a/web/dist/v3/assets/index-CSmzFfW5.js +++ /dev/null @@ -1,161 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();function A(t){const i=`; ${document.cookie}`.split(`; ${t}=`);if(i.length===2)return i.pop()?.split(";").shift()}async function f(t,e){const i=e?.method?.toUpperCase()||"GET",a=["POST","PUT","DELETE"].includes(i),s=new Headers(e?.headers||{});if(a){const o=A("csrf_token");o&&s.set("X-CSRF-Token",o)}return fetch(t,{...e,headers:s,credentials:"include"})}function C(){const t=document.cookie.split("; ").find(e=>e.startsWith("neko_sidebar="));return t?t.split("=")[1]==="1":null}function B(t){document.cookie=`neko_sidebar=${t?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function P(){const t=C();return t!==null?t:window.innerWidth>1024}class H extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";sidebarVisible=P();setFeeds(e){this.feeds=e,this.emit("feeds-updated")}setTags(e){this.tags=e,this.emit("tags-updated")}setItems(e,i=!1){i?this.items=[...this.items,...e]:this.items=e,this.emit("items-updated")}setActiveFeed(e){this.activeFeedId=e,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(e){this.activeTagName=e,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(e){this.filter!==e&&(this.filter=e,this.emit("filter-updated"))}setSearchQuery(e){this.searchQuery!==e&&(this.searchQuery=e,this.emit("search-updated"))}setLoading(e){this.loading=e,this.emit("loading-state-changed")}setHasMore(e){this.hasMore=e}setTheme(e){this.theme=e,localStorage.setItem("neko-theme",e),this.emit("theme-updated")}setFontTheme(e){this.fontTheme=e,localStorage.setItem("neko-font-theme",e),this.emit("theme-updated")}setHeadingFontTheme(e){this.headingFontTheme=e,localStorage.setItem("neko-heading-font-theme",e),this.emit("theme-updated")}setSidebarVisible(e){this.sidebarVisible=e,B(e),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(e,i){this.dispatchEvent(new CustomEvent(e,{detail:i}))}on(e,i){this.addEventListener(e,i)}}const n=new H;class M extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const e=new URL(window.location.href),a=e.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const o={};return a[0]==="feed"&&a[1]?(s="/feed",o.feedId=a[1]):a[0]==="tag"&&a[1]?(s="/tag",o.tagName=decodeURIComponent(a[1])):a[0]==="settings"&&(s="/settings"),{path:s,params:o,query:e.searchParams}}navigate(e,i){let a=`/v3${e}`;if(i){const s=new URLSearchParams(i);a+=`?${s.toString()}`}window.history.pushState({},"",a),this.handleRouteChange()}updateQuery(e){const i=new URL(window.location.href);for(const[a,s]of Object.entries(e))s?i.searchParams.set(a,s):i.searchParams.delete(a);window.history.pushState({},"",i.toString()),this.handleRouteChange()}}const r=new M;function O(t,e=!1){const i=new Date(t.publish_date).toLocaleDateString();return` -
  • - - - ${t.full_content||t.description?` -
    - ${t.full_content||t.description} -
    - `:""} -
  • - `}let c=null,m=null;function D(){m=document.querySelector("#app"),m&&(m.className=`theme-${n.theme} font-${n.fontTheme} heading-font-${n.headingFontTheme}`,m.innerHTML=` -
    - - - -
    -
    -
    -
    - `,q())}function q(){document.getElementById("search-input")?.addEventListener("input",s=>{const o=s.target.value;r.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>r.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",s=>{s.preventDefault(),X()}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{n.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{n.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(s=>{s.addEventListener("click",()=>{s.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",s=>{const o=s.target,d=o.closest("a");if(!d){o.classList.contains("logo")&&(s.preventDefault(),r.navigate("/",{}));return}const h=d.getAttribute("data-nav"),g=Object.fromEntries(r.getCurrentRoute().query.entries());if(h==="filter"){s.preventDefault();const u=d.getAttribute("data-value");r.getCurrentRoute().path==="/settings"?r.navigate("/",{...g,filter:u}):r.updateQuery({filter:u})}else if(h==="tag"){s.preventDefault();const u=d.getAttribute("data-value");r.navigate(`/tag/${encodeURIComponent(u)}`,g)}else if(h==="feed"){s.preventDefault();const u=d.getAttribute("data-value"),l=r.getCurrentRoute();n.activeFeedId===parseInt(u)&&l.path!=="/settings"?r.navigate("/",g):r.navigate(`/feed/${u}`,g)}else h==="settings"&&(s.preventDefault(),r.getCurrentRoute().path==="/settings"?r.navigate("/",g):r.navigate("/settings",g));window.innerWidth<=768&&n.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",s=>{const o=s.target,d=o.closest('[data-action="toggle-star"]');if(d){const l=d.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));j(v)}return}const h=o.closest('[data-action="scrape"]');if(h){const l=h.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));V(v)}return}const g=o.closest('[data-action="open"]'),u=o.closest(".feed-item");if(u&&!g){const l=parseInt(u.getAttribute("data-id"));c=l,document.querySelectorAll(".feed-item").forEach(b=>{const R=parseInt(b.getAttribute("data-id")||"0");b.classList.toggle("selected",R===c)});const v=n.items.find(b=>b._id===l);v&&!v.read&&p(l,{read:!0})}})}function k(){const{feeds:t,activeFeedId:e}=n,i=document.getElementById("feed-list");i&&(i.innerHTML=t.map(a=>` -
  • - - ${a.title||a.url} - -
  • - `).join(""))}function $(){}function F(){const{filter:t}=n,e=document.getElementById("filter-list");e&&e.querySelectorAll("li").forEach(i=>{i.classList.toggle("active",i.getAttribute("data-filter")===t)})}function w(){const{items:t,loading:e}=n,i=document.getElementById("content-area");if(!i||r.getCurrentRoute().path==="/settings")return;if(e&&t.length===0){i.innerHTML='

    Loading items...

    ';return}if(t.length===0){i.innerHTML='

    No items found.

    ';return}i.innerHTML=` -
      - ${t.map(s=>O(s,s._id===c)).join("")} -
    - ${n.hasMore?'
    Loading more...
    ':""} - `;const a=document.getElementById("main-content");if(a){let s=null;a.onscroll=()=>{!n.loading&&n.hasMore&&a.scrollHeight>a.clientHeight&&a.scrollHeight-a.scrollTop-a.clientHeight<200&&T(),s===null&&(s=window.setTimeout(()=>{_(a),s=null},250))}}}function _(t){const e=t.getBoundingClientRect();n.items.forEach(i=>{if(i.read)return;const a=document.querySelector(`.feed-item[data-id="${i._id}"]`);a&&a.getBoundingClientRect().bottom{const t=document.getElementById("main-content");if(n.loading||!n.hasMore)return;if(t&&(_(t),t.scrollHeight>t.clientHeight&&t.scrollHeight-t.scrollTop-t.clientHeight<200)){T();return}const e=document.documentElement.scrollHeight||document.body.scrollHeight,i=window.innerHeight,a=window.scrollY||document.documentElement.scrollTop;e>i&&e-i-a<200&&T()},1e3);function I(){const t=document.getElementById("content-area");if(!t)return;t.innerHTML=` -
    -

    Settings

    - -
    -
    -

    Data

    - -
    -
    - - - -
    - -
    -
    - -
    -

    Theme

    -
    -
    - - -
    -
    -
    - - - - - -
    -
    -
    - -
    -

    Manage Feeds

    - -
    - - -
    - -
      - ${n.feeds.map(a=>` -
    • -
      -
      ${a.title||a.url}
      -
      ${a.url}
      -
      -
      - - -
      -
    • - `).join("")} -
    -
    -
    - `,document.getElementById("theme-options")?.addEventListener("click",a=>{const s=a.target.closest("button");s&&(n.setTheme(s.getAttribute("data-theme")),I())}),document.getElementById("heading-font-selector")?.addEventListener("change",a=>{n.setHeadingFontTheme(a.target.value)}),document.getElementById("font-selector")?.addEventListener("change",a=>{n.setFontTheme(a.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const a=document.getElementById("new-feed-url"),s=a.value.trim();s&&(await N(s)?(a.value="",alert("Feed added successfully!"),y()):alert("Failed to add feed."))});let e="opml";const i=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(a=>{a.addEventListener("click",s=>{e=s.currentTarget.getAttribute("data-format")||"opml",i.click()})}),i?.addEventListener("change",async a=>{const s=a.target.files?.[0];s&&(await x(s,e)?(alert(`Import (${e}) started! check logs.`),y()):alert("Failed to import.")),i.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(a=>{a.addEventListener("click",async s=>{const o=parseInt(s.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await Q(o),await y(),I())})})}async function N(t){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t})})).ok}catch(e){return console.error("Failed to add feed",e),!1}}async function x(t,e){try{const i=new FormData;i.append("file",t),i.append("format",e);const a=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":a||""},body:i})).ok}catch(i){return console.error("Failed to import",i),!1}}async function Q(t){try{return(await f(`/api/feed/${t}`,{method:"DELETE"})).ok}catch(e){return console.error("Failed to delete feed",e),!1}}async function j(t){const e=n.items.find(i=>i._id===t);e&&p(t,{starred:!e.starred})}async function V(t){if(n.items.find(i=>i._id===t))try{const i=await f(`/api/item/${t}/content`);if(i.ok){const a=await i.json();a.full_content&&p(t,{full_content:a.full_content})}}catch(i){console.error("Failed to fetch full content",i)}}async function p(t,e){try{if((await f(`/api/item/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){const a=n.items.find(s=>s._id===t);if(a){Object.assign(a,e);const s=document.querySelector(`.feed-item[data-id="${t}"]`);if(s){if(e.read!==void 0&&s.classList.toggle("read",e.read),e.starred!==void 0){const o=s.querySelector(".star-btn");o&&(o.classList.toggle("is-starred",e.starred),o.classList.toggle("is-unstarred",!e.starred),o.setAttribute("title",e.starred?"Unstar":"Star"))}e.full_content&&w()}}}}catch(i){console.error("Failed to update item",i)}}async function y(){const t=await f("/api/feed/");if(t.ok){const e=await t.json();n.setFeeds(e)}}async function U(){const t=await f("/api/tag");if(t.ok){const e=await t.json();n.setTags(e)}}async function E(t,e,i=!1){n.setLoading(!0);try{const a=new URLSearchParams;t&&a.append("feed_id",t),e&&a.append("tag",e),n.searchQuery&&a.append("q",n.searchQuery),(n.filter==="starred"||n.filter==="all")&&a.append("read_filter","all"),n.filter==="starred"&&a.append("starred","true"),i&&n.items.length>0&&a.append("max_id",String(n.items[n.items.length-1]._id));const s=await f(`/api/stream?${a.toString()}`);if(s.ok){const o=await s.json();n.setHasMore(o.length>0),n.setItems(o,i)}}finally{n.setLoading(!1)}}async function T(){const t=r.getCurrentRoute();E(t.params.feedId,t.params.tagName,!0)}async function X(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function S(){const t=r.getCurrentRoute(),e=t.query.get("filter");n.setFilter(e||"unread");const i=t.query.get("q");if(i!==null&&n.setSearchQuery(i),t.path==="/settings"){I();return}if(t.path==="/feed"&&t.params.feedId){const a=parseInt(t.params.feedId);n.setActiveFeed(a),E(t.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else t.path==="/tag"&&t.params.tagName?(n.setActiveTag(t.params.tagName),E(void 0,t.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(n.setActiveFeed(null),n.setActiveTag(null),E())}window.addEventListener("keydown",t=>{if(!["INPUT","TEXTAREA"].includes(t.target.tagName))switch(t.key){case"j":L(1);break;case"k":L(-1);break;case"r":if(c){const e=n.items.find(i=>i._id===c);e&&p(e._id,{read:!e.read})}break;case"s":if(c){const e=n.items.find(i=>i._id===c);e&&p(e._id,{starred:!e.starred})}break;case"/":t.preventDefault(),document.getElementById("search-input")?.focus();break}});function L(t){if(n.items.length===0)return;const e=n.items.findIndex(a=>a._id===c);let i;if(e===-1?i=t>0?0:n.items.length-1:i=e+t,i>=0&&i{const o=parseInt(s.getAttribute("data-id")||"0");s.classList.toggle("selected",o===c)});const a=document.querySelector(`.feed-item[data-id="${c}"]`);a&&a.scrollIntoView({block:"start",behavior:"smooth"}),n.items[i].read||p(c,{read:!0})}}n.on("feeds-updated",k);n.on("tags-updated",$);n.on("active-feed-updated",k);n.on("active-tag-updated",$);n.on("filter-updated",F);n.on("search-updated",()=>{const t=document.getElementById("search-input");t&&t.value!==n.searchQuery&&(t.value=n.searchQuery),S()});n.on("theme-updated",()=>{m||(m=document.querySelector("#app")),m&&(m.className=`theme-${n.theme} font-${n.fontTheme} heading-font-${n.headingFontTheme}`),r.getCurrentRoute().path==="/settings"&&I()});n.on("sidebar-toggle",()=>{const t=document.querySelector(".layout");t&&(n.sidebarVisible?(t.classList.remove("sidebar-hidden"),t.classList.add("sidebar-visible")):(t.classList.remove("sidebar-visible"),t.classList.add("sidebar-hidden")))});n.on("items-updated",w);n.on("loading-state-changed",w);r.addEventListener("route-changed",S);window.app={navigate:t=>r.navigate(t)};async function J(){const t=await f("/api/auth");if(!t||t.status===401){window.location.href="/login/";return}D(),F();try{await Promise.all([y(),U()])}catch(e){console.error("Initial fetch failed",e)}S()}typeof window<"u"&&!window.__VITEST__&&J(); diff --git a/web/dist/v3/index.html b/web/dist/v3/index.html index e50ba5f..3c5190c 100644 --- a/web/dist/v3/index.html +++ b/web/dist/v3/index.html @@ -5,7 +5,7 @@ neko - + diff --git a/web/dist/v3/themes/codex.css b/web/dist/v3/themes/codex.css new file mode 100644 index 0000000..ece9e2d --- /dev/null +++ b/web/dist/v3/themes/codex.css @@ -0,0 +1,451 @@ +/* + * Codex Theme + * The book as interface. Tufte, Bringhurst, and the long tradition + * of typographic craft applied to the screen. + * Warm, readable, unhurried. Content is sovereign. + */ + +/* ---- Color System ---- */ +:root { + --bg-color: #faf8f4; + --text-color: #2c2c2c; + --sidebar-bg: #f0ece4; + --link-color: #8b4513; + --border-color: #d4cfc6; + --accent-color: #8b4513; + + --codex-paper: #faf8f4; + --codex-ink: #2c2c2c; + --codex-sienna: #8b4513; + --codex-muted: #8a8478; + --codex-rule: #d4cfc6; + + color-scheme: light; +} + +/* Dark mode adaptation -- parchment by candlelight */ +.theme-dark { + --bg-color: #1c1a17; + --text-color: #d4cfc6; + --sidebar-bg: #23211d; + --link-color: #c9956b; + --border-color: #3a3630; + --accent-color: #c9956b; + + --codex-paper: #1c1a17; + --codex-ink: #d4cfc6; + --codex-sienna: #c9956b; + --codex-muted: #8a8478; + --codex-rule: #3a3630; +} + +/* ---- Typography ---- */ + +body { + font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', 'Crimson Text', Georgia, serif; + font-size: 19px; + line-height: 1.7; + letter-spacing: 0.005em; + background-color: var(--bg-color); + color: var(--text-color); + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-feature-settings: 'liga' 1, 'kern' 1, 'onum' 1; +} + +/* ---- Sidebar: Table of Contents ---- */ + +.sidebar { + background: var(--sidebar-bg); + backdrop-filter: none; + -webkit-backdrop-filter: none; + border-right: 1px solid var(--codex-rule); + font-family: 'Iowan Old Style', Palatino, Georgia, serif; +} + +.theme-dark .sidebar { + background: var(--sidebar-bg); + border-right-color: var(--codex-rule); +} + +.sidebar-section h3 { + font-family: 'Iowan Old Style', Palatino, Georgia, serif; + font-size: 0.7rem; + font-weight: 400; + font-variant: small-caps; + text-transform: lowercase; + letter-spacing: 0.15em; + color: var(--codex-muted); + opacity: 1; +} + +.theme-dark .sidebar-section h3 { + color: var(--codex-muted); +} + +.sidebar-section li a { + font-family: 'Iowan Old Style', Palatino, Georgia, serif; + color: var(--text-color); + font-size: 0.85rem; + border-radius: 3px; + font-weight: 400; +} + +.theme-dark .sidebar-section li a { + color: var(--text-color); +} + +.sidebar-section li a:hover { + background: rgba(139, 69, 19, 0.06); + color: var(--codex-sienna); + transform: none; +} + +.theme-dark .sidebar-section li a:hover { + background: rgba(201, 149, 107, 0.08); + color: var(--codex-sienna); +} + +.sidebar-section li.active a { + background: rgba(139, 69, 19, 0.08); + color: var(--codex-sienna); + box-shadow: none; + border: none; + border-radius: 3px; + font-weight: 600; +} + +.theme-dark .sidebar-section li.active a { + background: rgba(201, 149, 107, 0.1); + color: var(--codex-sienna); +} + +.sidebar-footer { + border-top-color: var(--codex-rule); +} + +.sidebar-footer a { + font-family: 'Iowan Old Style', Palatino, Georgia, serif; + color: var(--text-color); + opacity: 0.5; + font-size: 0.85rem; +} + +.theme-dark .sidebar-footer a { + color: var(--text-color); +} + +/* Search */ +.sidebar-search input { + background: rgba(0, 0, 0, 0.03); + border: 1px solid var(--codex-rule); + border-radius: 3px; + color: var(--text-color); + font-family: inherit; +} + +.theme-dark .sidebar-search input { + background: rgba(255, 255, 255, 0.05); + color: var(--text-color); + border-color: var(--codex-rule); +} + +.sidebar-search input:focus { + border-color: var(--codex-sienna); + box-shadow: none; +} + +/* ---- Toggle ---- */ +.theme-dark .sidebar-toggle { + background: none; +} + +/* ---- Main Content ---- */ + +.main-content { + background-color: var(--bg-color); + padding: 2.5rem 2rem; +} + +.main-content > * { + max-width: 33em; +} + +/* ---- Feed Items: The Reading Experience ---- */ + +.feed-item { + padding: 0; + margin-top: 2.5rem; + border-radius: 0; + padding-bottom: 2.5rem; + border-bottom: none; +} + +/* Decorative separator between items -- a subtle fleuron */ +.feed-item + .feed-item::before { + content: '\2766'; + display: block; + text-align: center; + font-size: 1rem; + color: var(--codex-rule); + margin-bottom: 2.5rem; + margin-top: -2.5rem; +} + +.feed-item.selected { + background: none; + box-shadow: inset 3px 0 0 var(--codex-sienna); + padding-left: 1rem; + border-radius: 0; +} + +.theme-dark .feed-item.selected { + background: none; +} + +.item-title { + font-family: 'Iowan Old Style', Palatino, Georgia, serif; + font-size: 1.65rem; + line-height: 1.3; + font-weight: 400; + color: var(--codex-sienna); + letter-spacing: -0.005em; +} + +.item-title:hover { + color: var(--codex-ink); + text-decoration: none; +} + +.dateline { + font-family: 'Iowan Old Style', Palatino, Georgia, serif; + font-variant: small-caps; + text-transform: lowercase; + font-size: 0.78em; + letter-spacing: 0.06em; + color: var(--codex-muted); + margin-bottom: 1.2rem; +} + +.dateline a { + color: var(--codex-muted); +} + +.item-description { + font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif; + font-size: 1rem; + line-height: 1.75; + color: var(--text-color); + hyphens: auto; + -webkit-hyphens: auto; +} + +.item-description a { + color: var(--codex-sienna); + text-decoration: none; + border-bottom: 1px solid rgba(139, 69, 19, 0.3); +} + +.item-description a:hover { + border-bottom-color: var(--codex-sienna); +} + +.item-description blockquote { + border-left: 3px solid var(--codex-rule); + margin-left: 0; + padding-left: 1.5em; + font-style: italic; + color: var(--codex-muted); +} + +.item-description pre { + background: rgba(0, 0, 0, 0.03); + border: 1px solid var(--codex-rule); + border-radius: 2px; + font-family: 'Courier New', Courier, monospace; + font-size: 0.88em; +} + +.item-description img { + border-radius: 2px; +} + +/* Star */ +.star-btn.is-starred { + color: var(--codex-sienna); +} + +.star-btn.is-unstarred { + color: var(--codex-muted); + opacity: 0.25; +} + +/* Scrape */ +.scrape-btn { + font-family: inherit; + font-variant: small-caps; + text-transform: lowercase; + letter-spacing: 0.06em; + color: var(--codex-sienna); + border-color: var(--codex-rule); + background: transparent; + border-radius: 2px; + font-weight: 400; +} + +/* ---- Buttons ---- */ + +button, +.button { + font-family: 'Iowan Old Style', Palatino, Georgia, serif; + font-variant: small-caps; + text-transform: lowercase; + letter-spacing: 0.06em; + border-radius: 3px; + border-color: var(--codex-rule); + background: transparent; + color: var(--text-color); + font-size: 0.85rem; + font-weight: 400; +} + +button:hover, +.button:hover { + border-color: var(--codex-sienna); + color: var(--codex-sienna); + background: rgba(139, 69, 19, 0.04); +} + +.theme-dark button, +.theme-dark .button { + background: transparent; + color: var(--text-color); + border-color: var(--codex-rule); +} + +.theme-dark button:hover, +.theme-dark .button:hover { + border-color: var(--codex-sienna); + color: var(--codex-sienna); + background: rgba(201, 149, 107, 0.08); +} + +button.active, +.theme-dark button.active { + background: var(--codex-sienna); + color: var(--codex-paper); + border-color: var(--codex-sienna); +} + +/* ---- Settings ---- */ + +.settings-view { + font-family: 'Iowan Old Style', Palatino, Georgia, serif; +} + +.settings-view h2 { + font-weight: 400; + font-size: 1.8rem; + letter-spacing: -0.01em; +} + +.settings-section h3 { + font-family: inherit; + font-weight: 400; + font-variant: small-caps; + text-transform: lowercase; + letter-spacing: 0.08em; + font-size: 1.15rem; + padding-bottom: 0.5rem; + border-bottom: 1px solid var(--codex-rule); +} + +.settings-group label, +.data-group label { + font-family: inherit; + font-variant: small-caps; + text-transform: lowercase; + letter-spacing: 0.1em; + font-size: 0.85rem; + font-weight: 400; + opacity: 0.65; +} + +.theme-dark .settings-view, +.theme-dark .settings-view h2, +.theme-dark .settings-view h3, +.theme-dark .settings-group label, +.theme-dark .data-group label { + color: var(--text-color) !important; +} + +/* Inputs */ +input[type="text"], +input[type="url"], +input[type="search"], +select { + font-family: inherit; + background: transparent; + border: 1px solid var(--codex-rule); + border-radius: 3px; + color: var(--text-color); +} + +input:focus, +select:focus { + border-color: var(--codex-sienna); + box-shadow: none; +} + +/* Feed list */ +.manage-feed-list { + border-top-color: var(--codex-rule); +} + +.manage-feed-item { + border-bottom-color: var(--codex-rule); +} + +.feed-title { + font-family: inherit; + font-weight: 600; +} + +.feed-url { + font-family: inherit; +} + +.delete-feed-btn { + color: #a0522d !important; + border-color: rgba(160, 82, 45, 0.3) !important; +} + +.delete-feed-btn:hover { + background: rgba(160, 82, 45, 0.06) !important; + border-color: #a0522d !important; +} + +/* ---- Scrollbars ---- */ + +::-webkit-scrollbar { + width: 6px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + +::-webkit-scrollbar-thumb { + background: var(--codex-rule); + border-radius: 3px; +} + +/* ---- Backdrop ---- */ +.sidebar-backdrop { + background: rgba(250, 248, 244, 0.6); + backdrop-filter: blur(3px); +} + +.theme-dark .sidebar-backdrop { + background: rgba(28, 26, 23, 0.6); +} diff --git a/web/dist/v3/themes/refined.css b/web/dist/v3/themes/refined.css new file mode 100644 index 0000000..9143552 --- /dev/null +++ b/web/dist/v3/themes/refined.css @@ -0,0 +1,265 @@ +/* + * Refined Theme + * A careful refinement of the default aesthetic. + * Fixes spacing inconsistencies, improves typographic rhythm, + * and adds subtle polish while preserving the original character. + */ + +/* ---- Typographic Scale & Rhythm ---- */ +/* Base unit: 0.5rem. All spacing aligns to this grid. */ + +:root { + --spacing-xs: 0.25rem; + --spacing-sm: 0.5rem; + --spacing-md: 1rem; + --spacing-lg: 1.5rem; + --spacing-xl: 2rem; + --spacing-2xl: 3rem; +} + +/* Slightly refined base typography */ +body { + font-size: 18px; + line-height: 1.6; + letter-spacing: 0.005em; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-rendering: optimizeLegibility; +} + +/* ---- Sidebar Refinements ---- */ + +.sidebar { + padding: var(--spacing-lg); + padding-top: 5rem; +} + +.sidebar-section h3 { + font-size: 0.65rem; + letter-spacing: 0.14em; + margin-top: var(--spacing-xl); + margin-bottom: var(--spacing-sm); +} + +.sidebar-section li a { + padding: 0.35rem 0.75rem; + margin: 2px 0; + font-size: 0.82rem; + letter-spacing: 0.01em; + border-radius: 6px; +} + +.sidebar-section li.active a { + border-radius: 6px; +} + +.sidebar-footer { + padding-top: var(--spacing-lg); +} + +.sidebar-footer a { + font-size: 0.82rem; + padding: 0.4rem 0.75rem; + letter-spacing: 0.01em; +} + +/* ---- Main Content Refinements ---- */ + +.main-content { + padding: var(--spacing-xl) var(--spacing-xl); +} + +@media (max-width: 1024px) { + .main-content { + padding: var(--spacing-md); + padding-top: 4rem; + } +} + +/* ---- Feed Item Refinements ---- */ + +.feed-item { + padding: var(--spacing-md) var(--spacing-sm); + margin-top: var(--spacing-xl); +} + +.item-title { + font-size: 1.7rem; + line-height: 1.25; + letter-spacing: -0.015em; +} + +.item-header { + margin-bottom: var(--spacing-sm); +} + +.dateline { + font-size: 0.72em; + letter-spacing: 0.02em; + margin-bottom: var(--spacing-md); +} + +.item-description { + line-height: 1.6; + margin-top: var(--spacing-md); +} + +.item-description p { + margin-top: 0; + margin-bottom: var(--spacing-md); +} + +.item-description p:last-child { + margin-bottom: 0; +} + +/* ---- Settings Page Refinements ---- */ +/* This is where the biggest improvements are needed */ + +.settings-view { + padding-top: var(--spacing-xl); +} + +.settings-view h2 { + font-size: 1.8rem; + font-weight: 700; + margin-bottom: var(--spacing-2xl); + letter-spacing: -0.025em; +} + +.settings-grid { + gap: var(--spacing-2xl); + margin-bottom: var(--spacing-2xl); +} + +.settings-section { + margin: 0; + padding: 0; +} + +.settings-section h3 { + font-size: 1.1rem; + font-weight: 700; + margin-bottom: var(--spacing-lg); + padding-bottom: var(--spacing-sm); + border-bottom: 1px solid var(--border-color); +} + +.settings-group, +.data-group { + margin-bottom: var(--spacing-lg); +} + +.settings-group label, +.data-group label { + font-size: 0.75rem; + letter-spacing: 0.1em; + margin-bottom: var(--spacing-sm); +} + +.theme-options { + gap: var(--spacing-sm); +} + +/* Consistent button sizing */ +button, +.button { + height: 2.2rem; + padding: 0 var(--spacing-md); + font-size: 0.75rem; + letter-spacing: 0.06em; + border-radius: 5px; +} + +/* Add feed form alignment */ +.add-feed-form { + gap: var(--spacing-sm); + margin-bottom: var(--spacing-xl); +} + +.add-feed-form input { + height: 2.2rem; +} + +/* Manage feeds list consistency */ +.manage-feeds-section { + margin-top: var(--spacing-2xl); +} + +.manage-feed-item { + padding: var(--spacing-md) 0; + gap: var(--spacing-md); +} + +.feed-title { + font-size: 0.95rem; + margin-bottom: var(--spacing-xs); +} + +.feed-url { + font-size: 0.8rem; +} + +/* Select inputs consistent with buttons */ +select { + height: 2.2rem; + font-size: 0.85rem; +} + +/* ---- Subtle Polish ---- */ + +/* Slightly softer selection highlight */ +.feed-item.selected { + border-radius: 6px; +} + +/* Smoother scrollbar (webkit) */ +.sidebar-scroll::-webkit-scrollbar, +.main-content::-webkit-scrollbar { + width: 6px; +} + +.sidebar-scroll::-webkit-scrollbar-thumb, +.main-content::-webkit-scrollbar-thumb { + background: rgba(128, 128, 128, 0.3); + border-radius: 3px; +} + +.sidebar-scroll::-webkit-scrollbar-thumb:hover, +.main-content::-webkit-scrollbar-thumb:hover { + background: rgba(128, 128, 128, 0.5); +} + +/* Refined focus states */ +input:focus, +select:focus { + box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15); +} + +/* Cleaner star button */ +.star-btn { + font-size: 1.1rem; + padding: 0 0 0 0.75rem; + transition: opacity 0.15s, color 0.15s; +} + +.star-btn.is-unstarred { + opacity: 0.2; +} + +.star-btn.is-unstarred:hover { + opacity: 0.5; +} + +/* Import/export button groups: consistent spacing */ +.data-group .button-group { + gap: var(--spacing-sm); +} + +/* Better scrape button */ +.scrape-btn { + font-size: 0.7rem; + padding: 2px 8px; + border-radius: 4px; + letter-spacing: 0.04em; +} diff --git a/web/dist/v3/themes/sakura.css b/web/dist/v3/themes/sakura.css new file mode 100644 index 0000000..f0fc990 --- /dev/null +++ b/web/dist/v3/themes/sakura.css @@ -0,0 +1,466 @@ +/* + * Sakura Theme -- Claude's Choice + * Named for the app: neko is Japanese for cat. + * A theme inspired by the quiet beauty of Japanese graphic design. + * Ma (negative space), wabi-sabi (beauty in imperfection), + * and the restrained palette of ukiyo-e woodblock prints. + * Warm grays, muted pinks, deliberate whitespace, and a sense of calm. + */ + +/* ---- Color System ---- */ +:root { + --bg-color: #fafaf8; + --text-color: #373737; + --sidebar-bg: #f2f0ec; + --link-color: #c45b78; + --border-color: #e0ddd6; + --accent-color: #c45b78; + + --sakura-blossom: #c45b78; + --sakura-petal: #f0c4cf; + --sakura-stone: #8c8a85; + --sakura-ink: #373737; + --sakura-paper: #fafaf8; + --sakura-cloud: #f2f0ec; + --sakura-shadow: #e0ddd6; + --sakura-indigo: #4a5568; + + color-scheme: light; +} + +/* Dark: Evening in Kyoto */ +.theme-dark { + --bg-color: #1a1a1e; + --text-color: #d5d3ce; + --sidebar-bg: #222226; + --link-color: #e8879e; + --border-color: #3a3a3e; + --accent-color: #e8879e; + + --sakura-blossom: #e8879e; + --sakura-petal: #5c3a45; + --sakura-stone: #8c8a85; + --sakura-ink: #d5d3ce; + --sakura-paper: #1a1a1e; + --sakura-cloud: #222226; + --sakura-shadow: #3a3a3e; + --sakura-indigo: #a0aec0; +} + +/* ---- Typography ---- */ + +body { + font-family: 'Hiragino Mincho ProN', 'Noto Serif', 'Iowan Old Style', Palatino, Georgia, serif; + font-size: 18px; + line-height: 1.8; + letter-spacing: 0.01em; + background-color: var(--bg-color); + color: var(--text-color); + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; +} + +/* ---- Sidebar ---- */ + +.sidebar { + background: var(--sakura-cloud); + backdrop-filter: none; + -webkit-backdrop-filter: none; + border-right: 1px solid var(--sakura-shadow); + padding: 1.5rem; + padding-top: 5rem; +} + +.theme-dark .sidebar { + background: var(--sakura-cloud); + border-right-color: var(--sakura-shadow); +} + +.sidebar-section h3 { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Helvetica Neue', Helvetica, sans-serif; + font-size: 0.6rem; + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.2em; + color: var(--sakura-stone); + opacity: 1; +} + +.theme-dark .sidebar-section h3 { + color: var(--sakura-stone); +} + +.sidebar-section li a { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Helvetica Neue', Helvetica, sans-serif; + color: var(--text-color); + font-size: 0.82rem; + border-radius: 4px; + font-weight: 400; + letter-spacing: 0.01em; +} + +.theme-dark .sidebar-section li a { + color: var(--text-color); +} + +.sidebar-section li a:hover { + background: rgba(196, 91, 120, 0.06); + color: var(--sakura-blossom); + transform: none; +} + +.theme-dark .sidebar-section li a:hover { + background: rgba(232, 135, 158, 0.08); + color: var(--sakura-blossom); +} + +.sidebar-section li.active a { + background: rgba(196, 91, 120, 0.08); + color: var(--sakura-blossom); + box-shadow: none; + border: none; + border-left: 2px solid var(--sakura-blossom); + border-radius: 0 4px 4px 0; + padding-left: calc(0.8rem - 2px); + font-weight: 600; +} + +.theme-dark .sidebar-section li.active a { + background: rgba(232, 135, 158, 0.1); + color: var(--sakura-blossom); +} + +.sidebar-footer { + border-top: 1px solid var(--sakura-shadow); +} + +.sidebar-footer a { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Helvetica Neue', Helvetica, sans-serif; + color: var(--text-color); + opacity: 0.45; + font-size: 0.82rem; +} + +.theme-dark .sidebar-footer a { + color: var(--text-color); +} + +.sidebar-footer a:hover { + opacity: 1; + color: var(--sakura-blossom); + background: rgba(196, 91, 120, 0.04); +} + +/* Search */ +.sidebar-search input { + background: rgba(0, 0, 0, 0.03); + border: 1px solid var(--sakura-shadow); + border-radius: 4px; + color: var(--text-color); + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif; +} + +.theme-dark .sidebar-search input { + background: rgba(255, 255, 255, 0.04); + color: var(--text-color); + border-color: var(--sakura-shadow); +} + +.sidebar-search input:focus { + border-color: var(--sakura-blossom); + box-shadow: 0 0 0 2px rgba(196, 91, 120, 0.1); +} + +/* ---- Toggle ---- */ +.theme-dark .sidebar-toggle { + background: none; +} + +/* ---- Main Content ---- */ + +.main-content { + background-color: var(--bg-color); + padding: 2.5rem 2rem; +} + +.main-content > * { + max-width: 34em; +} + +/* ---- Feed Items ---- */ + +.feed-item { + padding: 0.5rem 0; + margin-top: 2.5rem; + border-radius: 0; + border-bottom: none; +} + +/* Subtle separator -- a single thin rule, Japanese-style restraint */ +.feed-item + .feed-item { + border-top: 1px solid var(--sakura-shadow); + padding-top: 2.5rem; +} + +.feed-item.selected { + background: rgba(196, 91, 120, 0.03); + box-shadow: inset 3px 0 0 var(--sakura-blossom); + padding-left: 1rem; + border-radius: 0; +} + +.theme-dark .feed-item.selected { + background: rgba(232, 135, 158, 0.04); +} + +.item-title { + font-family: 'Hiragino Mincho ProN', 'Noto Serif', Palatino, Georgia, serif; + font-size: 1.55rem; + line-height: 1.4; + font-weight: 600; + color: var(--sakura-ink); + letter-spacing: 0; +} + +.theme-dark .item-title { + color: var(--text-color); +} + +.item-title:hover { + color: var(--sakura-blossom); + text-decoration: none; +} + +.dateline { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Helvetica Neue', sans-serif; + font-size: 0.72em; + letter-spacing: 0.03em; + color: var(--sakura-stone); + margin-bottom: 1rem; +} + +.dateline a { + color: var(--sakura-stone); +} + +.dateline a:hover { + color: var(--sakura-blossom); +} + +.item-description { + font-family: 'Hiragino Mincho ProN', 'Noto Serif', 'Iowan Old Style', Palatino, Georgia, serif; + font-size: 1rem; + line-height: 1.85; + color: var(--text-color); +} + +.item-description a { + color: var(--sakura-blossom); + text-decoration: none; + border-bottom: 1px solid rgba(196, 91, 120, 0.25); +} + +.item-description a:hover { + border-bottom-color: var(--sakura-blossom); +} + +.item-description blockquote { + border-left: 2px solid var(--sakura-petal); + margin-left: 0; + padding-left: 1.25em; + color: var(--sakura-stone); +} + +.item-description pre { + background: rgba(0, 0, 0, 0.02); + border: 1px solid var(--sakura-shadow); + border-radius: 3px; + font-family: 'Courier New', Courier, monospace; + font-size: 0.88em; +} + +.item-description img { + border-radius: 3px; +} + +/* Star -- blossom colored when starred */ +.star-btn.is-starred { + color: var(--sakura-blossom); +} + +.star-btn.is-unstarred { + color: var(--sakura-stone); + opacity: 0.2; +} + +/* Scrape */ +.scrape-btn { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif; + color: var(--sakura-blossom); + border-color: var(--sakura-shadow); + background: transparent; + border-radius: 3px; + font-size: 0.72rem; + letter-spacing: 0.04em; +} + +/* ---- Buttons ---- */ + +button, +.button { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Helvetica Neue', sans-serif; + border-radius: 4px; + border-color: var(--sakura-shadow); + background: transparent; + color: var(--text-color); + font-size: 0.78rem; + font-weight: 500; + letter-spacing: 0.04em; + text-transform: uppercase; +} + +button:hover, +.button:hover { + border-color: var(--sakura-blossom); + color: var(--sakura-blossom); + background: rgba(196, 91, 120, 0.04); +} + +.theme-dark button, +.theme-dark .button { + background: transparent; + color: var(--text-color); + border-color: var(--sakura-shadow); +} + +.theme-dark button:hover, +.theme-dark .button:hover { + border-color: var(--sakura-blossom); + color: var(--sakura-blossom); + background: rgba(232, 135, 158, 0.06); +} + +button.active, +.theme-dark button.active { + background: var(--sakura-blossom); + color: #ffffff; + border-color: var(--sakura-blossom); +} + +/* ---- Settings ---- */ + +.settings-view { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Helvetica Neue', sans-serif; +} + +.settings-view h2 { + font-family: 'Hiragino Mincho ProN', 'Noto Serif', Palatino, Georgia, serif; + font-weight: 400; + font-size: 1.8rem; + letter-spacing: 0.02em; +} + +.settings-section h3 { + font-family: inherit; + font-weight: 500; + font-size: 1rem; + letter-spacing: 0.04em; + padding-bottom: 0.5rem; + border-bottom: 1px solid var(--sakura-shadow); +} + +.settings-group label, +.data-group label { + font-family: inherit; + letter-spacing: 0.1em; + font-size: 0.72rem; + font-weight: 500; +} + +.theme-dark .settings-view, +.theme-dark .settings-view h2, +.theme-dark .settings-view h3, +.theme-dark .settings-group label, +.theme-dark .data-group label { + color: var(--text-color) !important; +} + +/* Inputs */ +input[type="text"], +input[type="url"], +input[type="search"], +select { + font-family: inherit; + background: transparent; + border: 1px solid var(--sakura-shadow); + border-radius: 4px; + color: var(--text-color); +} + +input:focus, +select:focus { + border-color: var(--sakura-blossom); + box-shadow: 0 0 0 2px rgba(196, 91, 120, 0.1); +} + +/* Feed list */ +.manage-feed-list { + border-top-color: var(--sakura-shadow); +} + +.manage-feed-item { + border-bottom-color: var(--sakura-shadow); +} + +.feed-title { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif; + font-weight: 600; +} + +.feed-url { + font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif; +} + +.delete-feed-btn { + color: #c45b78 !important; + border-color: rgba(196, 91, 120, 0.3) !important; +} + +.delete-feed-btn:hover { + background: rgba(196, 91, 120, 0.06) !important; + border-color: var(--sakura-blossom) !important; +} + +/* ---- Scrollbars ---- */ + +::-webkit-scrollbar { + width: 5px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + +::-webkit-scrollbar-thumb { + background: var(--sakura-shadow); + border-radius: 3px; +} + +::-webkit-scrollbar-thumb:hover { + background: var(--sakura-stone); +} + +/* ---- Backdrop ---- */ +.sidebar-backdrop { + background: rgba(250, 250, 248, 0.5); + backdrop-filter: blur(4px); +} + +.theme-dark .sidebar-backdrop { + background: rgba(26, 26, 30, 0.5); +} + +/* ---- Loading/Empty ---- */ +.loading, .empty { + color: var(--sakura-stone); +} diff --git a/web/dist/v3/themes/terminal.css b/web/dist/v3/themes/terminal.css new file mode 100644 index 0000000..f497dfa --- /dev/null +++ b/web/dist/v3/themes/terminal.css @@ -0,0 +1,446 @@ +/* + * Terminal Theme + * Born-digital. CRT phosphor. The hum of the machine. + * Inspired by green-screen terminals, REZ, and the beauty of text on glass. + * Content-first -- the digital medium is the accent, not the show. + */ + +/* ---- Color System ---- */ +:root { + --bg-color: #0a0e14; + --text-color: #b0bec5; + --sidebar-bg: #0d1117; + --link-color: #00e5ff; + --border-color: #1e2a35; + --accent-color: #00e5ff; + + --terminal-glow: rgba(0, 229, 255, 0.08); + --terminal-dim: rgba(0, 229, 255, 0.03); + --terminal-green: #39ff14; + --terminal-cyan: #00e5ff; + --terminal-magenta: #ff00ff; + --terminal-amber: #ffab00; + + color-scheme: dark; +} + +/* Override dark theme if also applied */ +.theme-dark { + --bg-color: #0a0e14; + --text-color: #b0bec5; + --sidebar-bg: #0d1117; + --link-color: #00e5ff; + --border-color: #1e2a35; + --accent-color: #00e5ff; +} + +/* ---- Typography ---- */ + +body { + font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Courier New', monospace; + font-size: 15px; + line-height: 1.65; + letter-spacing: 0.02em; + background-color: var(--bg-color); + color: var(--text-color); + -webkit-font-smoothing: antialiased; +} + +/* Subtle scanline overlay on the whole page */ +body::after { + content: ''; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + pointer-events: none; + z-index: 9999; + background: repeating-linear-gradient( + to bottom, + transparent, + transparent 2px, + rgba(0, 0, 0, 0.03) 2px, + rgba(0, 0, 0, 0.03) 4px + ); +} + +/* ---- Sidebar ---- */ + +.sidebar { + background: var(--sidebar-bg); + backdrop-filter: none; + -webkit-backdrop-filter: none; + border-right: 1px solid var(--border-color); + font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace; +} + +.theme-dark .sidebar { + background: var(--sidebar-bg); + border-right-color: var(--border-color); +} + +.sidebar-section h3 { + font-family: inherit; + color: var(--terminal-cyan); + opacity: 0.6; + font-size: 0.65rem; + letter-spacing: 0.2em; +} + +.theme-dark .sidebar-section h3 { + color: var(--terminal-cyan); +} + +.sidebar-section li a { + font-family: inherit; + color: var(--text-color); + border-radius: 2px; + font-size: 0.8rem; +} + +.theme-dark .sidebar-section li a { + color: var(--text-color); +} + +.sidebar-section li a:hover { + background: var(--terminal-glow); + color: var(--terminal-cyan); + transform: none; +} + +.theme-dark .sidebar-section li a:hover { + background: var(--terminal-glow); + color: var(--terminal-cyan); +} + +.sidebar-section li.active a { + background: var(--terminal-glow); + color: var(--terminal-cyan); + box-shadow: inset 2px 0 0 var(--terminal-cyan); + border: none; + border-radius: 0; + font-weight: 500; +} + +.theme-dark .sidebar-section li.active a { + background: var(--terminal-glow); + color: var(--terminal-cyan); +} + +.sidebar-footer { + border-top-color: var(--border-color); +} + +.sidebar-footer a { + font-family: inherit; + color: var(--text-color); + opacity: 0.5; + font-size: 0.8rem; +} + +.theme-dark .sidebar-footer a { + color: var(--text-color); +} + +.sidebar-footer a:hover { + color: var(--terminal-cyan); + background: var(--terminal-dim); + opacity: 1; +} + +/* Search */ +.sidebar-search input { + background: rgba(0, 229, 255, 0.05); + border: 1px solid var(--border-color); + border-radius: 2px; + color: var(--text-color); + font-family: inherit; +} + +.theme-dark .sidebar-search input { + background: rgba(0, 229, 255, 0.05); + color: var(--text-color); + border-color: var(--border-color); +} + +.sidebar-search input:focus { + border-color: var(--terminal-cyan); + box-shadow: 0 0 8px rgba(0, 229, 255, 0.15); +} + +.sidebar-search input::placeholder { + color: rgba(176, 190, 197, 0.3); +} + +/* ---- Toggle ---- */ +.sidebar-toggle { + opacity: 0.6; +} + +.theme-dark .sidebar-toggle { + background: none; +} + +.sidebar-toggle:hover { + opacity: 1; +} + +/* ---- Main Content ---- */ + +.main-content { + background-color: var(--bg-color); +} + +/* ---- Feed Items ---- */ + +.feed-item { + border-radius: 0; + padding: 1.25rem 0.5rem; + margin-top: 1.5rem; + border-bottom: 1px solid var(--border-color); +} + +.feed-item.selected { + background-color: var(--terminal-dim); + box-shadow: inset 3px 0 0 var(--terminal-cyan); + border-radius: 0; +} + +.theme-dark .feed-item.selected { + background-color: var(--terminal-dim); +} + +.item-title { + font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace; + font-size: 1.4rem; + line-height: 1.35; + color: var(--terminal-cyan); + font-weight: 600; + letter-spacing: -0.01em; +} + +.item-title:hover { + color: #ffffff; + text-shadow: 0 0 12px rgba(0, 229, 255, 0.3); + text-decoration: none; +} + +.dateline { + color: rgba(176, 190, 197, 0.35); + font-family: inherit; + font-size: 0.75em; + letter-spacing: 0.04em; +} + +.dateline a { + color: rgba(176, 190, 197, 0.35); +} + +.dateline a:hover { + color: var(--terminal-cyan); +} + +.item-description { + font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace; + font-size: 0.9rem; + line-height: 1.7; + color: var(--text-color); +} + +.item-description a { + color: var(--terminal-cyan); +} + +.item-description a:hover { + text-shadow: 0 0 8px rgba(0, 229, 255, 0.2); +} + +.item-description pre { + background: rgba(0, 229, 255, 0.04); + border: 1px solid var(--border-color); + border-radius: 2px; + font-family: inherit; +} + +/* Star */ +.star-btn.is-starred { + color: var(--terminal-amber); +} + +.star-btn.is-unstarred { + color: var(--text-color); + opacity: 0.15; +} + +/* Scrape */ +.scrape-btn { + font-family: inherit; + color: var(--terminal-cyan); + border-color: var(--border-color); + background: transparent; + border-radius: 2px; +} + +.scrape-btn:hover { + border-color: var(--terminal-cyan); + box-shadow: 0 0 6px rgba(0, 229, 255, 0.15); +} + +/* ---- Buttons ---- */ + +button, +.button { + font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace; + border-radius: 2px; + border-color: var(--border-color); + background: transparent; + color: var(--text-color); + font-size: 0.72rem; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +button:hover, +.button:hover { + border-color: var(--terminal-cyan); + color: var(--terminal-cyan); + background: var(--terminal-dim); +} + +.theme-dark button, +.theme-dark .button { + background: transparent; + color: var(--text-color); + border-color: var(--border-color); +} + +.theme-dark button:hover, +.theme-dark .button:hover { + border-color: var(--terminal-cyan); + color: var(--terminal-cyan); + background: var(--terminal-dim); +} + +button.active, +.theme-dark button.active { + background: var(--terminal-cyan); + color: var(--bg-color); + border-color: var(--terminal-cyan); +} + +/* ---- Settings ---- */ + +.settings-view { + font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace; +} + +.settings-view h2 { + color: var(--terminal-cyan); + font-weight: 600; + letter-spacing: 0.05em; + font-size: 1.5rem; +} + +.settings-section h3 { + color: var(--text-color); + font-family: inherit; + font-size: 1rem; + letter-spacing: 0.04em; +} + +.settings-group label, +.data-group label { + color: var(--text-color); + font-family: inherit; + letter-spacing: 0.12em; +} + +.theme-dark .settings-view, +.theme-dark .settings-view h2, +.theme-dark .settings-view h3, +.theme-dark .settings-group label, +.theme-dark .data-group label { + color: var(--text-color) !important; +} + +/* Inputs */ +input[type="text"], +input[type="url"], +input[type="search"], +select { + font-family: inherit; + background: rgba(0, 229, 255, 0.04); + border: 1px solid var(--border-color); + border-radius: 2px; + color: var(--text-color); +} + +input:focus, +select:focus { + border-color: var(--terminal-cyan); + box-shadow: 0 0 8px rgba(0, 229, 255, 0.15); +} + +/* Feed list in settings */ +.manage-feed-list { + border-top-color: var(--border-color); +} + +.manage-feed-item { + border-bottom-color: var(--border-color); +} + +.feed-title { + font-family: inherit; + color: var(--text-color); +} + +.feed-url { + font-family: inherit; + color: var(--text-color); + opacity: 0.4; +} + +/* Delete button */ +.delete-feed-btn { + color: #ff5252 !important; + border-color: rgba(255, 82, 82, 0.3) !important; +} + +.delete-feed-btn:hover { + border-color: #ff5252 !important; + box-shadow: 0 0 6px rgba(255, 82, 82, 0.2) !important; + background: rgba(255, 82, 82, 0.08) !important; +} + +/* ---- Scrollbars ---- */ + +::-webkit-scrollbar { + width: 5px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + +::-webkit-scrollbar-thumb { + background: rgba(0, 229, 255, 0.15); + border-radius: 0; +} + +::-webkit-scrollbar-thumb:hover { + background: rgba(0, 229, 255, 0.3); +} + +/* ---- Backdrop ---- */ +.sidebar-backdrop { + background: rgba(0, 0, 0, 0.6); + backdrop-filter: blur(2px); +} + +/* ---- Loading/Empty States ---- */ +.loading, .empty { + color: rgba(176, 190, 197, 0.4); + font-family: inherit; +} -- cgit v1.2.3 From 042c8ba30a6cbc1915fce8910de31af86253a044 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Feb 2026 01:07:17 +0000 Subject: Refine themes, add sidebar controls, and theme docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refined: softer dark-mode link color (#a0c4e8), fix export button vertical alignment with inline-flex, tighten settings page spacing (reduce gaps from 3rem to 1.5rem). Terminal: switch accent from cyan to green (#4ae54a dark / #1a7a2e light), add proper light mode with pale steel background, scanlines only in dark mode. Sidebar: add quick-access controls in footer — moon/sun icon toggles light/dark, circle icon cycles through style themes showing current name. Both update reactively on state change. Add THEMES.md with full documentation on creating new themes: variable reference, selector guide, light/dark mode tips, and the registration process. https://claude.ai/code/session_01Jv3c8GdaDQMm5WYwHUJMVe --- web/dist/v3/assets/index-B2b8reSa.css | 1 + web/dist/v3/assets/index-CRt-Evnh.js | 175 --------------------------------- web/dist/v3/assets/index-DMQzdxIi.css | 1 - web/dist/v3/assets/index-UNWwwUlG.js | 179 ++++++++++++++++++++++++++++++++++ web/dist/v3/index.html | 4 +- web/dist/v3/themes/refined.css | 33 ++++--- web/dist/v3/themes/terminal.css | 169 +++++++++++++++++++------------- 7 files changed, 304 insertions(+), 258 deletions(-) create mode 100644 web/dist/v3/assets/index-B2b8reSa.css delete mode 100644 web/dist/v3/assets/index-CRt-Evnh.js delete mode 100644 web/dist/v3/assets/index-DMQzdxIi.css create mode 100644 web/dist/v3/assets/index-UNWwwUlG.js (limited to 'web') diff --git a/web/dist/v3/assets/index-B2b8reSa.css b/web/dist/v3/assets/index-B2b8reSa.css new file mode 100644 index 0000000..003aa63 --- /dev/null +++ b/web/dist/v3/assets/index-B2b8reSa.css @@ -0,0 +1 @@ +:root{--font-body: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;--font-heading-system: "Helvetica Neue", Helvetica, Arial, sans-serif;--font-heading: var(--font-heading-system);--font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-mono: "Courier New", Courier, monospace;line-height:1.5;font-size:18px;--bg-color: #ffffff;--text-color: rgba(0, 0, 0, .87);--sidebar-bg: #ccc;--link-color: #0000ee;--border-color: #999;--accent-color: #007bff;color-scheme:light dark}.theme-dark{--bg-color: #1a1a1a;--text-color: #e0e0e0;--sidebar-bg: #2d2d2d;--link-color: #8ab4f8;--border-color: #444;--accent-color: #0056b3}*{box-sizing:border-box}body{margin:0;font-family:var(--font-body);background-color:var(--bg-color);color:var(--text-color);height:100vh;width:100%;max-width:100vw;overflow:hidden}html{overflow-x:hidden;max-width:100vw}#app{height:100%;width:100%}.layout{display:flex;height:100%;width:100%;overflow-x:hidden;position:relative}.sidebar{width:11rem;background:#ffffff0d;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-right:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;height:100%;overflow:hidden;z-index:100;padding:5rem 1.5rem 1.5rem}.theme-dark .sidebar{background:#0003;border-right-color:#ffffff0d}.sidebar-search{margin-top:1rem;margin-bottom:1rem}.sidebar-search input{width:100%;border-radius:20px;background:#0000000d;border:1px solid rgba(255,255,255,.1);color:var(--text-color);padding:.5rem 1rem;font-size:.9rem}.sidebar-scroll{flex:1;overflow-y:auto;margin:0 -1.5rem;padding:0 1.5rem}.sidebar-section h3{font-family:var(--font-heading);font-size:.7rem;text-transform:uppercase;letter-spacing:.1em;opacity:.5;margin-top:2rem;margin-bottom:.5rem;font-weight:700;display:flex;align-items:center;justify-content:space-between;cursor:pointer;-webkit-user-select:none;user-select:none}.sidebar-section h3:hover{opacity:.8}.sidebar-section .caret{font-size:.6rem;transition:transform .2s ease;transform:rotate(90deg)}.sidebar-section.collapsed .caret{transform:rotate(0)}.sidebar-section.collapsed ul{display:none}.sidebar-section ul{list-style:none;padding:0;margin:0}.sidebar-section li a{display:block;padding:.3rem .8rem;margin:.1rem 0;border-radius:8px;transition:all .2s ease;font-weight:500;font-size:.85rem;text-decoration:none;color:var(--text-color);opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.sidebar-section li a:hover{background:#ffffff1a;opacity:1;transform:translate(4px)}.sidebar-section li.active a{background:#ffffff40;opacity:1;font-weight:700;box-shadow:0 4px 12px #0000001a;border:1px solid rgba(255,255,255,.2)}.sidebar-footer{margin-top:auto;padding-top:1.5rem;border-top:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;gap:.5rem}.sidebar-footer a{opacity:.6;padding:.5rem .8rem;border-radius:8px;text-decoration:none;color:var(--text-color);font-size:.9rem;font-family:var(--font-heading)}.sidebar-footer a:hover{background:#ffffff0d;opacity:1}.sidebar-quick-controls{display:flex;gap:.4rem;margin-bottom:.25rem}.sidebar-icon-btn{background:none;border:none;cursor:pointer;font-size:.75rem;padding:.3rem .6rem;border-radius:6px;color:var(--text-color);opacity:.5;transition:opacity .15s,background .15s;font-family:var(--font-sans);text-transform:none;font-weight:500;height:auto;line-height:1.3}.sidebar-icon-btn:hover{opacity:1;background:#ffffff14;border:none}.theme-dark .sidebar-icon-btn{color:#000000de;border:none;background:none}.theme-dark .sidebar-icon-btn:hover{background:#0000000f;border:none}.main-content{width:100%;height:100%;min-width:0;overflow-y:auto;background-color:var(--bg-color);padding:1.5rem 2rem;transition:padding .3s ease}@media(max-width:1024px){.main-content{padding:4rem 1rem 1rem}}.main-content>*{max-width:35em;margin-left:auto;margin-right:auto}.sidebar-toggle{position:fixed;top:1rem;left:1rem;z-index:1001;background:none;border:none;width:3rem;height:3rem;font-size:1.5rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .2s cubic-bezier(.175,.885,.32,1.275)}.sidebar-toggle:hover{transform:scale(1.1)}.sidebar-toggle:active{transform:scale(.95)}.sidebar-backdrop{display:none;position:fixed;inset:0;background:#0000004d;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:999}@media(max-width:1024px){.sidebar-visible .sidebar-backdrop{display:block}.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1);box-shadow:none}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}}@media(min-width:1025px){.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}.sidebar-hidden .sidebar{transform:translate(-100%)}}.sidebar-hidden .sidebar,.sidebar-visible .sidebar{display:flex}input[type=text],input[type=url],input[type=search],select{padding:.4rem .8rem;border-radius:8px;border:1px solid var(--border-color);background:var(--bg-color);color:var(--text-color);font-family:inherit;font-size:.9rem}input:focus,select:focus{outline:none;border-color:var(--accent-color);box-shadow:0 0 0 2px #007bff33}.logo{font-size:2.5rem;margin:0 0 1.5rem;cursor:pointer;text-align:center;-webkit-user-select:none;user-select:none}.sidebar .logo{margin-bottom:1.5rem}.item-list{list-style:none;padding:0;margin:0}.feed-item{padding:1rem .5rem;margin-top:2rem;border-bottom:none;border-radius:8px;transition:background-color .2s ease}.feed-item.selected{background-color:#007bff0d;box-shadow:inset 4px 0 0 var(--accent-color)}.theme-dark .feed-item.selected{background-color:#2188ff1a}.item-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:.5rem}.item-title{font-family:var(--font-heading);font-size:1.8rem;font-weight:700;text-decoration:none;color:var(--link-color);display:block;flex:1;cursor:pointer}.item-title:hover{text-decoration:underline}.star-btn{background:none;border:none;cursor:pointer;font-size:1.25rem;padding:0 0 0 .5rem;vertical-align:middle;transition:color .2s;line-height:1}.star-btn.is-starred{color:#00f}.star-btn.is-unstarred{color:var(--text-color);opacity:.3}.dateline{margin-top:0;font-weight:400;font-size:.75em;color:#ccc;margin-bottom:1rem}.dateline a{color:#ccc;text-decoration:none}.item-description{color:var(--text-color);line-height:1.5;font-size:1rem;margin-top:1rem;overflow-wrap:break-word;word-break:break-word}.item-description a{text-decoration:none;color:var(--link-color)}.item-description img,.item-description video,.item-description pre{max-width:100%;height:auto;display:block;margin:1rem 0}.item-description pre{white-space:pre-wrap;word-wrap:break-word;overflow-x:auto;background:#0000000d;padding:1em;border-radius:4px}.scrape-btn{background:var(--bg-color);border:1px solid var(--border-color, #ccc);color:#00f;cursor:pointer;font-family:var(--font-heading);font-weight:700;font-size:.8rem;padding:2px 6px;margin-left:.5rem}.theme-dark{--bg-color: #000000;--text-color: #ffffff;--sidebar-bg: #000000;--link-color: #5ac8fa;--border-color: #333333;--accent-color: #2188ff;--sidebar-text-color: rgba(0, 0, 0, .87)}.theme-dark .sidebar{background:#b4b4b4d9;border-right-color:#00000026}.theme-dark .sidebar-section li a,.theme-dark .sidebar-section h3,.theme-dark .sidebar-footer a{color:#000000de}.theme-dark .sidebar-section li.active a{background:#00000026}.theme-dark .sidebar-section li a:hover{background:#00000014}.theme-dark .sidebar-toggle{background:none}.theme-dark .sidebar-search input{background:#ffffffb3;color:#000000de;border-color:#0003}.font-serif{--font-body: Georgia, "Times New Roman", Times, serif;font-family:var(--font-body)}.font-sans{--font-body: var(--font-heading-system);font-family:var(--font-body)}.font-mono{--font-body: var(--font-mono);font-family:var(--font-body)}.heading-font-default{--font-heading: var(--font-heading-system)}.heading-font-serif{--font-heading: Georgia, "Times New Roman", Times, serif}.heading-font-mono{--font-heading: var(--font-mono)}.heading-font-sans{--font-heading: var(--font-sans)}.theme-dark .settings-view,.theme-dark .settings-view h2,.theme-dark .settings-view h3,.theme-dark .settings-group label,.theme-dark .data-group label{color:var(--text-color)!important}.settings-view{padding-top:2rem;font-family:var(--font-heading);color:var(--text-color)}.settings-view h2{font-size:2rem;font-weight:700;margin-bottom:2rem;letter-spacing:-.02em}.settings-grid{display:flex;flex-direction:column;gap:2rem;margin-bottom:2rem}.settings-section{margin:0;padding:0;border:none}.settings-section h3{font-family:var(--font-heading);font-size:1.2rem;font-weight:700;margin-top:0;margin-bottom:1rem;border:none;padding-bottom:0;color:var(--text-color)}.settings-group label,.data-group label{display:block;font-size:.8rem;font-weight:700;text-transform:uppercase;margin-bottom:.5rem;opacity:.6;font-family:var(--font-heading)}.theme-options{display:flex;gap:.5rem}button,.button{border-radius:6px;border:1px solid var(--border-color);padding:.5rem 1rem;font-size:.8rem;font-weight:700;text-transform:uppercase;font-family:var(--font-heading);background-color:var(--bg-color);cursor:pointer;transition:all .2s;color:var(--text-color);text-decoration:none;display:inline-block;text-align:center;height:2.2rem;line-height:1.1;box-sizing:border-box}button:hover,.button:hover{border-color:var(--text-color);background:#0000000d}.theme-dark button,.theme-dark .button{background-color:transparent;color:var(--text-color);border-color:var(--border-color)}.theme-dark button:hover,.theme-dark .button:hover{background:#ffffff1a;border-color:var(--text-color)}button.active,.theme-dark button.active{background-color:var(--text-color);color:var(--bg-color);border-color:var(--text-color)}.add-feed-form{display:flex;gap:.5rem;width:100%}.add-feed-form input{flex:1;height:2.2rem}.button-group{display:flex;gap:.5rem;align-items:center}.manage-feed-list{display:flex;flex-direction:column;padding:0;list-style:none;border-top:1px solid var(--border-color);width:100%}.manage-feed-item{display:flex;align-items:center;padding:1rem 0;border-bottom:1px solid var(--border-color);background:transparent;gap:1rem;width:100%;border-radius:0}.feed-info{flex:1;min-width:0}.feed-title{font-weight:700;font-size:1rem;margin-bottom:.2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-url{font-size:.85rem;opacity:.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-actions{display:flex;gap:.5rem;align-items:center}.feed-tag-input{width:120px;padding:.4rem;height:2.2rem}.delete-feed-btn{color:var(--error-color, #d32f2f)!important;border-color:var(--error-color, #d32f2f)!important}.delete-feed-btn:hover{background-color:#d32f2f1a!important}.manage-feeds-section{width:100%;margin-top:2rem}@media(max-width:768px){.manage-feed-item{flex-direction:column;align-items:flex-start}.feed-actions{width:100%;margin-top:.5rem}.feed-tag-input{flex:1}} diff --git a/web/dist/v3/assets/index-CRt-Evnh.js b/web/dist/v3/assets/index-CRt-Evnh.js deleted file mode 100644 index 3349411..0000000 --- a/web/dist/v3/assets/index-CRt-Evnh.js +++ /dev/null @@ -1,175 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();function C(t){const i=`; ${document.cookie}`.split(`; ${t}=`);if(i.length===2)return i.pop()?.split(";").shift()}async function f(t,e){const i=e?.method?.toUpperCase()||"GET",a=["POST","PUT","DELETE"].includes(i),s=new Headers(e?.headers||{});if(a){const o=C("csrf_token");o&&s.set("X-CSRF-Token",o)}return fetch(t,{...e,headers:s,credentials:"include"})}function B(){const t=document.cookie.split("; ").find(e=>e.startsWith("neko_sidebar="));return t?t.split("=")[1]==="1":null}function H(t){document.cookie=`neko_sidebar=${t?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function P(){const t=B();return t!==null?t:window.innerWidth>1024}class M extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";styleTheme=localStorage.getItem("neko-style-theme")||"default";sidebarVisible=P();setFeeds(e){this.feeds=e,this.emit("feeds-updated")}setTags(e){this.tags=e,this.emit("tags-updated")}setItems(e,i=!1){i?this.items=[...this.items,...e]:this.items=e,this.emit("items-updated")}setActiveFeed(e){this.activeFeedId=e,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(e){this.activeTagName=e,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(e){this.filter!==e&&(this.filter=e,this.emit("filter-updated"))}setSearchQuery(e){this.searchQuery!==e&&(this.searchQuery=e,this.emit("search-updated"))}setLoading(e){this.loading=e,this.emit("loading-state-changed")}setHasMore(e){this.hasMore=e}setTheme(e){this.theme=e,localStorage.setItem("neko-theme",e),this.emit("theme-updated")}setFontTheme(e){this.fontTheme=e,localStorage.setItem("neko-font-theme",e),this.emit("theme-updated")}setHeadingFontTheme(e){this.headingFontTheme=e,localStorage.setItem("neko-heading-font-theme",e),this.emit("theme-updated")}setStyleTheme(e){this.styleTheme=e,localStorage.setItem("neko-style-theme",e),this.emit("style-theme-updated")}setSidebarVisible(e){this.sidebarVisible=e,H(e),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(e,i){this.dispatchEvent(new CustomEvent(e,{detail:i}))}on(e,i){this.addEventListener(e,i)}}const n=new M;class O extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const e=new URL(window.location.href),a=e.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const o={};return a[0]==="feed"&&a[1]?(s="/feed",o.feedId=a[1]):a[0]==="tag"&&a[1]?(s="/tag",o.tagName=decodeURIComponent(a[1])):a[0]==="settings"&&(s="/settings"),{path:s,params:o,query:e.searchParams}}navigate(e,i){let a=`/v3${e}`;if(i){const s=new URLSearchParams(i);a+=`?${s.toString()}`}window.history.pushState({},"",a),this.handleRouteChange()}updateQuery(e){const i=new URL(window.location.href);for(const[a,s]of Object.entries(e))s?i.searchParams.set(a,s):i.searchParams.delete(a);window.history.pushState({},"",i.toString()),this.handleRouteChange()}}const r=new O;function D(t,e=!1){const i=new Date(t.publish_date).toLocaleDateString();return` -
  • - - - ${t.full_content||t.description?` -
    - ${t.full_content||t.description} -
    - `:""} -
  • - `}const q=["default","refined","terminal","codex","sakura"];function L(t){const e=document.getElementById("style-theme-link");if(e&&e.remove(),t==="default")return;const i=document.createElement("link");i.id="style-theme-link",i.rel="stylesheet",i.href=`/v3/themes/${t}.css`,document.head.appendChild(i)}let c=null,g=null;function N(){g=document.querySelector("#app"),g&&(g.className=`theme-${n.theme} font-${n.fontTheme} heading-font-${n.headingFontTheme}`,g.innerHTML=` -
    - - - -
    -
    -
    -
    - `,x())}function x(){document.getElementById("search-input")?.addEventListener("input",s=>{const o=s.target.value;r.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>r.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",s=>{s.preventDefault(),W()}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{n.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{n.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(s=>{s.addEventListener("click",()=>{s.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",s=>{const o=s.target,d=o.closest("a");if(!d){o.classList.contains("logo")&&(s.preventDefault(),r.navigate("/",{}));return}const h=d.getAttribute("data-nav"),m=Object.fromEntries(r.getCurrentRoute().query.entries());if(h==="filter"){s.preventDefault();const u=d.getAttribute("data-value");r.getCurrentRoute().path==="/settings"?r.navigate("/",{...m,filter:u}):r.updateQuery({filter:u})}else if(h==="tag"){s.preventDefault();const u=d.getAttribute("data-value");r.navigate(`/tag/${encodeURIComponent(u)}`,m)}else if(h==="feed"){s.preventDefault();const u=d.getAttribute("data-value"),l=r.getCurrentRoute();n.activeFeedId===parseInt(u)&&l.path!=="/settings"?r.navigate("/",m):r.navigate(`/feed/${u}`,m)}else h==="settings"&&(s.preventDefault(),r.getCurrentRoute().path==="/settings"?r.navigate("/",m):r.navigate("/settings",m));window.innerWidth<=768&&n.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",s=>{const o=s.target,d=o.closest('[data-action="toggle-star"]');if(d){const l=d.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));V(v)}return}const h=o.closest('[data-action="scrape"]');if(h){const l=h.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));X(v)}return}const m=o.closest('[data-action="open"]'),u=o.closest(".feed-item");if(u&&!m){const l=parseInt(u.getAttribute("data-id"));c=l,document.querySelectorAll(".feed-item").forEach(y=>{const A=parseInt(y.getAttribute("data-id")||"0");y.classList.toggle("selected",A===c)});const v=n.items.find(y=>y._id===l);v&&!v.read&&p(l,{read:!0})}})}function $(){const{feeds:t,activeFeedId:e}=n,i=document.getElementById("feed-list");i&&(i.innerHTML=t.map(a=>` -
  • - - ${a.title||a.url} - -
  • - `).join(""))}function F(){}function _(){const{filter:t}=n,e=document.getElementById("filter-list");e&&e.querySelectorAll("li").forEach(i=>{i.classList.toggle("active",i.getAttribute("data-filter")===t)})}function S(){const{items:t,loading:e}=n,i=document.getElementById("content-area");if(!i||r.getCurrentRoute().path==="/settings")return;if(e&&t.length===0){i.innerHTML='

    Loading items...

    ';return}if(t.length===0){i.innerHTML='

    No items found.

    ';return}i.innerHTML=` -
      - ${t.map(s=>D(s,s._id===c)).join("")} -
    - ${n.hasMore?'
    Loading more...
    ':""} - `;const a=document.getElementById("main-content");if(a){let s=null;a.onscroll=()=>{!n.loading&&n.hasMore&&a.scrollHeight>a.clientHeight&&a.scrollHeight-a.scrollTop-a.clientHeight<200&&I(),s===null&&(s=window.setTimeout(()=>{R(a),s=null},250))}}}function R(t){const e=t.getBoundingClientRect();n.items.forEach(i=>{if(i.read)return;const a=document.querySelector(`.feed-item[data-id="${i._id}"]`);a&&a.getBoundingClientRect().bottom{const t=document.getElementById("main-content");if(n.loading||!n.hasMore)return;if(t&&(R(t),t.scrollHeight>t.clientHeight&&t.scrollHeight-t.scrollTop-t.clientHeight<200)){I();return}const e=document.documentElement.scrollHeight||document.body.scrollHeight,i=window.innerHeight,a=window.scrollY||document.documentElement.scrollTop;e>i&&e-i-a<200&&I()},1e3);function b(){const t=document.getElementById("content-area");if(!t)return;t.innerHTML=` -
    -

    Settings

    - -
    -
    -

    Data

    - -
    -
    - - - -
    - -
    -
    - -
    -

    Theme

    -
    -
    - - -
    -
    -
    - -
    -

    Style

    -
    -
    - ${q.map(a=>``).join(` - `)} -
    -
    -
    - -
    -

    Fonts

    -
    - - - - - -
    -
    -
    - -
    -

    Manage Feeds

    - -
    - - -
    - -
      - ${n.feeds.map(a=>` -
    • -
      -
      ${a.title||a.url}
      -
      ${a.url}
      -
      -
      - - -
      -
    • - `).join("")} -
    -
    -
    - `,document.getElementById("theme-options")?.addEventListener("click",a=>{const s=a.target.closest("button");s&&(n.setTheme(s.getAttribute("data-theme")),b())}),document.getElementById("style-theme-options")?.addEventListener("click",a=>{const s=a.target.closest("button");s&&n.setStyleTheme(s.getAttribute("data-style-theme"))}),document.getElementById("heading-font-selector")?.addEventListener("change",a=>{n.setHeadingFontTheme(a.target.value)}),document.getElementById("font-selector")?.addEventListener("change",a=>{n.setFontTheme(a.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const a=document.getElementById("new-feed-url"),s=a.value.trim();s&&(await j(s)?(a.value="",alert("Feed added successfully!"),E()):alert("Failed to add feed."))});let e="opml";const i=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(a=>{a.addEventListener("click",s=>{e=s.currentTarget.getAttribute("data-format")||"opml",i.click()})}),i?.addEventListener("change",async a=>{const s=a.target.files?.[0];s&&(await Q(s,e)?(alert(`Import (${e}) started! check logs.`),E()):alert("Failed to import.")),i.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(a=>{a.addEventListener("click",async s=>{const o=parseInt(s.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await U(o),await E(),b())})})}async function j(t){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t})})).ok}catch(e){return console.error("Failed to add feed",e),!1}}async function Q(t,e){try{const i=new FormData;i.append("file",t),i.append("format",e);const a=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":a||""},body:i})).ok}catch(i){return console.error("Failed to import",i),!1}}async function U(t){try{return(await f(`/api/feed/${t}`,{method:"DELETE"})).ok}catch(e){return console.error("Failed to delete feed",e),!1}}async function V(t){const e=n.items.find(i=>i._id===t);e&&p(t,{starred:!e.starred})}async function X(t){if(n.items.find(i=>i._id===t))try{const i=await f(`/api/item/${t}/content`);if(i.ok){const a=await i.json();a.full_content&&p(t,{full_content:a.full_content})}}catch(i){console.error("Failed to fetch full content",i)}}async function p(t,e){try{if((await f(`/api/item/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){const a=n.items.find(s=>s._id===t);if(a){Object.assign(a,e);const s=document.querySelector(`.feed-item[data-id="${t}"]`);if(s){if(e.read!==void 0&&s.classList.toggle("read",e.read),e.starred!==void 0){const o=s.querySelector(".star-btn");o&&(o.classList.toggle("is-starred",e.starred),o.classList.toggle("is-unstarred",!e.starred),o.setAttribute("title",e.starred?"Unstar":"Star"))}e.full_content&&S()}}}}catch(i){console.error("Failed to update item",i)}}async function E(){const t=await f("/api/feed/");if(t.ok){const e=await t.json();n.setFeeds(e)}}async function J(){const t=await f("/api/tag");if(t.ok){const e=await t.json();n.setTags(e)}}async function T(t,e,i=!1){n.setLoading(!0);try{const a=new URLSearchParams;t&&a.append("feed_id",t),e&&a.append("tag",e),n.searchQuery&&a.append("q",n.searchQuery),(n.filter==="starred"||n.filter==="all")&&a.append("read_filter","all"),n.filter==="starred"&&a.append("starred","true"),i&&n.items.length>0&&a.append("max_id",String(n.items[n.items.length-1]._id));const s=await f(`/api/stream?${a.toString()}`);if(s.ok){const o=await s.json();n.setHasMore(o.length>0),n.setItems(o,i)}}finally{n.setLoading(!1)}}async function I(){const t=r.getCurrentRoute();T(t.params.feedId,t.params.tagName,!0)}async function W(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function w(){const t=r.getCurrentRoute(),e=t.query.get("filter");n.setFilter(e||"unread");const i=t.query.get("q");if(i!==null&&n.setSearchQuery(i),t.path==="/settings"){b();return}if(t.path==="/feed"&&t.params.feedId){const a=parseInt(t.params.feedId);n.setActiveFeed(a),T(t.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else t.path==="/tag"&&t.params.tagName?(n.setActiveTag(t.params.tagName),T(void 0,t.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(n.setActiveFeed(null),n.setActiveTag(null),T())}window.addEventListener("keydown",t=>{if(!["INPUT","TEXTAREA"].includes(t.target.tagName))switch(t.key){case"j":k(1);break;case"k":k(-1);break;case"r":if(c){const e=n.items.find(i=>i._id===c);e&&p(e._id,{read:!e.read})}break;case"s":if(c){const e=n.items.find(i=>i._id===c);e&&p(e._id,{starred:!e.starred})}break;case"/":t.preventDefault(),document.getElementById("search-input")?.focus();break}});function k(t){if(n.items.length===0)return;const e=n.items.findIndex(a=>a._id===c);let i;if(e===-1?i=t>0?0:n.items.length-1:i=e+t,i>=0&&i{const o=parseInt(s.getAttribute("data-id")||"0");s.classList.toggle("selected",o===c)});const a=document.querySelector(`.feed-item[data-id="${c}"]`);a&&a.scrollIntoView({block:"start",behavior:"smooth"}),n.items[i].read||p(c,{read:!0})}}n.on("feeds-updated",$);n.on("tags-updated",F);n.on("active-feed-updated",$);n.on("active-tag-updated",F);n.on("filter-updated",_);n.on("search-updated",()=>{const t=document.getElementById("search-input");t&&t.value!==n.searchQuery&&(t.value=n.searchQuery),w()});n.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${n.theme} font-${n.fontTheme} heading-font-${n.headingFontTheme}`),r.getCurrentRoute().path==="/settings"&&b()});n.on("sidebar-toggle",()=>{const t=document.querySelector(".layout");t&&(n.sidebarVisible?(t.classList.remove("sidebar-hidden"),t.classList.add("sidebar-visible")):(t.classList.remove("sidebar-visible"),t.classList.add("sidebar-hidden")))});n.on("style-theme-updated",()=>{L(n.styleTheme),r.getCurrentRoute().path==="/settings"&&b()});n.on("items-updated",S);n.on("loading-state-changed",S);r.addEventListener("route-changed",w);window.app={navigate:t=>r.navigate(t)};async function G(){const t=await f("/api/auth");if(!t||t.status===401){window.location.href="/login/";return}N(),L(n.styleTheme),_();try{await Promise.all([E(),J()])}catch(e){console.error("Initial fetch failed",e)}w()}typeof window<"u"&&!window.__VITEST__&&G(); diff --git a/web/dist/v3/assets/index-DMQzdxIi.css b/web/dist/v3/assets/index-DMQzdxIi.css deleted file mode 100644 index c0cf4de..0000000 --- a/web/dist/v3/assets/index-DMQzdxIi.css +++ /dev/null @@ -1 +0,0 @@ -:root{--font-body: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;--font-heading-system: "Helvetica Neue", Helvetica, Arial, sans-serif;--font-heading: var(--font-heading-system);--font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-mono: "Courier New", Courier, monospace;line-height:1.5;font-size:18px;--bg-color: #ffffff;--text-color: rgba(0, 0, 0, .87);--sidebar-bg: #ccc;--link-color: #0000ee;--border-color: #999;--accent-color: #007bff;color-scheme:light dark}.theme-dark{--bg-color: #1a1a1a;--text-color: #e0e0e0;--sidebar-bg: #2d2d2d;--link-color: #8ab4f8;--border-color: #444;--accent-color: #0056b3}*{box-sizing:border-box}body{margin:0;font-family:var(--font-body);background-color:var(--bg-color);color:var(--text-color);height:100vh;width:100%;max-width:100vw;overflow:hidden}html{overflow-x:hidden;max-width:100vw}#app{height:100%;width:100%}.layout{display:flex;height:100%;width:100%;overflow-x:hidden;position:relative}.sidebar{width:11rem;background:#ffffff0d;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-right:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;height:100%;overflow:hidden;z-index:100;padding:5rem 1.5rem 1.5rem}.theme-dark .sidebar{background:#0003;border-right-color:#ffffff0d}.sidebar-search{margin-top:1rem;margin-bottom:1rem}.sidebar-search input{width:100%;border-radius:20px;background:#0000000d;border:1px solid rgba(255,255,255,.1);color:var(--text-color);padding:.5rem 1rem;font-size:.9rem}.sidebar-scroll{flex:1;overflow-y:auto;margin:0 -1.5rem;padding:0 1.5rem}.sidebar-section h3{font-family:var(--font-heading);font-size:.7rem;text-transform:uppercase;letter-spacing:.1em;opacity:.5;margin-top:2rem;margin-bottom:.5rem;font-weight:700;display:flex;align-items:center;justify-content:space-between;cursor:pointer;-webkit-user-select:none;user-select:none}.sidebar-section h3:hover{opacity:.8}.sidebar-section .caret{font-size:.6rem;transition:transform .2s ease;transform:rotate(90deg)}.sidebar-section.collapsed .caret{transform:rotate(0)}.sidebar-section.collapsed ul{display:none}.sidebar-section ul{list-style:none;padding:0;margin:0}.sidebar-section li a{display:block;padding:.3rem .8rem;margin:.1rem 0;border-radius:8px;transition:all .2s ease;font-weight:500;font-size:.85rem;text-decoration:none;color:var(--text-color);opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.sidebar-section li a:hover{background:#ffffff1a;opacity:1;transform:translate(4px)}.sidebar-section li.active a{background:#ffffff40;opacity:1;font-weight:700;box-shadow:0 4px 12px #0000001a;border:1px solid rgba(255,255,255,.2)}.sidebar-footer{margin-top:auto;padding-top:1.5rem;border-top:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;gap:.5rem}.sidebar-footer a{opacity:.6;padding:.5rem .8rem;border-radius:8px;text-decoration:none;color:var(--text-color);font-size:.9rem;font-family:var(--font-heading)}.sidebar-footer a:hover{background:#ffffff0d;opacity:1}.main-content{width:100%;height:100%;min-width:0;overflow-y:auto;background-color:var(--bg-color);padding:1.5rem 2rem;transition:padding .3s ease}@media(max-width:1024px){.main-content{padding:4rem 1rem 1rem}}.main-content>*{max-width:35em;margin-left:auto;margin-right:auto}.sidebar-toggle{position:fixed;top:1rem;left:1rem;z-index:1001;background:none;border:none;width:3rem;height:3rem;font-size:1.5rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .2s cubic-bezier(.175,.885,.32,1.275)}.sidebar-toggle:hover{transform:scale(1.1)}.sidebar-toggle:active{transform:scale(.95)}.sidebar-backdrop{display:none;position:fixed;inset:0;background:#0000004d;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:999}@media(max-width:1024px){.sidebar-visible .sidebar-backdrop{display:block}.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1);box-shadow:none}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}}@media(min-width:1025px){.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}.sidebar-hidden .sidebar{transform:translate(-100%)}}.sidebar-hidden .sidebar,.sidebar-visible .sidebar{display:flex}input[type=text],input[type=url],input[type=search],select{padding:.4rem .8rem;border-radius:8px;border:1px solid var(--border-color);background:var(--bg-color);color:var(--text-color);font-family:inherit;font-size:.9rem}input:focus,select:focus{outline:none;border-color:var(--accent-color);box-shadow:0 0 0 2px #007bff33}.logo{font-size:2.5rem;margin:0 0 1.5rem;cursor:pointer;text-align:center;-webkit-user-select:none;user-select:none}.sidebar .logo{margin-bottom:1.5rem}.item-list{list-style:none;padding:0;margin:0}.feed-item{padding:1rem .5rem;margin-top:2rem;border-bottom:none;border-radius:8px;transition:background-color .2s ease}.feed-item.selected{background-color:#007bff0d;box-shadow:inset 4px 0 0 var(--accent-color)}.theme-dark .feed-item.selected{background-color:#2188ff1a}.item-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:.5rem}.item-title{font-family:var(--font-heading);font-size:1.8rem;font-weight:700;text-decoration:none;color:var(--link-color);display:block;flex:1;cursor:pointer}.item-title:hover{text-decoration:underline}.star-btn{background:none;border:none;cursor:pointer;font-size:1.25rem;padding:0 0 0 .5rem;vertical-align:middle;transition:color .2s;line-height:1}.star-btn.is-starred{color:#00f}.star-btn.is-unstarred{color:var(--text-color);opacity:.3}.dateline{margin-top:0;font-weight:400;font-size:.75em;color:#ccc;margin-bottom:1rem}.dateline a{color:#ccc;text-decoration:none}.item-description{color:var(--text-color);line-height:1.5;font-size:1rem;margin-top:1rem;overflow-wrap:break-word;word-break:break-word}.item-description a{text-decoration:none;color:var(--link-color)}.item-description img,.item-description video,.item-description pre{max-width:100%;height:auto;display:block;margin:1rem 0}.item-description pre{white-space:pre-wrap;word-wrap:break-word;overflow-x:auto;background:#0000000d;padding:1em;border-radius:4px}.scrape-btn{background:var(--bg-color);border:1px solid var(--border-color, #ccc);color:#00f;cursor:pointer;font-family:var(--font-heading);font-weight:700;font-size:.8rem;padding:2px 6px;margin-left:.5rem}.theme-dark{--bg-color: #000000;--text-color: #ffffff;--sidebar-bg: #000000;--link-color: #5ac8fa;--border-color: #333333;--accent-color: #2188ff;--sidebar-text-color: rgba(0, 0, 0, .87)}.theme-dark .sidebar{background:#b4b4b4d9;border-right-color:#00000026}.theme-dark .sidebar-section li a,.theme-dark .sidebar-section h3,.theme-dark .sidebar-footer a{color:#000000de}.theme-dark .sidebar-section li.active a{background:#00000026}.theme-dark .sidebar-section li a:hover{background:#00000014}.theme-dark .sidebar-toggle{background:none}.theme-dark .sidebar-search input{background:#ffffffb3;color:#000000de;border-color:#0003}.font-serif{--font-body: Georgia, "Times New Roman", Times, serif;font-family:var(--font-body)}.font-sans{--font-body: var(--font-heading-system);font-family:var(--font-body)}.font-mono{--font-body: var(--font-mono);font-family:var(--font-body)}.heading-font-default{--font-heading: var(--font-heading-system)}.heading-font-serif{--font-heading: Georgia, "Times New Roman", Times, serif}.heading-font-mono{--font-heading: var(--font-mono)}.heading-font-sans{--font-heading: var(--font-sans)}.theme-dark .settings-view,.theme-dark .settings-view h2,.theme-dark .settings-view h3,.theme-dark .settings-group label,.theme-dark .data-group label{color:var(--text-color)!important}.settings-view{padding-top:2rem;font-family:var(--font-heading);color:var(--text-color)}.settings-view h2{font-size:2rem;font-weight:700;margin-bottom:2rem;letter-spacing:-.02em}.settings-grid{display:flex;flex-direction:column;gap:2rem;margin-bottom:2rem}.settings-section{margin:0;padding:0;border:none}.settings-section h3{font-family:var(--font-heading);font-size:1.2rem;font-weight:700;margin-top:0;margin-bottom:1rem;border:none;padding-bottom:0;color:var(--text-color)}.settings-group label,.data-group label{display:block;font-size:.8rem;font-weight:700;text-transform:uppercase;margin-bottom:.5rem;opacity:.6;font-family:var(--font-heading)}.theme-options{display:flex;gap:.5rem}button,.button{border-radius:6px;border:1px solid var(--border-color);padding:.5rem 1rem;font-size:.8rem;font-weight:700;text-transform:uppercase;font-family:var(--font-heading);background-color:var(--bg-color);cursor:pointer;transition:all .2s;color:var(--text-color);text-decoration:none;display:inline-block;text-align:center;height:2.2rem;line-height:1.1;box-sizing:border-box}button:hover,.button:hover{border-color:var(--text-color);background:#0000000d}.theme-dark button,.theme-dark .button{background-color:transparent;color:var(--text-color);border-color:var(--border-color)}.theme-dark button:hover,.theme-dark .button:hover{background:#ffffff1a;border-color:var(--text-color)}button.active,.theme-dark button.active{background-color:var(--text-color);color:var(--bg-color);border-color:var(--text-color)}.add-feed-form{display:flex;gap:.5rem;width:100%}.add-feed-form input{flex:1;height:2.2rem}.button-group{display:flex;gap:.5rem;align-items:center}.manage-feed-list{display:flex;flex-direction:column;padding:0;list-style:none;border-top:1px solid var(--border-color);width:100%}.manage-feed-item{display:flex;align-items:center;padding:1rem 0;border-bottom:1px solid var(--border-color);background:transparent;gap:1rem;width:100%;border-radius:0}.feed-info{flex:1;min-width:0}.feed-title{font-weight:700;font-size:1rem;margin-bottom:.2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-url{font-size:.85rem;opacity:.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-actions{display:flex;gap:.5rem;align-items:center}.feed-tag-input{width:120px;padding:.4rem;height:2.2rem}.delete-feed-btn{color:var(--error-color, #d32f2f)!important;border-color:var(--error-color, #d32f2f)!important}.delete-feed-btn:hover{background-color:#d32f2f1a!important}.manage-feeds-section{width:100%;margin-top:2rem}@media(max-width:768px){.manage-feed-item{flex-direction:column;align-items:flex-start}.feed-actions{width:100%;margin-top:.5rem}.feed-tag-input{flex:1}} diff --git a/web/dist/v3/assets/index-UNWwwUlG.js b/web/dist/v3/assets/index-UNWwwUlG.js new file mode 100644 index 0000000..985c76e --- /dev/null +++ b/web/dist/v3/assets/index-UNWwwUlG.js @@ -0,0 +1,179 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function a(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=a(s);fetch(s.href,o)}})();function C(e){const a=`; ${document.cookie}`.split(`; ${e}=`);if(a.length===2)return a.pop()?.split(";").shift()}async function f(e,t){const a=t?.method?.toUpperCase()||"GET",n=["POST","PUT","DELETE"].includes(a),s=new Headers(t?.headers||{});if(n){const o=C("csrf_token");o&&s.set("X-CSRF-Token",o)}return fetch(e,{...t,headers:s,credentials:"include"})}function H(){const e=document.cookie.split("; ").find(t=>t.startsWith("neko_sidebar="));return e?e.split("=")[1]==="1":null}function P(e){document.cookie=`neko_sidebar=${e?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function M(){const e=H();return e!==null?e:window.innerWidth>1024}class O extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";styleTheme=localStorage.getItem("neko-style-theme")||"default";sidebarVisible=M();setFeeds(t){this.feeds=t,this.emit("feeds-updated")}setTags(t){this.tags=t,this.emit("tags-updated")}setItems(t,a=!1){a?this.items=[...this.items,...t]:this.items=t,this.emit("items-updated")}setActiveFeed(t){this.activeFeedId=t,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(t){this.activeTagName=t,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(t){this.filter!==t&&(this.filter=t,this.emit("filter-updated"))}setSearchQuery(t){this.searchQuery!==t&&(this.searchQuery=t,this.emit("search-updated"))}setLoading(t){this.loading=t,this.emit("loading-state-changed")}setHasMore(t){this.hasMore=t}setTheme(t){this.theme=t,localStorage.setItem("neko-theme",t),this.emit("theme-updated")}setFontTheme(t){this.fontTheme=t,localStorage.setItem("neko-font-theme",t),this.emit("theme-updated")}setHeadingFontTheme(t){this.headingFontTheme=t,localStorage.setItem("neko-heading-font-theme",t),this.emit("theme-updated")}setStyleTheme(t){this.styleTheme=t,localStorage.setItem("neko-style-theme",t),this.emit("style-theme-updated")}setSidebarVisible(t){this.sidebarVisible=t,P(t),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(t,a){this.dispatchEvent(new CustomEvent(t,{detail:a}))}on(t,a){this.addEventListener(t,a)}}const i=new O;class x extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const t=new URL(window.location.href),n=t.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const o={};return n[0]==="feed"&&n[1]?(s="/feed",o.feedId=n[1]):n[0]==="tag"&&n[1]?(s="/tag",o.tagName=decodeURIComponent(n[1])):n[0]==="settings"&&(s="/settings"),{path:s,params:o,query:t.searchParams}}navigate(t,a){let n=`/v3${t}`;if(a){const s=new URLSearchParams(a);n+=`?${s.toString()}`}window.history.pushState({},"",n),this.handleRouteChange()}updateQuery(t){const a=new URL(window.location.href);for(const[n,s]of Object.entries(t))s?a.searchParams.set(n,s):a.searchParams.delete(n);window.history.pushState({},"",a.toString()),this.handleRouteChange()}}const r=new x;function q(e,t=!1){const a=new Date(e.publish_date).toLocaleDateString();return` +
  • + + + ${e.full_content||e.description?` +
    + ${e.full_content||e.description} +
    + `:""} +
  • + `}const T=["default","refined","terminal","codex","sakura"];function $(e){const t=document.getElementById("style-theme-link");if(t&&t.remove(),e==="default")return;const a=document.createElement("link");a.id="style-theme-link",a.rel="stylesheet",a.href=`/v3/themes/${e}.css`,document.head.appendChild(a)}let c=null,g=null;function D(){g=document.querySelector("#app"),g&&(g.className=`theme-${i.theme} font-${i.fontTheme} heading-font-${i.headingFontTheme}`,g.innerHTML=` +
    + + + +
    +
    +
    +
    + `,N())}function N(){document.getElementById("search-input")?.addEventListener("input",s=>{const o=s.target.value;r.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>r.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",s=>{s.preventDefault(),W()}),document.getElementById("sidebar-theme-toggle")?.addEventListener("click",()=>{i.setTheme(i.theme==="light"?"dark":"light")}),document.getElementById("sidebar-style-cycle")?.addEventListener("click",()=>{const s=T.indexOf(i.styleTheme),o=T[(s+1)%T.length];i.setStyleTheme(o)}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{i.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{i.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(s=>{s.addEventListener("click",()=>{s.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",s=>{const o=s.target,d=o.closest("a");if(!d){o.classList.contains("logo")&&(s.preventDefault(),r.navigate("/",{}));return}const h=d.getAttribute("data-nav"),m=Object.fromEntries(r.getCurrentRoute().query.entries());if(h==="filter"){s.preventDefault();const u=d.getAttribute("data-value");r.getCurrentRoute().path==="/settings"?r.navigate("/",{...m,filter:u}):r.updateQuery({filter:u})}else if(h==="tag"){s.preventDefault();const u=d.getAttribute("data-value");r.navigate(`/tag/${encodeURIComponent(u)}`,m)}else if(h==="feed"){s.preventDefault();const u=d.getAttribute("data-value"),l=r.getCurrentRoute();i.activeFeedId===parseInt(u)&&l.path!=="/settings"?r.navigate("/",m):r.navigate(`/feed/${u}`,m)}else h==="settings"&&(s.preventDefault(),r.getCurrentRoute().path==="/settings"?r.navigate("/",m):r.navigate("/settings",m));window.innerWidth<=768&&i.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",s=>{const o=s.target,d=o.closest('[data-action="toggle-star"]');if(d){const l=d.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));V(v)}return}const h=o.closest('[data-action="scrape"]');if(h){const l=h.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));X(v)}return}const m=o.closest('[data-action="open"]'),u=o.closest(".feed-item");if(u&&!m){const l=parseInt(u.getAttribute("data-id"));c=l,document.querySelectorAll(".feed-item").forEach(y=>{const B=parseInt(y.getAttribute("data-id")||"0");y.classList.toggle("selected",B===c)});const v=i.items.find(y=>y._id===l);v&&!v.read&&p(l,{read:!0})}})}function F(){const{feeds:e,activeFeedId:t}=i,a=document.getElementById("feed-list");a&&(a.innerHTML=e.map(n=>` +
  • + + ${n.title||n.url} + +
  • + `).join(""))}function _(){}function R(){const{filter:e}=i,t=document.getElementById("filter-list");t&&t.querySelectorAll("li").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-filter")===e)})}function w(){const{items:e,loading:t}=i,a=document.getElementById("content-area");if(!a||r.getCurrentRoute().path==="/settings")return;if(t&&e.length===0){a.innerHTML='

    Loading items...

    ';return}if(e.length===0){a.innerHTML='

    No items found.

    ';return}a.innerHTML=` +
      + ${e.map(s=>q(s,s._id===c)).join("")} +
    + ${i.hasMore?'
    Loading more...
    ':""} + `;const n=document.getElementById("main-content");if(n){let s=null;n.onscroll=()=>{!i.loading&&i.hasMore&&n.scrollHeight>n.clientHeight&&n.scrollHeight-n.scrollTop-n.clientHeight<200&&S(),s===null&&(s=window.setTimeout(()=>{A(n),s=null},250))}}}function A(e){const t=e.getBoundingClientRect();i.items.forEach(a=>{if(a.read)return;const n=document.querySelector(`.feed-item[data-id="${a._id}"]`);n&&n.getBoundingClientRect().bottom{const e=document.getElementById("main-content");if(i.loading||!i.hasMore)return;if(e&&(A(e),e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200)){S();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,a=window.innerHeight,n=window.scrollY||document.documentElement.scrollTop;t>a&&t-a-n<200&&S()},1e3);function b(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=` +
    +

    Settings

    + +
    +
    +

    Data

    + +
    +
    + + + +
    + +
    +
    + +
    +

    Theme

    +
    +
    + + +
    +
    +
    + +
    +

    Style

    +
    +
    + ${T.map(n=>``).join(` + `)} +
    +
    +
    + +
    +

    Fonts

    +
    + + + + + +
    +
    +
    + +
    +

    Manage Feeds

    + +
    + + +
    + +
      + ${i.feeds.map(n=>` +
    • +
      +
      ${n.title||n.url}
      +
      ${n.url}
      +
      +
      + + +
      +
    • + `).join("")} +
    +
    +
    + `,document.getElementById("theme-options")?.addEventListener("click",n=>{const s=n.target.closest("button");s&&(i.setTheme(s.getAttribute("data-theme")),b())}),document.getElementById("style-theme-options")?.addEventListener("click",n=>{const s=n.target.closest("button");s&&i.setStyleTheme(s.getAttribute("data-style-theme"))}),document.getElementById("heading-font-selector")?.addEventListener("change",n=>{i.setHeadingFontTheme(n.target.value)}),document.getElementById("font-selector")?.addEventListener("change",n=>{i.setFontTheme(n.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const n=document.getElementById("new-feed-url"),s=n.value.trim();s&&(await j(s)?(n.value="",alert("Feed added successfully!"),E()):alert("Failed to add feed."))});let t="opml";const a=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(n=>{n.addEventListener("click",s=>{t=s.currentTarget.getAttribute("data-format")||"opml",a.click()})}),a?.addEventListener("change",async n=>{const s=n.target.files?.[0];s&&(await Q(s,t)?(alert(`Import (${t}) started! check logs.`),E()):alert("Failed to import.")),a.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(n=>{n.addEventListener("click",async s=>{const o=parseInt(s.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await U(o),await E(),b())})})}async function j(e){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).ok}catch(t){return console.error("Failed to add feed",t),!1}}async function Q(e,t){try{const a=new FormData;a.append("file",e),a.append("format",t);const n=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":n||""},body:a})).ok}catch(a){return console.error("Failed to import",a),!1}}async function U(e){try{return(await f(`/api/feed/${e}`,{method:"DELETE"})).ok}catch(t){return console.error("Failed to delete feed",t),!1}}async function V(e){const t=i.items.find(a=>a._id===e);t&&p(e,{starred:!t.starred})}async function X(e){if(i.items.find(a=>a._id===e))try{const a=await f(`/api/item/${e}/content`);if(a.ok){const n=await a.json();n.full_content&&p(e,{full_content:n.full_content})}}catch(a){console.error("Failed to fetch full content",a)}}async function p(e,t){try{if((await f(`/api/item/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok){const n=i.items.find(s=>s._id===e);if(n){Object.assign(n,t);const s=document.querySelector(`.feed-item[data-id="${e}"]`);if(s){if(t.read!==void 0&&s.classList.toggle("read",t.read),t.starred!==void 0){const o=s.querySelector(".star-btn");o&&(o.classList.toggle("is-starred",t.starred),o.classList.toggle("is-unstarred",!t.starred),o.setAttribute("title",t.starred?"Unstar":"Star"))}t.full_content&&w()}}}}catch(a){console.error("Failed to update item",a)}}async function E(){const e=await f("/api/feed/");if(e.ok){const t=await e.json();i.setFeeds(t)}}async function J(){const e=await f("/api/tag");if(e.ok){const t=await e.json();i.setTags(t)}}async function I(e,t,a=!1){i.setLoading(!0);try{const n=new URLSearchParams;e&&n.append("feed_id",e),t&&n.append("tag",t),i.searchQuery&&n.append("q",i.searchQuery),(i.filter==="starred"||i.filter==="all")&&n.append("read_filter","all"),i.filter==="starred"&&n.append("starred","true"),a&&i.items.length>0&&n.append("max_id",String(i.items[i.items.length-1]._id));const s=await f(`/api/stream?${n.toString()}`);if(s.ok){const o=await s.json();i.setHasMore(o.length>0),i.setItems(o,a)}}finally{i.setLoading(!1)}}async function S(){const e=r.getCurrentRoute();I(e.params.feedId,e.params.tagName,!0)}async function W(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function k(){const e=r.getCurrentRoute(),t=e.query.get("filter");i.setFilter(t||"unread");const a=e.query.get("q");if(a!==null&&i.setSearchQuery(a),e.path==="/settings"){b();return}if(e.path==="/feed"&&e.params.feedId){const n=parseInt(e.params.feedId);i.setActiveFeed(n),I(e.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else e.path==="/tag"&&e.params.tagName?(i.setActiveTag(e.params.tagName),I(void 0,e.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(i.setActiveFeed(null),i.setActiveTag(null),I())}window.addEventListener("keydown",e=>{if(!["INPUT","TEXTAREA"].includes(e.target.tagName))switch(e.key){case"j":L(1);break;case"k":L(-1);break;case"r":if(c){const t=i.items.find(a=>a._id===c);t&&p(t._id,{read:!t.read})}break;case"s":if(c){const t=i.items.find(a=>a._id===c);t&&p(t._id,{starred:!t.starred})}break;case"/":e.preventDefault(),document.getElementById("search-input")?.focus();break}});function L(e){if(i.items.length===0)return;const t=i.items.findIndex(n=>n._id===c);let a;if(t===-1?a=e>0?0:i.items.length-1:a=t+e,a>=0&&a{const o=parseInt(s.getAttribute("data-id")||"0");s.classList.toggle("selected",o===c)});const n=document.querySelector(`.feed-item[data-id="${c}"]`);n&&n.scrollIntoView({block:"start",behavior:"smooth"}),i.items[a].read||p(c,{read:!0})}}i.on("feeds-updated",F);i.on("tags-updated",_);i.on("active-feed-updated",F);i.on("active-tag-updated",_);i.on("filter-updated",R);i.on("search-updated",()=>{const e=document.getElementById("search-input");e&&e.value!==i.searchQuery&&(e.value=i.searchQuery),k()});i.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${i.theme} font-${i.fontTheme} heading-font-${i.headingFontTheme}`);const e=document.getElementById("sidebar-theme-toggle");e&&(e.textContent=i.theme==="light"?"☽":"☀",e.title=i.theme==="light"?"Switch to dark mode":"Switch to light mode"),r.getCurrentRoute().path==="/settings"&&b()});i.on("sidebar-toggle",()=>{const e=document.querySelector(".layout");e&&(i.sidebarVisible?(e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible")):(e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden")))});i.on("style-theme-updated",()=>{$(i.styleTheme);const e=document.getElementById("sidebar-style-cycle");e&&(e.textContent=`${i.styleTheme==="default"?"◯":"◉"} ${i.styleTheme}`,e.title=`Style: ${i.styleTheme}`),r.getCurrentRoute().path==="/settings"&&b()});i.on("items-updated",w);i.on("loading-state-changed",w);r.addEventListener("route-changed",k);window.app={navigate:e=>r.navigate(e)};async function G(){const e=await f("/api/auth");if(!e||e.status===401){window.location.href="/login/";return}D(),$(i.styleTheme),R();try{await Promise.all([E(),J()])}catch(t){console.error("Initial fetch failed",t)}k()}typeof window<"u"&&!window.__VITEST__&&G(); diff --git a/web/dist/v3/index.html b/web/dist/v3/index.html index 3c5190c..3101db5 100644 --- a/web/dist/v3/index.html +++ b/web/dist/v3/index.html @@ -5,8 +5,8 @@ neko - - + +
    diff --git a/web/dist/v3/themes/refined.css b/web/dist/v3/themes/refined.css index 9143552..fab2b96 100644 --- a/web/dist/v3/themes/refined.css +++ b/web/dist/v3/themes/refined.css @@ -14,7 +14,12 @@ --spacing-md: 1rem; --spacing-lg: 1.5rem; --spacing-xl: 2rem; - --spacing-2xl: 3rem; +} + +/* Dark mode: a warmer, softer link color */ +.theme-dark { + --link-color: #a0c4e8; + --accent-color: #6fa8d6; } /* Slightly refined base typography */ @@ -114,22 +119,21 @@ body { } /* ---- Settings Page Refinements ---- */ -/* This is where the biggest improvements are needed */ .settings-view { - padding-top: var(--spacing-xl); + padding-top: var(--spacing-lg); } .settings-view h2 { font-size: 1.8rem; font-weight: 700; - margin-bottom: var(--spacing-2xl); + margin-bottom: var(--spacing-xl); letter-spacing: -0.025em; } .settings-grid { - gap: var(--spacing-2xl); - margin-bottom: var(--spacing-2xl); + gap: var(--spacing-lg); + margin-bottom: var(--spacing-lg); } .settings-section { @@ -140,28 +144,28 @@ body { .settings-section h3 { font-size: 1.1rem; font-weight: 700; - margin-bottom: var(--spacing-lg); - padding-bottom: var(--spacing-sm); + margin-bottom: var(--spacing-sm); + padding-bottom: var(--spacing-xs); border-bottom: 1px solid var(--border-color); } .settings-group, .data-group { - margin-bottom: var(--spacing-lg); + margin-bottom: var(--spacing-sm); } .settings-group label, .data-group label { font-size: 0.75rem; letter-spacing: 0.1em; - margin-bottom: var(--spacing-sm); + margin-bottom: var(--spacing-xs); } .theme-options { gap: var(--spacing-sm); } -/* Consistent button sizing */ +/* Consistent button sizing & vertical centering fix */ button, .button { height: 2.2rem; @@ -169,12 +173,15 @@ button, font-size: 0.75rem; letter-spacing: 0.06em; border-radius: 5px; + display: inline-flex; + align-items: center; + justify-content: center; } /* Add feed form alignment */ .add-feed-form { gap: var(--spacing-sm); - margin-bottom: var(--spacing-xl); + margin-bottom: var(--spacing-lg); } .add-feed-form input { @@ -183,7 +190,7 @@ button, /* Manage feeds list consistency */ .manage-feeds-section { - margin-top: var(--spacing-2xl); + margin-top: var(--spacing-xl); } .manage-feed-item { diff --git a/web/dist/v3/themes/terminal.css b/web/dist/v3/themes/terminal.css index f497dfa..dd9c1b2 100644 --- a/web/dist/v3/themes/terminal.css +++ b/web/dist/v3/themes/terminal.css @@ -6,32 +6,38 @@ */ /* ---- Color System ---- */ +/* Light mode: bright terminal on a pale steel background */ :root { - --bg-color: #0a0e14; - --text-color: #b0bec5; - --sidebar-bg: #0d1117; - --link-color: #00e5ff; - --border-color: #1e2a35; - --accent-color: #00e5ff; - - --terminal-glow: rgba(0, 229, 255, 0.08); - --terminal-dim: rgba(0, 229, 255, 0.03); - --terminal-green: #39ff14; - --terminal-cyan: #00e5ff; - --terminal-magenta: #ff00ff; - --terminal-amber: #ffab00; + --bg-color: #f0f2f0; + --text-color: #1e2d1e; + --sidebar-bg: #e4e8e4; + --link-color: #1a7a2e; + --border-color: #c4cec4; + --accent-color: #1a7a2e; + + --terminal-accent: #1a7a2e; + --terminal-glow: rgba(26, 122, 46, 0.08); + --terminal-dim: rgba(26, 122, 46, 0.03); + --terminal-amber: #a66800; + --terminal-red: #c62828; - color-scheme: dark; + color-scheme: light dark; } -/* Override dark theme if also applied */ +/* Dark mode: phosphor green on black */ .theme-dark { - --bg-color: #0a0e14; - --text-color: #b0bec5; - --sidebar-bg: #0d1117; - --link-color: #00e5ff; - --border-color: #1e2a35; - --accent-color: #00e5ff; + --bg-color: #0a0e0a; + --text-color: #b0bfb0; + --sidebar-bg: #0d110d; + --link-color: #4ae54a; + --border-color: #1e2a1e; + --accent-color: #4ae54a; + + --terminal-accent: #4ae54a; + --terminal-glow: rgba(74, 229, 74, 0.08); + --terminal-dim: rgba(74, 229, 74, 0.03); + --terminal-amber: #ffab00; + --terminal-red: #ff5252; } /* ---- Typography ---- */ @@ -46,8 +52,8 @@ body { -webkit-font-smoothing: antialiased; } -/* Subtle scanline overlay on the whole page */ -body::after { +/* Subtle scanline overlay -- only in dark mode */ +.theme-dark body::after { content: ''; position: fixed; top: 0; @@ -82,14 +88,14 @@ body::after { .sidebar-section h3 { font-family: inherit; - color: var(--terminal-cyan); + color: var(--terminal-accent); opacity: 0.6; font-size: 0.65rem; letter-spacing: 0.2em; } .theme-dark .sidebar-section h3 { - color: var(--terminal-cyan); + color: var(--terminal-accent); } .sidebar-section li a { @@ -105,19 +111,19 @@ body::after { .sidebar-section li a:hover { background: var(--terminal-glow); - color: var(--terminal-cyan); + color: var(--terminal-accent); transform: none; } .theme-dark .sidebar-section li a:hover { background: var(--terminal-glow); - color: var(--terminal-cyan); + color: var(--terminal-accent); } .sidebar-section li.active a { background: var(--terminal-glow); - color: var(--terminal-cyan); - box-shadow: inset 2px 0 0 var(--terminal-cyan); + color: var(--terminal-accent); + box-shadow: inset 2px 0 0 var(--terminal-accent); border: none; border-radius: 0; font-weight: 500; @@ -125,7 +131,7 @@ body::after { .theme-dark .sidebar-section li.active a { background: var(--terminal-glow); - color: var(--terminal-cyan); + color: var(--terminal-accent); } .sidebar-footer { @@ -144,14 +150,14 @@ body::after { } .sidebar-footer a:hover { - color: var(--terminal-cyan); + color: var(--terminal-accent); background: var(--terminal-dim); opacity: 1; } /* Search */ .sidebar-search input { - background: rgba(0, 229, 255, 0.05); + background: var(--terminal-dim); border: 1px solid var(--border-color); border-radius: 2px; color: var(--text-color); @@ -159,18 +165,22 @@ body::after { } .theme-dark .sidebar-search input { - background: rgba(0, 229, 255, 0.05); + background: var(--terminal-dim); color: var(--text-color); border-color: var(--border-color); } .sidebar-search input:focus { - border-color: var(--terminal-cyan); - box-shadow: 0 0 8px rgba(0, 229, 255, 0.15); + border-color: var(--terminal-accent); + box-shadow: 0 0 8px rgba(74, 229, 74, 0.15); } .sidebar-search input::placeholder { - color: rgba(176, 190, 197, 0.3); + color: rgba(0, 0, 0, 0.25); +} + +.theme-dark .sidebar-search input::placeholder { + color: rgba(176, 191, 176, 0.3); } /* ---- Toggle ---- */ @@ -203,7 +213,7 @@ body::after { .feed-item.selected { background-color: var(--terminal-dim); - box-shadow: inset 3px 0 0 var(--terminal-cyan); + box-shadow: inset 3px 0 0 var(--terminal-accent); border-radius: 0; } @@ -215,30 +225,35 @@ body::after { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace; font-size: 1.4rem; line-height: 1.35; - color: var(--terminal-cyan); + color: var(--terminal-accent); font-weight: 600; letter-spacing: -0.01em; } .item-title:hover { - color: #ffffff; - text-shadow: 0 0 12px rgba(0, 229, 255, 0.3); text-decoration: none; } +.theme-dark .item-title:hover { + color: #ffffff; + text-shadow: 0 0 12px rgba(74, 229, 74, 0.3); +} + .dateline { - color: rgba(176, 190, 197, 0.35); + color: var(--text-color); + opacity: 0.35; font-family: inherit; font-size: 0.75em; letter-spacing: 0.04em; } .dateline a { - color: rgba(176, 190, 197, 0.35); + color: inherit; } .dateline a:hover { - color: var(--terminal-cyan); + color: var(--terminal-accent); + opacity: 1; } .item-description { @@ -249,15 +264,15 @@ body::after { } .item-description a { - color: var(--terminal-cyan); + color: var(--terminal-accent); } -.item-description a:hover { - text-shadow: 0 0 8px rgba(0, 229, 255, 0.2); +.theme-dark .item-description a:hover { + text-shadow: 0 0 8px rgba(74, 229, 74, 0.2); } .item-description pre { - background: rgba(0, 229, 255, 0.04); + background: var(--terminal-dim); border: 1px solid var(--border-color); border-radius: 2px; font-family: inherit; @@ -276,15 +291,18 @@ body::after { /* Scrape */ .scrape-btn { font-family: inherit; - color: var(--terminal-cyan); + color: var(--terminal-accent); border-color: var(--border-color); background: transparent; border-radius: 2px; } .scrape-btn:hover { - border-color: var(--terminal-cyan); - box-shadow: 0 0 6px rgba(0, 229, 255, 0.15); + border-color: var(--terminal-accent); +} + +.theme-dark .scrape-btn:hover { + box-shadow: 0 0 6px rgba(74, 229, 74, 0.15); } /* ---- Buttons ---- */ @@ -303,8 +321,8 @@ button, button:hover, .button:hover { - border-color: var(--terminal-cyan); - color: var(--terminal-cyan); + border-color: var(--terminal-accent); + color: var(--terminal-accent); background: var(--terminal-dim); } @@ -317,16 +335,16 @@ button:hover, .theme-dark button:hover, .theme-dark .button:hover { - border-color: var(--terminal-cyan); - color: var(--terminal-cyan); + border-color: var(--terminal-accent); + color: var(--terminal-accent); background: var(--terminal-dim); } button.active, .theme-dark button.active { - background: var(--terminal-cyan); + background: var(--terminal-accent); color: var(--bg-color); - border-color: var(--terminal-cyan); + border-color: var(--terminal-accent); } /* ---- Settings ---- */ @@ -336,7 +354,7 @@ button.active, } .settings-view h2 { - color: var(--terminal-cyan); + color: var(--terminal-accent); font-weight: 600; letter-spacing: 0.05em; font-size: 1.5rem; @@ -364,13 +382,17 @@ button.active, color: var(--text-color) !important; } +.theme-dark .settings-view h2 { + color: var(--terminal-accent) !important; +} + /* Inputs */ input[type="text"], input[type="url"], input[type="search"], select { font-family: inherit; - background: rgba(0, 229, 255, 0.04); + background: var(--terminal-dim); border: 1px solid var(--border-color); border-radius: 2px; color: var(--text-color); @@ -378,8 +400,8 @@ select { input:focus, select:focus { - border-color: var(--terminal-cyan); - box-shadow: 0 0 8px rgba(0, 229, 255, 0.15); + border-color: var(--terminal-accent); + box-shadow: 0 0 8px rgba(74, 229, 74, 0.15); } /* Feed list in settings */ @@ -404,12 +426,16 @@ select:focus { /* Delete button */ .delete-feed-btn { - color: #ff5252 !important; - border-color: rgba(255, 82, 82, 0.3) !important; + color: var(--terminal-red) !important; + border-color: rgba(198, 40, 40, 0.3) !important; } .delete-feed-btn:hover { - border-color: #ff5252 !important; + border-color: var(--terminal-red) !important; + background: rgba(198, 40, 40, 0.06) !important; +} + +.theme-dark .delete-feed-btn:hover { box-shadow: 0 0 6px rgba(255, 82, 82, 0.2) !important; background: rgba(255, 82, 82, 0.08) !important; } @@ -425,22 +451,31 @@ select:focus { } ::-webkit-scrollbar-thumb { - background: rgba(0, 229, 255, 0.15); + background: rgba(74, 229, 74, 0.15); border-radius: 0; } +.theme-dark ::-webkit-scrollbar-thumb { + background: rgba(74, 229, 74, 0.15); +} + ::-webkit-scrollbar-thumb:hover { - background: rgba(0, 229, 255, 0.3); + background: rgba(74, 229, 74, 0.3); } /* ---- Backdrop ---- */ .sidebar-backdrop { - background: rgba(0, 0, 0, 0.6); + background: rgba(240, 242, 240, 0.6); backdrop-filter: blur(2px); } +.theme-dark .sidebar-backdrop { + background: rgba(0, 0, 0, 0.6); +} + /* ---- Loading/Empty States ---- */ .loading, .empty { - color: rgba(176, 190, 197, 0.4); + color: var(--text-color); + opacity: 0.4; font-family: inherit; } -- cgit v1.2.3 From 81c78496e1fa0701618254986e9ff17081a74f11 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Feb 2026 01:25:04 +0000 Subject: Replace sidebar style cycle button with 5 emoji icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swap the single cycle button for individual emoji per theme: ○ Default, ◆ Refined, ▮ Terminal, ❧ Codex, ❀ Sakura. Active theme gets a highlighted state. Separated from the light/dark toggle with a thin divider. https://claude.ai/code/session_01Jv3c8GdaDQMm5WYwHUJMVe --- web/dist/v3/assets/index-B2b8reSa.css | 1 - web/dist/v3/assets/index-C5ln65P2.js | 184 ++++++++++++++++++++++++++++++++++ web/dist/v3/assets/index-DPslwYc8.css | 1 + web/dist/v3/assets/index-UNWwwUlG.js | 179 --------------------------------- web/dist/v3/index.html | 4 +- 5 files changed, 187 insertions(+), 182 deletions(-) delete mode 100644 web/dist/v3/assets/index-B2b8reSa.css create mode 100644 web/dist/v3/assets/index-C5ln65P2.js create mode 100644 web/dist/v3/assets/index-DPslwYc8.css delete mode 100644 web/dist/v3/assets/index-UNWwwUlG.js (limited to 'web') diff --git a/web/dist/v3/assets/index-B2b8reSa.css b/web/dist/v3/assets/index-B2b8reSa.css deleted file mode 100644 index 003aa63..0000000 --- a/web/dist/v3/assets/index-B2b8reSa.css +++ /dev/null @@ -1 +0,0 @@ -:root{--font-body: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;--font-heading-system: "Helvetica Neue", Helvetica, Arial, sans-serif;--font-heading: var(--font-heading-system);--font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-mono: "Courier New", Courier, monospace;line-height:1.5;font-size:18px;--bg-color: #ffffff;--text-color: rgba(0, 0, 0, .87);--sidebar-bg: #ccc;--link-color: #0000ee;--border-color: #999;--accent-color: #007bff;color-scheme:light dark}.theme-dark{--bg-color: #1a1a1a;--text-color: #e0e0e0;--sidebar-bg: #2d2d2d;--link-color: #8ab4f8;--border-color: #444;--accent-color: #0056b3}*{box-sizing:border-box}body{margin:0;font-family:var(--font-body);background-color:var(--bg-color);color:var(--text-color);height:100vh;width:100%;max-width:100vw;overflow:hidden}html{overflow-x:hidden;max-width:100vw}#app{height:100%;width:100%}.layout{display:flex;height:100%;width:100%;overflow-x:hidden;position:relative}.sidebar{width:11rem;background:#ffffff0d;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-right:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;height:100%;overflow:hidden;z-index:100;padding:5rem 1.5rem 1.5rem}.theme-dark .sidebar{background:#0003;border-right-color:#ffffff0d}.sidebar-search{margin-top:1rem;margin-bottom:1rem}.sidebar-search input{width:100%;border-radius:20px;background:#0000000d;border:1px solid rgba(255,255,255,.1);color:var(--text-color);padding:.5rem 1rem;font-size:.9rem}.sidebar-scroll{flex:1;overflow-y:auto;margin:0 -1.5rem;padding:0 1.5rem}.sidebar-section h3{font-family:var(--font-heading);font-size:.7rem;text-transform:uppercase;letter-spacing:.1em;opacity:.5;margin-top:2rem;margin-bottom:.5rem;font-weight:700;display:flex;align-items:center;justify-content:space-between;cursor:pointer;-webkit-user-select:none;user-select:none}.sidebar-section h3:hover{opacity:.8}.sidebar-section .caret{font-size:.6rem;transition:transform .2s ease;transform:rotate(90deg)}.sidebar-section.collapsed .caret{transform:rotate(0)}.sidebar-section.collapsed ul{display:none}.sidebar-section ul{list-style:none;padding:0;margin:0}.sidebar-section li a{display:block;padding:.3rem .8rem;margin:.1rem 0;border-radius:8px;transition:all .2s ease;font-weight:500;font-size:.85rem;text-decoration:none;color:var(--text-color);opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.sidebar-section li a:hover{background:#ffffff1a;opacity:1;transform:translate(4px)}.sidebar-section li.active a{background:#ffffff40;opacity:1;font-weight:700;box-shadow:0 4px 12px #0000001a;border:1px solid rgba(255,255,255,.2)}.sidebar-footer{margin-top:auto;padding-top:1.5rem;border-top:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;gap:.5rem}.sidebar-footer a{opacity:.6;padding:.5rem .8rem;border-radius:8px;text-decoration:none;color:var(--text-color);font-size:.9rem;font-family:var(--font-heading)}.sidebar-footer a:hover{background:#ffffff0d;opacity:1}.sidebar-quick-controls{display:flex;gap:.4rem;margin-bottom:.25rem}.sidebar-icon-btn{background:none;border:none;cursor:pointer;font-size:.75rem;padding:.3rem .6rem;border-radius:6px;color:var(--text-color);opacity:.5;transition:opacity .15s,background .15s;font-family:var(--font-sans);text-transform:none;font-weight:500;height:auto;line-height:1.3}.sidebar-icon-btn:hover{opacity:1;background:#ffffff14;border:none}.theme-dark .sidebar-icon-btn{color:#000000de;border:none;background:none}.theme-dark .sidebar-icon-btn:hover{background:#0000000f;border:none}.main-content{width:100%;height:100%;min-width:0;overflow-y:auto;background-color:var(--bg-color);padding:1.5rem 2rem;transition:padding .3s ease}@media(max-width:1024px){.main-content{padding:4rem 1rem 1rem}}.main-content>*{max-width:35em;margin-left:auto;margin-right:auto}.sidebar-toggle{position:fixed;top:1rem;left:1rem;z-index:1001;background:none;border:none;width:3rem;height:3rem;font-size:1.5rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .2s cubic-bezier(.175,.885,.32,1.275)}.sidebar-toggle:hover{transform:scale(1.1)}.sidebar-toggle:active{transform:scale(.95)}.sidebar-backdrop{display:none;position:fixed;inset:0;background:#0000004d;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:999}@media(max-width:1024px){.sidebar-visible .sidebar-backdrop{display:block}.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1);box-shadow:none}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}}@media(min-width:1025px){.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}.sidebar-hidden .sidebar{transform:translate(-100%)}}.sidebar-hidden .sidebar,.sidebar-visible .sidebar{display:flex}input[type=text],input[type=url],input[type=search],select{padding:.4rem .8rem;border-radius:8px;border:1px solid var(--border-color);background:var(--bg-color);color:var(--text-color);font-family:inherit;font-size:.9rem}input:focus,select:focus{outline:none;border-color:var(--accent-color);box-shadow:0 0 0 2px #007bff33}.logo{font-size:2.5rem;margin:0 0 1.5rem;cursor:pointer;text-align:center;-webkit-user-select:none;user-select:none}.sidebar .logo{margin-bottom:1.5rem}.item-list{list-style:none;padding:0;margin:0}.feed-item{padding:1rem .5rem;margin-top:2rem;border-bottom:none;border-radius:8px;transition:background-color .2s ease}.feed-item.selected{background-color:#007bff0d;box-shadow:inset 4px 0 0 var(--accent-color)}.theme-dark .feed-item.selected{background-color:#2188ff1a}.item-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:.5rem}.item-title{font-family:var(--font-heading);font-size:1.8rem;font-weight:700;text-decoration:none;color:var(--link-color);display:block;flex:1;cursor:pointer}.item-title:hover{text-decoration:underline}.star-btn{background:none;border:none;cursor:pointer;font-size:1.25rem;padding:0 0 0 .5rem;vertical-align:middle;transition:color .2s;line-height:1}.star-btn.is-starred{color:#00f}.star-btn.is-unstarred{color:var(--text-color);opacity:.3}.dateline{margin-top:0;font-weight:400;font-size:.75em;color:#ccc;margin-bottom:1rem}.dateline a{color:#ccc;text-decoration:none}.item-description{color:var(--text-color);line-height:1.5;font-size:1rem;margin-top:1rem;overflow-wrap:break-word;word-break:break-word}.item-description a{text-decoration:none;color:var(--link-color)}.item-description img,.item-description video,.item-description pre{max-width:100%;height:auto;display:block;margin:1rem 0}.item-description pre{white-space:pre-wrap;word-wrap:break-word;overflow-x:auto;background:#0000000d;padding:1em;border-radius:4px}.scrape-btn{background:var(--bg-color);border:1px solid var(--border-color, #ccc);color:#00f;cursor:pointer;font-family:var(--font-heading);font-weight:700;font-size:.8rem;padding:2px 6px;margin-left:.5rem}.theme-dark{--bg-color: #000000;--text-color: #ffffff;--sidebar-bg: #000000;--link-color: #5ac8fa;--border-color: #333333;--accent-color: #2188ff;--sidebar-text-color: rgba(0, 0, 0, .87)}.theme-dark .sidebar{background:#b4b4b4d9;border-right-color:#00000026}.theme-dark .sidebar-section li a,.theme-dark .sidebar-section h3,.theme-dark .sidebar-footer a{color:#000000de}.theme-dark .sidebar-section li.active a{background:#00000026}.theme-dark .sidebar-section li a:hover{background:#00000014}.theme-dark .sidebar-toggle{background:none}.theme-dark .sidebar-search input{background:#ffffffb3;color:#000000de;border-color:#0003}.font-serif{--font-body: Georgia, "Times New Roman", Times, serif;font-family:var(--font-body)}.font-sans{--font-body: var(--font-heading-system);font-family:var(--font-body)}.font-mono{--font-body: var(--font-mono);font-family:var(--font-body)}.heading-font-default{--font-heading: var(--font-heading-system)}.heading-font-serif{--font-heading: Georgia, "Times New Roman", Times, serif}.heading-font-mono{--font-heading: var(--font-mono)}.heading-font-sans{--font-heading: var(--font-sans)}.theme-dark .settings-view,.theme-dark .settings-view h2,.theme-dark .settings-view h3,.theme-dark .settings-group label,.theme-dark .data-group label{color:var(--text-color)!important}.settings-view{padding-top:2rem;font-family:var(--font-heading);color:var(--text-color)}.settings-view h2{font-size:2rem;font-weight:700;margin-bottom:2rem;letter-spacing:-.02em}.settings-grid{display:flex;flex-direction:column;gap:2rem;margin-bottom:2rem}.settings-section{margin:0;padding:0;border:none}.settings-section h3{font-family:var(--font-heading);font-size:1.2rem;font-weight:700;margin-top:0;margin-bottom:1rem;border:none;padding-bottom:0;color:var(--text-color)}.settings-group label,.data-group label{display:block;font-size:.8rem;font-weight:700;text-transform:uppercase;margin-bottom:.5rem;opacity:.6;font-family:var(--font-heading)}.theme-options{display:flex;gap:.5rem}button,.button{border-radius:6px;border:1px solid var(--border-color);padding:.5rem 1rem;font-size:.8rem;font-weight:700;text-transform:uppercase;font-family:var(--font-heading);background-color:var(--bg-color);cursor:pointer;transition:all .2s;color:var(--text-color);text-decoration:none;display:inline-block;text-align:center;height:2.2rem;line-height:1.1;box-sizing:border-box}button:hover,.button:hover{border-color:var(--text-color);background:#0000000d}.theme-dark button,.theme-dark .button{background-color:transparent;color:var(--text-color);border-color:var(--border-color)}.theme-dark button:hover,.theme-dark .button:hover{background:#ffffff1a;border-color:var(--text-color)}button.active,.theme-dark button.active{background-color:var(--text-color);color:var(--bg-color);border-color:var(--text-color)}.add-feed-form{display:flex;gap:.5rem;width:100%}.add-feed-form input{flex:1;height:2.2rem}.button-group{display:flex;gap:.5rem;align-items:center}.manage-feed-list{display:flex;flex-direction:column;padding:0;list-style:none;border-top:1px solid var(--border-color);width:100%}.manage-feed-item{display:flex;align-items:center;padding:1rem 0;border-bottom:1px solid var(--border-color);background:transparent;gap:1rem;width:100%;border-radius:0}.feed-info{flex:1;min-width:0}.feed-title{font-weight:700;font-size:1rem;margin-bottom:.2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-url{font-size:.85rem;opacity:.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-actions{display:flex;gap:.5rem;align-items:center}.feed-tag-input{width:120px;padding:.4rem;height:2.2rem}.delete-feed-btn{color:var(--error-color, #d32f2f)!important;border-color:var(--error-color, #d32f2f)!important}.delete-feed-btn:hover{background-color:#d32f2f1a!important}.manage-feeds-section{width:100%;margin-top:2rem}@media(max-width:768px){.manage-feed-item{flex-direction:column;align-items:flex-start}.feed-actions{width:100%;margin-top:.5rem}.feed-tag-input{flex:1}} diff --git a/web/dist/v3/assets/index-C5ln65P2.js b/web/dist/v3/assets/index-C5ln65P2.js new file mode 100644 index 0000000..b54669f --- /dev/null +++ b/web/dist/v3/assets/index-C5ln65P2.js @@ -0,0 +1,184 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function s(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=s(n);fetch(n.href,o)}})();function C(e){const s=`; ${document.cookie}`.split(`; ${e}=`);if(s.length===2)return s.pop()?.split(";").shift()}async function f(e,t){const s=t?.method?.toUpperCase()||"GET",i=["POST","PUT","DELETE"].includes(s),n=new Headers(t?.headers||{});if(i){const o=C("csrf_token");o&&n.set("X-CSRF-Token",o)}return fetch(e,{...t,headers:n,credentials:"include"})}function B(){const e=document.cookie.split("; ").find(t=>t.startsWith("neko_sidebar="));return e?e.split("=")[1]==="1":null}function H(e){document.cookie=`neko_sidebar=${e?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function P(){const e=B();return e!==null?e:window.innerWidth>1024}class M extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";styleTheme=localStorage.getItem("neko-style-theme")||"default";sidebarVisible=P();setFeeds(t){this.feeds=t,this.emit("feeds-updated")}setTags(t){this.tags=t,this.emit("tags-updated")}setItems(t,s=!1){s?this.items=[...this.items,...t]:this.items=t,this.emit("items-updated")}setActiveFeed(t){this.activeFeedId=t,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(t){this.activeTagName=t,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(t){this.filter!==t&&(this.filter=t,this.emit("filter-updated"))}setSearchQuery(t){this.searchQuery!==t&&(this.searchQuery=t,this.emit("search-updated"))}setLoading(t){this.loading=t,this.emit("loading-state-changed")}setHasMore(t){this.hasMore=t}setTheme(t){this.theme=t,localStorage.setItem("neko-theme",t),this.emit("theme-updated")}setFontTheme(t){this.fontTheme=t,localStorage.setItem("neko-font-theme",t),this.emit("theme-updated")}setHeadingFontTheme(t){this.headingFontTheme=t,localStorage.setItem("neko-heading-font-theme",t),this.emit("theme-updated")}setStyleTheme(t){this.styleTheme=t,localStorage.setItem("neko-style-theme",t),this.emit("style-theme-updated")}setSidebarVisible(t){this.sidebarVisible=t,H(t),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(t,s){this.dispatchEvent(new CustomEvent(t,{detail:s}))}on(t,s){this.addEventListener(t,s)}}const a=new M;class O extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const t=new URL(window.location.href),i=t.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let n="/";const o={};return i[0]==="feed"&&i[1]?(n="/feed",o.feedId=i[1]):i[0]==="tag"&&i[1]?(n="/tag",o.tagName=decodeURIComponent(i[1])):i[0]==="settings"&&(n="/settings"),{path:n,params:o,query:t.searchParams}}navigate(t,s){let i=`/v3${t}`;if(s){const n=new URLSearchParams(s);i+=`?${n.toString()}`}window.history.pushState({},"",i),this.handleRouteChange()}updateQuery(t){const s=new URL(window.location.href);for(const[i,n]of Object.entries(t))n?s.searchParams.set(i,n):s.searchParams.delete(i);window.history.pushState({},"",s.toString()),this.handleRouteChange()}}const r=new O;function q(e,t=!1){const s=new Date(e.publish_date).toLocaleDateString();return` +
  • + + + ${e.full_content||e.description?` +
    + ${e.full_content||e.description} +
    + `:""} +
  • + `}const x=["default","refined","terminal","codex","sakura"];function L(e){const t=document.getElementById("style-theme-link");if(t&&t.remove(),e==="default")return;const s=document.createElement("link");s.id="style-theme-link",s.rel="stylesheet",s.href=`/v3/themes/${e}.css`,document.head.appendChild(s)}let c=null,h=null;function D(){h=document.querySelector("#app"),h&&(h.className=`theme-${a.theme} font-${a.fontTheme} heading-font-${a.headingFontTheme}`,h.innerHTML=` +
    + + + +
    +
    +
    +
    + `,N())}function N(){document.getElementById("search-input")?.addEventListener("input",n=>{const o=n.target.value;r.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>r.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",n=>{n.preventDefault(),W()}),document.getElementById("sidebar-theme-toggle")?.addEventListener("click",()=>{a.setTheme(a.theme==="light"?"dark":"light")}),document.querySelectorAll(".sidebar-style-btn").forEach(n=>{n.addEventListener("click",()=>{const o=n.getAttribute("data-style-theme");o&&a.setStyleTheme(o)})}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{a.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{a.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(n=>{n.addEventListener("click",()=>{n.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",n=>{const o=n.target,l=o.closest("a");if(!l){o.classList.contains("logo")&&(n.preventDefault(),r.navigate("/",{}));return}const g=l.getAttribute("data-nav"),m=Object.fromEntries(r.getCurrentRoute().query.entries());if(g==="filter"){n.preventDefault();const u=l.getAttribute("data-value");r.getCurrentRoute().path==="/settings"?r.navigate("/",{...m,filter:u}):r.updateQuery({filter:u})}else if(g==="tag"){n.preventDefault();const u=l.getAttribute("data-value");r.navigate(`/tag/${encodeURIComponent(u)}`,m)}else if(g==="feed"){n.preventDefault();const u=l.getAttribute("data-value"),d=r.getCurrentRoute();a.activeFeedId===parseInt(u)&&d.path!=="/settings"?r.navigate("/",m):r.navigate(`/feed/${u}`,m)}else g==="settings"&&(n.preventDefault(),r.getCurrentRoute().path==="/settings"?r.navigate("/",m):r.navigate("/settings",m));window.innerWidth<=768&&a.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",n=>{const o=n.target,l=o.closest('[data-action="toggle-star"]');if(l){const d=l.closest("[data-id]");if(d){const b=parseInt(d.getAttribute("data-id"));V(b)}return}const g=o.closest('[data-action="scrape"]');if(g){const d=g.closest("[data-id]");if(d){const b=parseInt(d.getAttribute("data-id"));X(b)}return}const m=o.closest('[data-action="open"]'),u=o.closest(".feed-item");if(u&&!m){const d=parseInt(u.getAttribute("data-id"));c=d,document.querySelectorAll(".feed-item").forEach(y=>{const A=parseInt(y.getAttribute("data-id")||"0");y.classList.toggle("selected",A===c)});const b=a.items.find(y=>y._id===d);b&&!b.read&&p(d,{read:!0})}})}function $(){const{feeds:e,activeFeedId:t}=a,s=document.getElementById("feed-list");s&&(s.innerHTML=e.map(i=>` +
  • + + ${i.title||i.url} + +
  • + `).join(""))}function F(){}function R(){const{filter:e}=a,t=document.getElementById("filter-list");t&&t.querySelectorAll("li").forEach(s=>{s.classList.toggle("active",s.getAttribute("data-filter")===e)})}function I(){const{items:e,loading:t}=a,s=document.getElementById("content-area");if(!s||r.getCurrentRoute().path==="/settings")return;if(t&&e.length===0){s.innerHTML='

    Loading items...

    ';return}if(e.length===0){s.innerHTML='

    No items found.

    ';return}s.innerHTML=` +
      + ${e.map(n=>q(n,n._id===c)).join("")} +
    + ${a.hasMore?'
    Loading more...
    ':""} + `;const i=document.getElementById("main-content");if(i){let n=null;i.onscroll=()=>{!a.loading&&a.hasMore&&i.scrollHeight>i.clientHeight&&i.scrollHeight-i.scrollTop-i.clientHeight<200&&S(),n===null&&(n=window.setTimeout(()=>{_(i),n=null},250))}}}function _(e){const t=e.getBoundingClientRect();a.items.forEach(s=>{if(s.read)return;const i=document.querySelector(`.feed-item[data-id="${s._id}"]`);i&&i.getBoundingClientRect().bottom{const e=document.getElementById("main-content");if(a.loading||!a.hasMore)return;if(e&&(_(e),e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200)){S();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,s=window.innerHeight,i=window.scrollY||document.documentElement.scrollTop;t>s&&t-s-i<200&&S()},1e3);function v(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=` +
    +

    Settings

    + +
    +
    +

    Data

    + +
    +
    + + + +
    + +
    +
    + +
    +

    Theme

    +
    +
    + + +
    +
    +
    + +
    +

    Style

    +
    +
    + ${x.map(i=>``).join(` + `)} +
    +
    +
    + +
    +

    Fonts

    +
    + + + + + +
    +
    +
    + +
    +

    Manage Feeds

    + +
    + + +
    + +
      + ${a.feeds.map(i=>` +
    • +
      +
      ${i.title||i.url}
      +
      ${i.url}
      +
      +
      + + +
      +
    • + `).join("")} +
    +
    +
    + `,document.getElementById("theme-options")?.addEventListener("click",i=>{const n=i.target.closest("button");n&&(a.setTheme(n.getAttribute("data-theme")),v())}),document.getElementById("style-theme-options")?.addEventListener("click",i=>{const n=i.target.closest("button");n&&a.setStyleTheme(n.getAttribute("data-style-theme"))}),document.getElementById("heading-font-selector")?.addEventListener("change",i=>{a.setHeadingFontTheme(i.target.value)}),document.getElementById("font-selector")?.addEventListener("change",i=>{a.setFontTheme(i.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const i=document.getElementById("new-feed-url"),n=i.value.trim();n&&(await j(n)?(i.value="",alert("Feed added successfully!"),T()):alert("Failed to add feed."))});let t="opml";const s=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(i=>{i.addEventListener("click",n=>{t=n.currentTarget.getAttribute("data-format")||"opml",s.click()})}),s?.addEventListener("change",async i=>{const n=i.target.files?.[0];n&&(await Q(n,t)?(alert(`Import (${t}) started! check logs.`),T()):alert("Failed to import.")),s.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(i=>{i.addEventListener("click",async n=>{const o=parseInt(n.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await U(o),await T(),v())})})}async function j(e){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).ok}catch(t){return console.error("Failed to add feed",t),!1}}async function Q(e,t){try{const s=new FormData;s.append("file",e),s.append("format",t);const i=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":i||""},body:s})).ok}catch(s){return console.error("Failed to import",s),!1}}async function U(e){try{return(await f(`/api/feed/${e}`,{method:"DELETE"})).ok}catch(t){return console.error("Failed to delete feed",t),!1}}async function V(e){const t=a.items.find(s=>s._id===e);t&&p(e,{starred:!t.starred})}async function X(e){if(a.items.find(s=>s._id===e))try{const s=await f(`/api/item/${e}/content`);if(s.ok){const i=await s.json();i.full_content&&p(e,{full_content:i.full_content})}}catch(s){console.error("Failed to fetch full content",s)}}async function p(e,t){try{if((await f(`/api/item/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok){const i=a.items.find(n=>n._id===e);if(i){Object.assign(i,t);const n=document.querySelector(`.feed-item[data-id="${e}"]`);if(n){if(t.read!==void 0&&n.classList.toggle("read",t.read),t.starred!==void 0){const o=n.querySelector(".star-btn");o&&(o.classList.toggle("is-starred",t.starred),o.classList.toggle("is-unstarred",!t.starred),o.setAttribute("title",t.starred?"Unstar":"Star"))}t.full_content&&I()}}}}catch(s){console.error("Failed to update item",s)}}async function T(){const e=await f("/api/feed/");if(e.ok){const t=await e.json();a.setFeeds(t)}}async function J(){const e=await f("/api/tag");if(e.ok){const t=await e.json();a.setTags(t)}}async function E(e,t,s=!1){a.setLoading(!0);try{const i=new URLSearchParams;e&&i.append("feed_id",e),t&&i.append("tag",t),a.searchQuery&&i.append("q",a.searchQuery),(a.filter==="starred"||a.filter==="all")&&i.append("read_filter","all"),a.filter==="starred"&&i.append("starred","true"),s&&a.items.length>0&&i.append("max_id",String(a.items[a.items.length-1]._id));const n=await f(`/api/stream?${i.toString()}`);if(n.ok){const o=await n.json();a.setHasMore(o.length>0),a.setItems(o,s)}}finally{a.setLoading(!1)}}async function S(){const e=r.getCurrentRoute();E(e.params.feedId,e.params.tagName,!0)}async function W(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function k(){const e=r.getCurrentRoute(),t=e.query.get("filter");a.setFilter(t||"unread");const s=e.query.get("q");if(s!==null&&a.setSearchQuery(s),e.path==="/settings"){v();return}if(e.path==="/feed"&&e.params.feedId){const i=parseInt(e.params.feedId);a.setActiveFeed(i),E(e.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else e.path==="/tag"&&e.params.tagName?(a.setActiveTag(e.params.tagName),E(void 0,e.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(a.setActiveFeed(null),a.setActiveTag(null),E())}window.addEventListener("keydown",e=>{if(!["INPUT","TEXTAREA"].includes(e.target.tagName))switch(e.key){case"j":w(1);break;case"k":w(-1);break;case"r":if(c){const t=a.items.find(s=>s._id===c);t&&p(t._id,{read:!t.read})}break;case"s":if(c){const t=a.items.find(s=>s._id===c);t&&p(t._id,{starred:!t.starred})}break;case"/":e.preventDefault(),document.getElementById("search-input")?.focus();break}});function w(e){if(a.items.length===0)return;const t=a.items.findIndex(i=>i._id===c);let s;if(t===-1?s=e>0?0:a.items.length-1:s=t+e,s>=0&&s{const o=parseInt(n.getAttribute("data-id")||"0");n.classList.toggle("selected",o===c)});const i=document.querySelector(`.feed-item[data-id="${c}"]`);i&&i.scrollIntoView({block:"start",behavior:"smooth"}),a.items[s].read||p(c,{read:!0})}}a.on("feeds-updated",$);a.on("tags-updated",F);a.on("active-feed-updated",$);a.on("active-tag-updated",F);a.on("filter-updated",R);a.on("search-updated",()=>{const e=document.getElementById("search-input");e&&e.value!==a.searchQuery&&(e.value=a.searchQuery),k()});a.on("theme-updated",()=>{h||(h=document.querySelector("#app")),h&&(h.className=`theme-${a.theme} font-${a.fontTheme} heading-font-${a.headingFontTheme}`);const e=document.getElementById("sidebar-theme-toggle");e&&(e.textContent=a.theme==="light"?"☽":"☀",e.title=a.theme==="light"?"Switch to dark mode":"Switch to light mode"),r.getCurrentRoute().path==="/settings"&&v()});a.on("sidebar-toggle",()=>{const e=document.querySelector(".layout");e&&(a.sidebarVisible?(e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible")):(e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden")))});a.on("style-theme-updated",()=>{L(a.styleTheme),document.querySelectorAll(".sidebar-style-btn").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-style-theme")===a.styleTheme)}),r.getCurrentRoute().path==="/settings"&&v()});a.on("items-updated",I);a.on("loading-state-changed",I);r.addEventListener("route-changed",k);window.app={navigate:e=>r.navigate(e)};async function G(){const e=await f("/api/auth");if(!e||e.status===401){window.location.href="/login/";return}D(),L(a.styleTheme),R();try{await Promise.all([T(),J()])}catch(t){console.error("Initial fetch failed",t)}k()}typeof window<"u"&&!window.__VITEST__&&G(); diff --git a/web/dist/v3/assets/index-DPslwYc8.css b/web/dist/v3/assets/index-DPslwYc8.css new file mode 100644 index 0000000..6e05ce9 --- /dev/null +++ b/web/dist/v3/assets/index-DPslwYc8.css @@ -0,0 +1 @@ +:root{--font-body: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;--font-heading-system: "Helvetica Neue", Helvetica, Arial, sans-serif;--font-heading: var(--font-heading-system);--font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-mono: "Courier New", Courier, monospace;line-height:1.5;font-size:18px;--bg-color: #ffffff;--text-color: rgba(0, 0, 0, .87);--sidebar-bg: #ccc;--link-color: #0000ee;--border-color: #999;--accent-color: #007bff;color-scheme:light dark}.theme-dark{--bg-color: #1a1a1a;--text-color: #e0e0e0;--sidebar-bg: #2d2d2d;--link-color: #8ab4f8;--border-color: #444;--accent-color: #0056b3}*{box-sizing:border-box}body{margin:0;font-family:var(--font-body);background-color:var(--bg-color);color:var(--text-color);height:100vh;width:100%;max-width:100vw;overflow:hidden}html{overflow-x:hidden;max-width:100vw}#app{height:100%;width:100%}.layout{display:flex;height:100%;width:100%;overflow-x:hidden;position:relative}.sidebar{width:11rem;background:#ffffff0d;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-right:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;height:100%;overflow:hidden;z-index:100;padding:5rem 1.5rem 1.5rem}.theme-dark .sidebar{background:#0003;border-right-color:#ffffff0d}.sidebar-search{margin-top:1rem;margin-bottom:1rem}.sidebar-search input{width:100%;border-radius:20px;background:#0000000d;border:1px solid rgba(255,255,255,.1);color:var(--text-color);padding:.5rem 1rem;font-size:.9rem}.sidebar-scroll{flex:1;overflow-y:auto;margin:0 -1.5rem;padding:0 1.5rem}.sidebar-section h3{font-family:var(--font-heading);font-size:.7rem;text-transform:uppercase;letter-spacing:.1em;opacity:.5;margin-top:2rem;margin-bottom:.5rem;font-weight:700;display:flex;align-items:center;justify-content:space-between;cursor:pointer;-webkit-user-select:none;user-select:none}.sidebar-section h3:hover{opacity:.8}.sidebar-section .caret{font-size:.6rem;transition:transform .2s ease;transform:rotate(90deg)}.sidebar-section.collapsed .caret{transform:rotate(0)}.sidebar-section.collapsed ul{display:none}.sidebar-section ul{list-style:none;padding:0;margin:0}.sidebar-section li a{display:block;padding:.3rem .8rem;margin:.1rem 0;border-radius:8px;transition:all .2s ease;font-weight:500;font-size:.85rem;text-decoration:none;color:var(--text-color);opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.sidebar-section li a:hover{background:#ffffff1a;opacity:1;transform:translate(4px)}.sidebar-section li.active a{background:#ffffff40;opacity:1;font-weight:700;box-shadow:0 4px 12px #0000001a;border:1px solid rgba(255,255,255,.2)}.sidebar-footer{margin-top:auto;padding-top:1.5rem;border-top:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;gap:.5rem}.sidebar-footer a{opacity:.6;padding:.5rem .8rem;border-radius:8px;text-decoration:none;color:var(--text-color);font-size:.9rem;font-family:var(--font-heading)}.sidebar-footer a:hover{background:#ffffff0d;opacity:1}.sidebar-quick-controls{display:flex;align-items:center;gap:.15rem;margin-bottom:.25rem}.sidebar-controls-divider{width:1px;height:1rem;background:#80808040;margin:0 .25rem}.sidebar-icon-btn{background:none;border:none;cursor:pointer;font-size:.8rem;padding:.25rem .35rem;border-radius:4px;color:var(--text-color);opacity:.35;transition:opacity .15s,background .15s;font-family:inherit;text-transform:none;font-weight:400;height:auto;line-height:1}.sidebar-icon-btn:hover{opacity:.8;background:#ffffff14;border:none}.sidebar-icon-btn.active{opacity:1;background:#ffffff26;color:var(--text-color)}.theme-dark .sidebar-icon-btn{color:#000000de;border:none;background:none}.theme-dark .sidebar-icon-btn:hover{background:#0000000f;border:none}.theme-dark .sidebar-icon-btn.active{background:#0000001f}.main-content{width:100%;height:100%;min-width:0;overflow-y:auto;background-color:var(--bg-color);padding:1.5rem 2rem;transition:padding .3s ease}@media(max-width:1024px){.main-content{padding:4rem 1rem 1rem}}.main-content>*{max-width:35em;margin-left:auto;margin-right:auto}.sidebar-toggle{position:fixed;top:1rem;left:1rem;z-index:1001;background:none;border:none;width:3rem;height:3rem;font-size:1.5rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .2s cubic-bezier(.175,.885,.32,1.275)}.sidebar-toggle:hover{transform:scale(1.1)}.sidebar-toggle:active{transform:scale(.95)}.sidebar-backdrop{display:none;position:fixed;inset:0;background:#0000004d;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:999}@media(max-width:1024px){.sidebar-visible .sidebar-backdrop{display:block}.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1);box-shadow:none}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}}@media(min-width:1025px){.sidebar{position:fixed;top:0;left:0;bottom:0;z-index:1000;transform:translate(-100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.sidebar-visible .sidebar{transform:translate(0);box-shadow:10px 0 20px #0000001a}.sidebar-hidden .sidebar{transform:translate(-100%)}}.sidebar-hidden .sidebar,.sidebar-visible .sidebar{display:flex}input[type=text],input[type=url],input[type=search],select{padding:.4rem .8rem;border-radius:8px;border:1px solid var(--border-color);background:var(--bg-color);color:var(--text-color);font-family:inherit;font-size:.9rem}input:focus,select:focus{outline:none;border-color:var(--accent-color);box-shadow:0 0 0 2px #007bff33}.logo{font-size:2.5rem;margin:0 0 1.5rem;cursor:pointer;text-align:center;-webkit-user-select:none;user-select:none}.sidebar .logo{margin-bottom:1.5rem}.item-list{list-style:none;padding:0;margin:0}.feed-item{padding:1rem .5rem;margin-top:2rem;border-bottom:none;border-radius:8px;transition:background-color .2s ease}.feed-item.selected{background-color:#007bff0d;box-shadow:inset 4px 0 0 var(--accent-color)}.theme-dark .feed-item.selected{background-color:#2188ff1a}.item-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:.5rem}.item-title{font-family:var(--font-heading);font-size:1.8rem;font-weight:700;text-decoration:none;color:var(--link-color);display:block;flex:1;cursor:pointer}.item-title:hover{text-decoration:underline}.star-btn{background:none;border:none;cursor:pointer;font-size:1.25rem;padding:0 0 0 .5rem;vertical-align:middle;transition:color .2s;line-height:1}.star-btn.is-starred{color:#00f}.star-btn.is-unstarred{color:var(--text-color);opacity:.3}.dateline{margin-top:0;font-weight:400;font-size:.75em;color:#ccc;margin-bottom:1rem}.dateline a{color:#ccc;text-decoration:none}.item-description{color:var(--text-color);line-height:1.5;font-size:1rem;margin-top:1rem;overflow-wrap:break-word;word-break:break-word}.item-description a{text-decoration:none;color:var(--link-color)}.item-description img,.item-description video,.item-description pre{max-width:100%;height:auto;display:block;margin:1rem 0}.item-description pre{white-space:pre-wrap;word-wrap:break-word;overflow-x:auto;background:#0000000d;padding:1em;border-radius:4px}.scrape-btn{background:var(--bg-color);border:1px solid var(--border-color, #ccc);color:#00f;cursor:pointer;font-family:var(--font-heading);font-weight:700;font-size:.8rem;padding:2px 6px;margin-left:.5rem}.theme-dark{--bg-color: #000000;--text-color: #ffffff;--sidebar-bg: #000000;--link-color: #5ac8fa;--border-color: #333333;--accent-color: #2188ff;--sidebar-text-color: rgba(0, 0, 0, .87)}.theme-dark .sidebar{background:#b4b4b4d9;border-right-color:#00000026}.theme-dark .sidebar-section li a,.theme-dark .sidebar-section h3,.theme-dark .sidebar-footer a{color:#000000de}.theme-dark .sidebar-section li.active a{background:#00000026}.theme-dark .sidebar-section li a:hover{background:#00000014}.theme-dark .sidebar-toggle{background:none}.theme-dark .sidebar-search input{background:#ffffffb3;color:#000000de;border-color:#0003}.font-serif{--font-body: Georgia, "Times New Roman", Times, serif;font-family:var(--font-body)}.font-sans{--font-body: var(--font-heading-system);font-family:var(--font-body)}.font-mono{--font-body: var(--font-mono);font-family:var(--font-body)}.heading-font-default{--font-heading: var(--font-heading-system)}.heading-font-serif{--font-heading: Georgia, "Times New Roman", Times, serif}.heading-font-mono{--font-heading: var(--font-mono)}.heading-font-sans{--font-heading: var(--font-sans)}.theme-dark .settings-view,.theme-dark .settings-view h2,.theme-dark .settings-view h3,.theme-dark .settings-group label,.theme-dark .data-group label{color:var(--text-color)!important}.settings-view{padding-top:2rem;font-family:var(--font-heading);color:var(--text-color)}.settings-view h2{font-size:2rem;font-weight:700;margin-bottom:2rem;letter-spacing:-.02em}.settings-grid{display:flex;flex-direction:column;gap:2rem;margin-bottom:2rem}.settings-section{margin:0;padding:0;border:none}.settings-section h3{font-family:var(--font-heading);font-size:1.2rem;font-weight:700;margin-top:0;margin-bottom:1rem;border:none;padding-bottom:0;color:var(--text-color)}.settings-group label,.data-group label{display:block;font-size:.8rem;font-weight:700;text-transform:uppercase;margin-bottom:.5rem;opacity:.6;font-family:var(--font-heading)}.theme-options{display:flex;gap:.5rem}button,.button{border-radius:6px;border:1px solid var(--border-color);padding:.5rem 1rem;font-size:.8rem;font-weight:700;text-transform:uppercase;font-family:var(--font-heading);background-color:var(--bg-color);cursor:pointer;transition:all .2s;color:var(--text-color);text-decoration:none;display:inline-block;text-align:center;height:2.2rem;line-height:1.1;box-sizing:border-box}button:hover,.button:hover{border-color:var(--text-color);background:#0000000d}.theme-dark button,.theme-dark .button{background-color:transparent;color:var(--text-color);border-color:var(--border-color)}.theme-dark button:hover,.theme-dark .button:hover{background:#ffffff1a;border-color:var(--text-color)}button.active,.theme-dark button.active{background-color:var(--text-color);color:var(--bg-color);border-color:var(--text-color)}.add-feed-form{display:flex;gap:.5rem;width:100%}.add-feed-form input{flex:1;height:2.2rem}.button-group{display:flex;gap:.5rem;align-items:center}.manage-feed-list{display:flex;flex-direction:column;padding:0;list-style:none;border-top:1px solid var(--border-color);width:100%}.manage-feed-item{display:flex;align-items:center;padding:1rem 0;border-bottom:1px solid var(--border-color);background:transparent;gap:1rem;width:100%;border-radius:0}.feed-info{flex:1;min-width:0}.feed-title{font-weight:700;font-size:1rem;margin-bottom:.2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-url{font-size:.85rem;opacity:.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-heading)}.feed-actions{display:flex;gap:.5rem;align-items:center}.feed-tag-input{width:120px;padding:.4rem;height:2.2rem}.delete-feed-btn{color:var(--error-color, #d32f2f)!important;border-color:var(--error-color, #d32f2f)!important}.delete-feed-btn:hover{background-color:#d32f2f1a!important}.manage-feeds-section{width:100%;margin-top:2rem}@media(max-width:768px){.manage-feed-item{flex-direction:column;align-items:flex-start}.feed-actions{width:100%;margin-top:.5rem}.feed-tag-input{flex:1}} diff --git a/web/dist/v3/assets/index-UNWwwUlG.js b/web/dist/v3/assets/index-UNWwwUlG.js deleted file mode 100644 index 985c76e..0000000 --- a/web/dist/v3/assets/index-UNWwwUlG.js +++ /dev/null @@ -1,179 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function a(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=a(s);fetch(s.href,o)}})();function C(e){const a=`; ${document.cookie}`.split(`; ${e}=`);if(a.length===2)return a.pop()?.split(";").shift()}async function f(e,t){const a=t?.method?.toUpperCase()||"GET",n=["POST","PUT","DELETE"].includes(a),s=new Headers(t?.headers||{});if(n){const o=C("csrf_token");o&&s.set("X-CSRF-Token",o)}return fetch(e,{...t,headers:s,credentials:"include"})}function H(){const e=document.cookie.split("; ").find(t=>t.startsWith("neko_sidebar="));return e?e.split("=")[1]==="1":null}function P(e){document.cookie=`neko_sidebar=${e?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function M(){const e=H();return e!==null?e:window.innerWidth>1024}class O extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";styleTheme=localStorage.getItem("neko-style-theme")||"default";sidebarVisible=M();setFeeds(t){this.feeds=t,this.emit("feeds-updated")}setTags(t){this.tags=t,this.emit("tags-updated")}setItems(t,a=!1){a?this.items=[...this.items,...t]:this.items=t,this.emit("items-updated")}setActiveFeed(t){this.activeFeedId=t,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(t){this.activeTagName=t,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(t){this.filter!==t&&(this.filter=t,this.emit("filter-updated"))}setSearchQuery(t){this.searchQuery!==t&&(this.searchQuery=t,this.emit("search-updated"))}setLoading(t){this.loading=t,this.emit("loading-state-changed")}setHasMore(t){this.hasMore=t}setTheme(t){this.theme=t,localStorage.setItem("neko-theme",t),this.emit("theme-updated")}setFontTheme(t){this.fontTheme=t,localStorage.setItem("neko-font-theme",t),this.emit("theme-updated")}setHeadingFontTheme(t){this.headingFontTheme=t,localStorage.setItem("neko-heading-font-theme",t),this.emit("theme-updated")}setStyleTheme(t){this.styleTheme=t,localStorage.setItem("neko-style-theme",t),this.emit("style-theme-updated")}setSidebarVisible(t){this.sidebarVisible=t,P(t),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(t,a){this.dispatchEvent(new CustomEvent(t,{detail:a}))}on(t,a){this.addEventListener(t,a)}}const i=new O;class x extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const t=new URL(window.location.href),n=t.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const o={};return n[0]==="feed"&&n[1]?(s="/feed",o.feedId=n[1]):n[0]==="tag"&&n[1]?(s="/tag",o.tagName=decodeURIComponent(n[1])):n[0]==="settings"&&(s="/settings"),{path:s,params:o,query:t.searchParams}}navigate(t,a){let n=`/v3${t}`;if(a){const s=new URLSearchParams(a);n+=`?${s.toString()}`}window.history.pushState({},"",n),this.handleRouteChange()}updateQuery(t){const a=new URL(window.location.href);for(const[n,s]of Object.entries(t))s?a.searchParams.set(n,s):a.searchParams.delete(n);window.history.pushState({},"",a.toString()),this.handleRouteChange()}}const r=new x;function q(e,t=!1){const a=new Date(e.publish_date).toLocaleDateString();return` -
  • - - - ${e.full_content||e.description?` -
    - ${e.full_content||e.description} -
    - `:""} -
  • - `}const T=["default","refined","terminal","codex","sakura"];function $(e){const t=document.getElementById("style-theme-link");if(t&&t.remove(),e==="default")return;const a=document.createElement("link");a.id="style-theme-link",a.rel="stylesheet",a.href=`/v3/themes/${e}.css`,document.head.appendChild(a)}let c=null,g=null;function D(){g=document.querySelector("#app"),g&&(g.className=`theme-${i.theme} font-${i.fontTheme} heading-font-${i.headingFontTheme}`,g.innerHTML=` -
    - - - -
    -
    -
    -
    - `,N())}function N(){document.getElementById("search-input")?.addEventListener("input",s=>{const o=s.target.value;r.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>r.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",s=>{s.preventDefault(),W()}),document.getElementById("sidebar-theme-toggle")?.addEventListener("click",()=>{i.setTheme(i.theme==="light"?"dark":"light")}),document.getElementById("sidebar-style-cycle")?.addEventListener("click",()=>{const s=T.indexOf(i.styleTheme),o=T[(s+1)%T.length];i.setStyleTheme(o)}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{i.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{i.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(s=>{s.addEventListener("click",()=>{s.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",s=>{const o=s.target,d=o.closest("a");if(!d){o.classList.contains("logo")&&(s.preventDefault(),r.navigate("/",{}));return}const h=d.getAttribute("data-nav"),m=Object.fromEntries(r.getCurrentRoute().query.entries());if(h==="filter"){s.preventDefault();const u=d.getAttribute("data-value");r.getCurrentRoute().path==="/settings"?r.navigate("/",{...m,filter:u}):r.updateQuery({filter:u})}else if(h==="tag"){s.preventDefault();const u=d.getAttribute("data-value");r.navigate(`/tag/${encodeURIComponent(u)}`,m)}else if(h==="feed"){s.preventDefault();const u=d.getAttribute("data-value"),l=r.getCurrentRoute();i.activeFeedId===parseInt(u)&&l.path!=="/settings"?r.navigate("/",m):r.navigate(`/feed/${u}`,m)}else h==="settings"&&(s.preventDefault(),r.getCurrentRoute().path==="/settings"?r.navigate("/",m):r.navigate("/settings",m));window.innerWidth<=768&&i.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",s=>{const o=s.target,d=o.closest('[data-action="toggle-star"]');if(d){const l=d.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));V(v)}return}const h=o.closest('[data-action="scrape"]');if(h){const l=h.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));X(v)}return}const m=o.closest('[data-action="open"]'),u=o.closest(".feed-item");if(u&&!m){const l=parseInt(u.getAttribute("data-id"));c=l,document.querySelectorAll(".feed-item").forEach(y=>{const B=parseInt(y.getAttribute("data-id")||"0");y.classList.toggle("selected",B===c)});const v=i.items.find(y=>y._id===l);v&&!v.read&&p(l,{read:!0})}})}function F(){const{feeds:e,activeFeedId:t}=i,a=document.getElementById("feed-list");a&&(a.innerHTML=e.map(n=>` -
  • - - ${n.title||n.url} - -
  • - `).join(""))}function _(){}function R(){const{filter:e}=i,t=document.getElementById("filter-list");t&&t.querySelectorAll("li").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-filter")===e)})}function w(){const{items:e,loading:t}=i,a=document.getElementById("content-area");if(!a||r.getCurrentRoute().path==="/settings")return;if(t&&e.length===0){a.innerHTML='

    Loading items...

    ';return}if(e.length===0){a.innerHTML='

    No items found.

    ';return}a.innerHTML=` -
      - ${e.map(s=>q(s,s._id===c)).join("")} -
    - ${i.hasMore?'
    Loading more...
    ':""} - `;const n=document.getElementById("main-content");if(n){let s=null;n.onscroll=()=>{!i.loading&&i.hasMore&&n.scrollHeight>n.clientHeight&&n.scrollHeight-n.scrollTop-n.clientHeight<200&&S(),s===null&&(s=window.setTimeout(()=>{A(n),s=null},250))}}}function A(e){const t=e.getBoundingClientRect();i.items.forEach(a=>{if(a.read)return;const n=document.querySelector(`.feed-item[data-id="${a._id}"]`);n&&n.getBoundingClientRect().bottom{const e=document.getElementById("main-content");if(i.loading||!i.hasMore)return;if(e&&(A(e),e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200)){S();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,a=window.innerHeight,n=window.scrollY||document.documentElement.scrollTop;t>a&&t-a-n<200&&S()},1e3);function b(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=` -
    -

    Settings

    - -
    -
    -

    Data

    - -
    -
    - - - -
    - -
    -
    - -
    -

    Theme

    -
    -
    - - -
    -
    -
    - -
    -

    Style

    -
    -
    - ${T.map(n=>``).join(` - `)} -
    -
    -
    - -
    -

    Fonts

    -
    - - - - - -
    -
    -
    - -
    -

    Manage Feeds

    - -
    - - -
    - -
      - ${i.feeds.map(n=>` -
    • -
      -
      ${n.title||n.url}
      -
      ${n.url}
      -
      -
      - - -
      -
    • - `).join("")} -
    -
    -
    - `,document.getElementById("theme-options")?.addEventListener("click",n=>{const s=n.target.closest("button");s&&(i.setTheme(s.getAttribute("data-theme")),b())}),document.getElementById("style-theme-options")?.addEventListener("click",n=>{const s=n.target.closest("button");s&&i.setStyleTheme(s.getAttribute("data-style-theme"))}),document.getElementById("heading-font-selector")?.addEventListener("change",n=>{i.setHeadingFontTheme(n.target.value)}),document.getElementById("font-selector")?.addEventListener("change",n=>{i.setFontTheme(n.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const n=document.getElementById("new-feed-url"),s=n.value.trim();s&&(await j(s)?(n.value="",alert("Feed added successfully!"),E()):alert("Failed to add feed."))});let t="opml";const a=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(n=>{n.addEventListener("click",s=>{t=s.currentTarget.getAttribute("data-format")||"opml",a.click()})}),a?.addEventListener("change",async n=>{const s=n.target.files?.[0];s&&(await Q(s,t)?(alert(`Import (${t}) started! check logs.`),E()):alert("Failed to import.")),a.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(n=>{n.addEventListener("click",async s=>{const o=parseInt(s.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await U(o),await E(),b())})})}async function j(e){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).ok}catch(t){return console.error("Failed to add feed",t),!1}}async function Q(e,t){try{const a=new FormData;a.append("file",e),a.append("format",t);const n=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":n||""},body:a})).ok}catch(a){return console.error("Failed to import",a),!1}}async function U(e){try{return(await f(`/api/feed/${e}`,{method:"DELETE"})).ok}catch(t){return console.error("Failed to delete feed",t),!1}}async function V(e){const t=i.items.find(a=>a._id===e);t&&p(e,{starred:!t.starred})}async function X(e){if(i.items.find(a=>a._id===e))try{const a=await f(`/api/item/${e}/content`);if(a.ok){const n=await a.json();n.full_content&&p(e,{full_content:n.full_content})}}catch(a){console.error("Failed to fetch full content",a)}}async function p(e,t){try{if((await f(`/api/item/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok){const n=i.items.find(s=>s._id===e);if(n){Object.assign(n,t);const s=document.querySelector(`.feed-item[data-id="${e}"]`);if(s){if(t.read!==void 0&&s.classList.toggle("read",t.read),t.starred!==void 0){const o=s.querySelector(".star-btn");o&&(o.classList.toggle("is-starred",t.starred),o.classList.toggle("is-unstarred",!t.starred),o.setAttribute("title",t.starred?"Unstar":"Star"))}t.full_content&&w()}}}}catch(a){console.error("Failed to update item",a)}}async function E(){const e=await f("/api/feed/");if(e.ok){const t=await e.json();i.setFeeds(t)}}async function J(){const e=await f("/api/tag");if(e.ok){const t=await e.json();i.setTags(t)}}async function I(e,t,a=!1){i.setLoading(!0);try{const n=new URLSearchParams;e&&n.append("feed_id",e),t&&n.append("tag",t),i.searchQuery&&n.append("q",i.searchQuery),(i.filter==="starred"||i.filter==="all")&&n.append("read_filter","all"),i.filter==="starred"&&n.append("starred","true"),a&&i.items.length>0&&n.append("max_id",String(i.items[i.items.length-1]._id));const s=await f(`/api/stream?${n.toString()}`);if(s.ok){const o=await s.json();i.setHasMore(o.length>0),i.setItems(o,a)}}finally{i.setLoading(!1)}}async function S(){const e=r.getCurrentRoute();I(e.params.feedId,e.params.tagName,!0)}async function W(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function k(){const e=r.getCurrentRoute(),t=e.query.get("filter");i.setFilter(t||"unread");const a=e.query.get("q");if(a!==null&&i.setSearchQuery(a),e.path==="/settings"){b();return}if(e.path==="/feed"&&e.params.feedId){const n=parseInt(e.params.feedId);i.setActiveFeed(n),I(e.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else e.path==="/tag"&&e.params.tagName?(i.setActiveTag(e.params.tagName),I(void 0,e.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(i.setActiveFeed(null),i.setActiveTag(null),I())}window.addEventListener("keydown",e=>{if(!["INPUT","TEXTAREA"].includes(e.target.tagName))switch(e.key){case"j":L(1);break;case"k":L(-1);break;case"r":if(c){const t=i.items.find(a=>a._id===c);t&&p(t._id,{read:!t.read})}break;case"s":if(c){const t=i.items.find(a=>a._id===c);t&&p(t._id,{starred:!t.starred})}break;case"/":e.preventDefault(),document.getElementById("search-input")?.focus();break}});function L(e){if(i.items.length===0)return;const t=i.items.findIndex(n=>n._id===c);let a;if(t===-1?a=e>0?0:i.items.length-1:a=t+e,a>=0&&a{const o=parseInt(s.getAttribute("data-id")||"0");s.classList.toggle("selected",o===c)});const n=document.querySelector(`.feed-item[data-id="${c}"]`);n&&n.scrollIntoView({block:"start",behavior:"smooth"}),i.items[a].read||p(c,{read:!0})}}i.on("feeds-updated",F);i.on("tags-updated",_);i.on("active-feed-updated",F);i.on("active-tag-updated",_);i.on("filter-updated",R);i.on("search-updated",()=>{const e=document.getElementById("search-input");e&&e.value!==i.searchQuery&&(e.value=i.searchQuery),k()});i.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${i.theme} font-${i.fontTheme} heading-font-${i.headingFontTheme}`);const e=document.getElementById("sidebar-theme-toggle");e&&(e.textContent=i.theme==="light"?"☽":"☀",e.title=i.theme==="light"?"Switch to dark mode":"Switch to light mode"),r.getCurrentRoute().path==="/settings"&&b()});i.on("sidebar-toggle",()=>{const e=document.querySelector(".layout");e&&(i.sidebarVisible?(e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible")):(e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden")))});i.on("style-theme-updated",()=>{$(i.styleTheme);const e=document.getElementById("sidebar-style-cycle");e&&(e.textContent=`${i.styleTheme==="default"?"◯":"◉"} ${i.styleTheme}`,e.title=`Style: ${i.styleTheme}`),r.getCurrentRoute().path==="/settings"&&b()});i.on("items-updated",w);i.on("loading-state-changed",w);r.addEventListener("route-changed",k);window.app={navigate:e=>r.navigate(e)};async function G(){const e=await f("/api/auth");if(!e||e.status===401){window.location.href="/login/";return}D(),$(i.styleTheme),R();try{await Promise.all([E(),J()])}catch(t){console.error("Initial fetch failed",t)}k()}typeof window<"u"&&!window.__VITEST__&&G(); diff --git a/web/dist/v3/index.html b/web/dist/v3/index.html index 3101db5..e0f57ef 100644 --- a/web/dist/v3/index.html +++ b/web/dist/v3/index.html @@ -5,8 +5,8 @@ neko - - + +
    -- cgit v1.2.3