Add integrated downloads manager and UI
Implements a full downloads manager with Electron main process handling, IPC APIs, and renderer integration. Adds a dedicated downloads page, a mini downloads popup in the navigation bar with progress ring, and controls for pausing, resuming, canceling, opening, and showing downloads. Updates styles and navigation to support the new downloads features.
This commit is contained in:
@@ -170,6 +170,44 @@ html, body {
|
||||
/* subtle inner highlight adds edge definition */
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
|
||||
transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
|
||||
line-height: 0; /* avoid vertical misalignment for glyphs */
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#downloads-btn svg { display:block; width: 18px; height: 18px; }
|
||||
|
||||
/* Downloads button chrome to match other nav buttons */
|
||||
#downloads-btn {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(50,54,74,0.96), rgba(38,42,60,0.96)) padding-box,
|
||||
linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.45)) border-box;
|
||||
color: var(--muted);
|
||||
border: 1px solid transparent;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
|
||||
transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease, color 120ms ease;
|
||||
line-height: 0;
|
||||
padding: 0;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
#downloads-btn:hover { filter: brightness(1.05); box-shadow: 0 4px 14px rgba(0,0,0,0.35); color: var(--text); }
|
||||
#downloads-btn:active { transform: translateY(1px) scale(0.98); }
|
||||
#downloads-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.55); }
|
||||
#downloads-btn:focus { outline: none; box-shadow: none; }
|
||||
|
||||
/* Match home-active chrome variant */
|
||||
body:has(#home-container.active) #downloads-btn {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(60,66,90,0.98), rgba(44,48,68,0.98)) padding-box,
|
||||
linear-gradient(180deg, rgba(255,255,255,0.22), rgba(0,0,0,0.5)) border-box;
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
|
||||
}
|
||||
|
||||
.nav-left button:hover,
|
||||
@@ -267,6 +305,54 @@ html, body {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Downloads mini popup anchored to the downloads button */
|
||||
.downloads-wrapper { position: relative; z-index: 10002; }
|
||||
#downloads-popup {
|
||||
position: absolute;
|
||||
top: 34px;
|
||||
right: 0;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(30,34,50,0.95), rgba(25,28,42,0.95)) padding-box,
|
||||
linear-gradient(135deg, rgba(140, 86, 255, 0.18), rgba(62, 149, 255, 0.14)) border-box;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 12px;
|
||||
min-width: 280px;
|
||||
box-shadow: var(--shadow-1);
|
||||
padding: 8px;
|
||||
-webkit-backdrop-filter: blur(var(--blur));
|
||||
backdrop-filter: blur(var(--blur));
|
||||
transition: opacity 160ms ease, transform 160ms ease;
|
||||
}
|
||||
#downloads-popup.hidden { opacity: 0; transform: translateY(-6px); visibility: hidden; pointer-events: none; }
|
||||
.downloads-pop-header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 2px 8px; }
|
||||
.downloads-pop-header > span { font-weight: 600; color: var(--text); }
|
||||
.downloads-pop-header > button { background: transparent; border: none; color: var(--accent); cursor: pointer; }
|
||||
.downloads-pop-list { display:flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; }
|
||||
.downloads-empty { color: #aaa; font-size: 12px; text-align: center; padding: 16px 8px; }
|
||||
.dl-item { display:grid; grid-template-columns: 1fr auto; gap: 6px 8px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 8px; }
|
||||
.dl-file { font-size: 12px; color: #eee; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
|
||||
.dl-meta { font-size: 11px; color: #bbb; }
|
||||
.dl-actions { display:flex; gap:6px; }
|
||||
.dl-actions button { background: transparent; color: #ddd; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
|
||||
.dl-progress { height: 4px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; grid-column: 1 / -1; }
|
||||
.dl-bar { height: 100%; background: #3b82f6; width: 0%; transition: width .12s linear; }
|
||||
|
||||
/* Circular progress ring around downloads button */
|
||||
#downloads-btn { position: relative; }
|
||||
#downloads-btn .ring {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 40px; /* slightly larger than 34px button for halo */
|
||||
height: 40px;
|
||||
transform: translate(-50%, -50%);
|
||||
border-radius: 50%;
|
||||
pointer-events: none;
|
||||
}
|
||||
#downloads-btn .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
|
||||
#downloads-btn .ring circle.bg { stroke: rgba(255,255,255,0.15); stroke-width: 3; fill: none; }
|
||||
#downloads-btn .ring circle.fg { stroke: #3b82f6; stroke-width: 3; fill: none; stroke-linecap: round; transition: stroke-dashoffset .12s linear, opacity .12s ease; }
|
||||
|
||||
/* WEBVIEWS */
|
||||
#webviews {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user