diff --git a/components.js b/components.js index 30b36e9..58005ac 100644 --- a/components.js +++ b/components.js @@ -1,3 +1,4 @@ +/*jshint esversion: 6 */ //Button const smButton = document.createElement('template') smButton.innerHTML = ` @@ -1707,7 +1708,7 @@ customElements.define('strip-select', class extends HTMLElement{ this.stripSelect = this.shadowRoot.querySelector('.strip-select') this.slottedOptions this._value - this.scrollDistance = 300 + this.scrollDistance } get value() { return this._value @@ -1743,13 +1744,14 @@ customElements.define('strip-select', class extends HTMLElement{ const navButtonLeft = this.shadowRoot.querySelector('.nav-button--left') const navButtonRight = this.shadowRoot.querySelector('.nav-button--right') slot.addEventListener('slotchange', e => { - slot.assignedElements().forEach(elem => { + const assignedElements = slot.assignedElements() + assignedElements.forEach(elem => { if (elem.hasAttribute('selected')) { elem.setAttribute('active', '') this._value = elem.value } }) - if (slot.assignedElements().length) { + if (assignedElements.length > 0) { firstOptionObserver.observe(slot.assignedElements()[0]) lastOptionObserver.observe(slot.assignedElements()[slot.assignedElements().length - 1]) } @@ -1758,8 +1760,23 @@ customElements.define('strip-select', class extends HTMLElement{ navButtonRight.classList.add('hide') coverLeft.classList.add('hide') coverRight.classList.add('hide') + firstOptionObserver.disconnect() + lastOptionObserver.disconnect() } }) + const resObs = new ResizeObserver(entries => { + entries.forEach(entry => { + if(entry.contentBoxSize) { + // Firefox implements `contentBoxSize` as a single content rect, rather than an array + const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize; + + this.scrollDistance = contentBoxSize.inlineSize * 0.6 + } else { + this.scrollDistance = entry.contentRect.width * 0.6 + } + }) + }) + resObs.observe(this) this.stripSelect.addEventListener('option-clicked', e => { if (this._value !== e.target.value) { this._value = e.target.value @@ -1782,7 +1799,8 @@ customElements.define('strip-select', class extends HTMLElement{ }) }, { - threshold: 0.9 + threshold: 0.9, + root: this }) const lastOptionObserver = new IntersectionObserver(entries => { entries.forEach(entry => { @@ -1797,7 +1815,8 @@ customElements.define('strip-select', class extends HTMLElement{ }) }, { - threshold: 0.9 + threshold: 0.9, + root: this }) navButtonLeft.addEventListener('click', this.scrollLeft) navButtonRight.addEventListener('click', this.scrollRight) @@ -1827,8 +1846,9 @@ stripOption.innerHTML = ` flex-shrink: 0; cursor: pointer; white-space: nowrap; - border-radius: var(--border-radius); padding: 0.5rem 0.8rem; + transition: background 0.3s; + border-radius: var(--border-radius); -webkit-tap-highlight-color: transparent; } :host([active]) .strip-option{ @@ -1868,16 +1888,19 @@ customElements.define('strip-option', class extends HTMLElement{ }) ) } + handleKeyDown = (e) => { + if (e.key === 'Enter' || e.key === 'Space') { + this.fireEvent() + } + } connectedCallback() { this._value = this.getAttribute('value') - this.addEventListener('click', e => { - this.fireEvent() - }) - this.addEventListener('keyup', e => { - if (e.key === 'Enter' || e.key === 'Space') { - this.fireEvent() - } - }) + this.addEventListener('click', this.fireEvent) + this.addEventListener('keydown', this.handleKeyDown) + } + disconnectedCallback() { + this.removeEventListener('click', this.fireEvent) + this.removeEventListener('keydown', this.handleKeyDown) } }) diff --git a/css/main.css b/css/main.css index 70aa5d3..6869f9c 100644 --- a/css/main.css +++ b/css/main.css @@ -301,6 +301,12 @@ ul { fill: rgba(var(--text-color), 0.9); } +.button__icon { + height: 1.2rem; + width: 1.2rem; + margin-right: 0.5rem; +} + .page-layout { position: relative; display: grid; @@ -536,6 +542,7 @@ ul { } .progress-indicator { + position: relative; justify-self: flex-end; height: 2.3rem; padding: 0 0.6rem; @@ -545,25 +552,37 @@ ul { font-size: 0.9rem; font-weight: 500; color: rgba(var(--text-color), 0.8); + width: 9ch; + text-align: right; } -.progress-loader { +.progress-loader, +.placeholder-loader { height: 1.2rem; width: 1.2rem; fill: none; padding: 0.1rem; - stroke-width: 16; + stroke-width: 12; overflow: visible; - margin-right: 0.5rem; +} + +.progress-loader { stroke-dasharray: 201; stroke-dashoffset: 201; transform: rotate(-90deg); stroke: var(--accent-color); transition: stroke-dashoffset 0.3s; + z-index: 1; +} + +.placeholder-loader { + position: absolute; + stroke: rgba(var(--text-color), 0.1); } .torrent-preview { display: grid; + justify-content: center; } .torrent-preview__info-section { @@ -605,23 +624,24 @@ ul { display: flex; width: 100%; font-size: 0.85rem; - margin-bottom: 0.3rem; + margin-bottom: 0.5rem; color: rgba(var(--text-color), 0.8); } #torrent_name { + line-height: 1.1; font-size: 1.8rem; margin-bottom: 2rem; } -#torrent__description { - font-size: 0.9rem; +#torrent_description { + font-size: 1rem; color: rgba(var(--text-color), 0.8); } #torrent_uploader { font-weight: 500; - margin-top: 1rem; + margin: 1.5rem 0 1rem 0; width: auto; border-radius: 1.5rem; padding: 0.3rem 0.8rem; @@ -649,6 +669,18 @@ ul { margin-right: 0.5rem; } +#torrent_index_tx { + padding: 0.4rem; + font-size: 0.9rem; + border-radius: 0.5rem; + align-self: flex-start; + border: solid var(--accent-color) thin; +} +#torrent_index_tx .icon { + height: 1.2rem; + margin-right: 0.5rem; +} + #advance_search_section { align-items: flex-start; padding: 1rem 0; @@ -666,6 +698,36 @@ sm-option { font-size: 0.9rem; } +#filter_popup { + --width: min(32rem, 100%); +} + +.option-selector { + padding: 1rem 0; +} + +.filter-option { + display: inline-flex; + margin: 0 0.5rem 0.8rem 0; +} +.filter-option input[type=radio] { + display: none; +} +.filter-option input[type=radio]:checked ~ .option-text { + color: rgba(255, 255, 255, 0.9); + background-color: var(--accent-color); + border: solid var(--accent-color) thin; +} +.filter-option .option-text { + font-weight: 500; + cursor: pointer; + user-select: none; + border-radius: 0.3rem; + padding: 0.5rem 0.8rem; + color: rgba(var(--text-color), 0.8); + border: solid rgba(var(--text-color), 0.2) thin; +} + #page_selector strip-option, #search_page_selector strip-option { --border-radius: 0.3rem; @@ -712,7 +774,7 @@ sm-option { } @media only screen and (min-width: 640px) { .popup__header { - padding: 1.5rem 1.5rem 0 1.5rem; + padding: 1.5rem 1.5rem 0 0.5rem; } .auto-grid-2 { @@ -735,7 +797,7 @@ sm-option { padding: 1.5rem; } - #torrent_popup { + #filter_popup { --min-height: 80vh; } @@ -745,6 +807,7 @@ sm-option { #torrent_name { font-size: 4rem; + max-width: 16ch; } } @media only screen and (min-width: 1280px) { diff --git a/css/main.min.css b/css/main.min.css index 07c0d11..1995f12 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -a,button{color:inherit}*{padding:0;margin:0;box-sizing:border-box;font-family:Inter,sans-serif}:root{font-size:clamp(1rem,1.2vmax,3rem)}body,html{height:100%;scroll-behavior:smooth}body{--accent-color:#304FFE;--light-shade:rgba(var(--text-color), 0.06);--text-color:17,17,17;--text-color-light:100,100,100;--foreground-color:255,255,255;--background-color:#F6f6f6;--error-color:red;--green:#00843b;color:rgba(var(--text-color),1);background:var(--background-color);display:flex;flex-direction:column}a.button:any-link,button{display:inline-flex;background:0 0;padding:.5rem .6rem;font-weight:500;cursor:pointer;-webkit-tap-highlight-color:transparent}body[data-theme=dark]{--accent-color:#2353FF;--green:#13ff5a;--text-color:240,240,240;--text-color-light:170,170,170;--foreground-color:20,20,20;--background-color:#0a0a0a;--error-color:rgb(255, 106, 106)}main{flex:1}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2,.page__title{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}p{font-size:.8;max-width:60ch;line-height:1.7;color:rgba(var(--text-color),.8)}img{object-fit:cover}a{text-decoration:none}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color),1) inset}button{position:relative;overflow:hidden;align-items:center;outline:0;font-size:.9rem;border-radius:.2rem;border:none}button:focus-visible{outline:solid rgba(var(--text-color),1)}a.button:any-link{position:relative;align-items:center;outline:0;font-size:.8rem;border-radius:.3rem;align-self:flex-start;text-decoration:none;color:rgba(var(--text-color),.7);background-color:rgba(var(--text-color),.06)}a.button:any-link .icon{margin-right:.3rem;height:1.2rem}a:any-link:focus-visible{outline:solid rgba(var(--text-color),1)}sm-button{--border-radius:0.3rem}ul{list-style:none}.hide{opacity:0;pointer-events:none}.hide-completely{display:none!important}.no-transformations{transform:none!important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.flex{display:flex}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-items:flex-start}.align-center{align-items:center}.text-center{text-align:center}.justify-start{justify-content:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.16);pointer-events:none}#torrent_download_button,.button--primary,.torrent-type-icon{background-color:var(--accent-color)}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.icon{width:1.5rem;height:1.5rem;fill:rgba(var(--text-color),.9)}.page-layout{position:relative;display:grid;grid-template-columns:1rem minmax(0,1fr) 1rem}.page-layout>*{grid-column:2/3}.popup__header{display:grid;gap:.5rem;width:100%;padding:1rem 1.5rem;align-items:center;grid-template-columns:auto 1fr}.popup__header__close{padding:.5rem;cursor:pointer}.button--primary{color:#fff;font-weight:500;padding:.5rem 1.2rem}.auto-grid-2{gap:2rem;grid-template-columns:1fr}#error_page,#loading_page{position:relative;display:grid;height:100%;place-content:center;justify-items:center}#main_header{position:relative;display:flex;padding:1rem;align-items:center;justify-content:space-between;grid-template-columns:repeat(3,1fr)}#main_header__logo{height:1.8rem;width:1.8rem}.theme-switcher{position:relative;justify-self:flex-end;width:1.5rem;height:1.5rem;cursor:pointer;-webkit-tap-highlight-color:transparent}.theme-switcher .icon{position:absolute;transition:transform .6s}.theme-switcher__checkbox{display:none}.theme-switcher__checkbox:checked~.moon-icon{transform:scale(0) rotate(90deg)}.theme-switcher__checkbox:not(:checked)~.sun-icon{transform:scale(0) rotate(-90deg)}.page{padding-bottom:3rem}#search_section{position:relative;display:grid;gap:.5rem 0;padding:4rem 0;justify-items:center}.app-icon{height:3rem;width:3rem}.app-icon-loader{fill:none;stroke-width:2;justify-self:center;stroke-dasharray:202;margin:2rem 0;stroke:rgba(var(--text-color),1);animation:stroke-anim 2s infinite alternate}@keyframes stroke-anim{0%{stroke-dashoffset:202}100%{stroke-dashoffset:0}}.app-name{font-weight:500;margin-bottom:1rem;font-size:.9rem;color:rgba(var(--text-color),.7)}.search-container{position:relative;margin-bottom:1rem;width:min(28rem,100%)}.search-torrent{--border-radius:2rem;--background:rgba(var(--text-color), 0.06)}.search-torrent .icon{height:1.2rem;fill:rgba(var(--text-color),.7)}.search-suggestions-container{top:100%;position:absolute;z-index:1;width:100%;border-radius:1rem;margin-top:.5rem;box-shadow:0 .5rem 1rem -.5rem rgba(0,0,0,.2);background-color:rgba(var(--foreground-color),1)}.search-suggestions-container:not(:empty){padding:.5rem 0}.search-suggestion{display:flex;cursor:pointer;font-weight:700;font-size:.9rem;padding:.8rem 1rem;color:rgba(var(--text-color),.8);outline:0}.search-suggestion:active,.search-suggestion:focus{outline:0;border:0}.search-suggestion:focus,.search-suggestion:focus-visible{outline:transparent;background-color:rgba(var(--text-color),.1)}.search-suggestion span{font-weight:450}.search-suggestion pre{white-space:pre-wrap}.torrent-container{padding:1.5rem 0;display:grid;gap:.5rem;padding-bottom:4rem}.torrent-card{display:grid;gap:0 1rem;align-items:center;grid-template-columns:1fr auto;padding:1rem;border-radius:.3rem;-webkit-tap-highlight-color:transparent;background-color:rgba(var(--text-color),.06)}.torrent-card .torrent-info{gap:0 1rem;grid-template-columns:auto 1fr;grid-template-areas:"torrent-icon ." "torrent-icon ."}.torrent-card .torrent-type-icon{padding:.8rem}.torrent-card__icon{grid-area:torrent-icon}.torrent-card__icon .icon{height:1.4rem;width:1.4rem}.torrent-card__title{font-weight:600;font-size:1.1rem;margin-bottom:.5rem}.torrent-card__tags,.torrent-card__uploader{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:.85rem;color:rgba(var(--text-color),.7)}.torrent-card__download-button{justify-self:flex-end;align-self:flex-start;background-color:rgba(var(--text-color),.1)}.torrent-card__download-button .icon{height:1.4rem;margin-right:.5rem}.progress-indicator{justify-self:flex-end;height:2.3rem;padding:0 .6rem}.progress-percent{font-size:.9rem;font-weight:500;color:rgba(var(--text-color),.8)}.progress-loader{height:1.2rem;width:1.2rem;fill:none;padding:.1rem;stroke-width:16;overflow:visible;margin-right:.5rem;stroke-dasharray:201;stroke-dashoffset:201;transform:rotate(-90deg);stroke:var(--accent-color);transition:stroke-dashoffset .3s}.torrent-preview{display:grid}.torrent-preview__info-section{display:flex;flex-direction:column;align-content:flex-start}.torrent-type-icon{display:flex;padding:1rem;border-radius:50%;align-items:center;justify-content:center;align-self:flex-start;aspect-ratio:1/1;flex-shrink:0}#main_footer,#torrent_type_icon{background-color:rgba(var(--text-color),.06)}.torrent-type-icon .icon{fill:#fff}#torrent_type_icon{align-self:center;justify-self:center;padding:2rem;margin:3rem 0 4rem}#torrent_type_icon .icon{height:3rem;width:3rem;fill:rgba(var(--text-color),.3)}#torrent_tags,#torrent_uploader{display:flex;width:100%;font-size:.85rem;margin-bottom:.3rem;color:rgba(var(--text-color),.8)}#torrent_name{font-size:1.8rem;margin-bottom:2rem}#torrent__description{font-size:.9rem;color:rgba(var(--text-color),.8)}#torrent_uploader{font-weight:500;margin-top:1rem;width:auto;border-radius:1.5rem;padding:.3rem .8rem;align-self:flex-start;background-color:rgba(var(--text-color),.1)}#download_container{display:flex;align-items:center;height:3rem;margin-top:2rem}#torrent_download_button{align-self:flex-start;color:#fff;flex-shrink:0;padding:.7rem;justify-content:center}#torrent_download_button .icon{fill:#fff;margin-right:.5rem}#advance_search_section{align-items:flex-start;padding:1rem 0;margin-bottom:1rem}#advance_search_switch{justify-self:flex-start}#advance_search_switch h4{margin-left:1rem}sm-option{font-size:.9rem}#page_selector strip-option,#search_page_selector strip-option{--border-radius:0.3rem;--active-option-color:white;--active-option-backgroud-color:var(--accent-color)}#main_footer{padding:2rem 0}@media only screen and (max-width:640px){.popup__header{padding:0 1.5rem 0 .5rem}.torrent-card{grid-template-columns:1fr}.torrent-card__icon{margin:0}.torrent-card__title{font-size:.95rem}.torrent-card__tags,.torrent-card__uploader{font-size:.7rem}.torrent-card .progress-indicator,.torrent-card__download-button{margin-top:1rem}#torrent_tags{font-size:.8rem}#loader_container,#torrent_download_button{width:100%;justify-content:center}}@media only screen and (min-width:640px){.popup__header{padding:1.5rem 1.5rem 0}#main_header,.torrent-card{padding:1.5rem}.auto-grid-2{grid-template-columns:1fr 1fr}.page-layout{grid-template-columns:1fr 90vw 1fr}.page__title{font-size:3rem}#torrent_popup{--min-height:80vh}.torrent-preview{gap:3rem}#torrent_name{font-size:4rem}}@media only screen and (min-width:1280px){.page-layout{grid-template-columns:1fr 80vw 1fr}}@media (any-hover:hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color),.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color),.5)}.search-suggestion:hover{background-color:rgba(var(--text-color),.1)}} \ No newline at end of file +a,button{color:inherit}a.button:any-link,button{position:relative;display:inline-flex;padding:.5rem .6rem;font-weight:500;-webkit-tap-highlight-color:transparent;cursor:pointer}a,a.button:any-link{text-decoration:none}.hide,.ripple{pointer-events:none}*{padding:0;margin:0;box-sizing:border-box;font-family:Inter,sans-serif}:root{font-size:clamp(1rem,1.2vmax,3rem)}body,html{height:100%;scroll-behavior:smooth}body{--accent-color:#304FFE;--light-shade:rgba(var(--text-color), 0.06);--text-color:17,17,17;--text-color-light:100,100,100;--foreground-color:255,255,255;--background-color:#F6f6f6;--error-color:red;--green:#00843b;color:rgba(var(--text-color),1);background:var(--background-color);display:flex;flex-direction:column}body[data-theme=dark]{--accent-color:#2353FF;--green:#13ff5a;--text-color:240,240,240;--text-color-light:170,170,170;--foreground-color:20,20,20;--background-color:#0a0a0a;--error-color:rgb(255, 106, 106)}main{flex:1}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2,.page__title{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}p{font-size:.8;max-width:60ch;line-height:1.7;color:rgba(var(--text-color),.8)}img{object-fit:cover}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color),1) inset}button{overflow:hidden;align-items:center;background:0 0;outline:0;font-size:.9rem;border-radius:.2rem;border:none}button:focus-visible{outline:solid rgba(var(--text-color),1)}a.button:any-link{align-items:center;background:0 0;outline:0;font-size:.8rem;border-radius:.3rem;align-self:flex-start;color:rgba(var(--text-color),.7);background-color:rgba(var(--text-color),.06)}a.button:any-link .icon{margin-right:.3rem;height:1.2rem}a:any-link:focus-visible{outline:solid rgba(var(--text-color),1)}sm-button{--border-radius:0.3rem}ul{list-style:none}.hide{opacity:0}.hide-completely{display:none!important}.no-transformations{transform:none!important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.flex{display:flex}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-items:flex-start}.align-center{align-items:center}.text-center{text-align:center}.justify-start{justify-content:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.16)}#torrent_download_button,.button--primary,.torrent-type-icon{background-color:var(--accent-color)}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.icon{width:1.5rem;height:1.5rem;fill:rgba(var(--text-color),.9)}.button__icon{height:1.2rem;width:1.2rem;margin-right:.5rem}.page-layout{position:relative;display:grid;grid-template-columns:1rem minmax(0,1fr) 1rem}.page-layout>*{grid-column:2/3}.popup__header{display:grid;gap:.5rem;width:100%;padding:1rem 1.5rem;align-items:center;grid-template-columns:auto 1fr}.popup__header__close{padding:.5rem;cursor:pointer}.button--primary{color:#fff;font-weight:500;padding:.5rem 1.2rem}.auto-grid-2{gap:2rem;grid-template-columns:1fr}#error_page,#loading_page{position:relative;display:grid;height:100%;place-content:center;justify-items:center}#main_header{position:relative;display:flex;padding:1rem;align-items:center;justify-content:space-between;grid-template-columns:repeat(3,1fr)}#main_header__logo{height:1.8rem;width:1.8rem}.theme-switcher{position:relative;justify-self:flex-end;width:1.5rem;height:1.5rem;cursor:pointer;-webkit-tap-highlight-color:transparent}.theme-switcher .icon{position:absolute;transition:transform .6s}.theme-switcher__checkbox{display:none}.theme-switcher__checkbox:checked~.moon-icon{transform:scale(0) rotate(90deg)}.theme-switcher__checkbox:not(:checked)~.sun-icon{transform:scale(0) rotate(-90deg)}.page{padding-bottom:3rem}#search_section{position:relative;display:grid;gap:.5rem 0;padding:4rem 0;justify-items:center}.app-icon{height:3rem;width:3rem}.app-icon-loader{fill:none;stroke-width:2;justify-self:center;stroke-dasharray:202;margin:2rem 0;stroke:rgba(var(--text-color),1);animation:stroke-anim 2s infinite alternate}@keyframes stroke-anim{0%{stroke-dashoffset:202}100%{stroke-dashoffset:0}}.app-name{font-weight:500;margin-bottom:1rem;font-size:.9rem;color:rgba(var(--text-color),.7)}.search-container{position:relative;margin-bottom:1rem;width:min(28rem,100%)}.search-torrent{--border-radius:2rem;--background:rgba(var(--text-color), 0.06)}.search-torrent .icon{height:1.2rem;fill:rgba(var(--text-color),.7)}.search-suggestions-container{top:100%;position:absolute;z-index:1;width:100%;border-radius:1rem;margin-top:.5rem;box-shadow:0 .5rem 1rem -.5rem rgba(0,0,0,.2);background-color:rgba(var(--foreground-color),1)}.search-suggestions-container:not(:empty){padding:.5rem 0}.search-suggestion{display:flex;cursor:pointer;font-weight:700;font-size:.9rem;padding:.8rem 1rem;color:rgba(var(--text-color),.8);outline:0}.search-suggestion:active,.search-suggestion:focus{outline:0;border:0}.search-suggestion:focus,.search-suggestion:focus-visible{outline:transparent;background-color:rgba(var(--text-color),.1)}.search-suggestion span{font-weight:450}.search-suggestion pre{white-space:pre-wrap}.torrent-container{padding:1.5rem 0;display:grid;gap:.5rem;padding-bottom:4rem}.torrent-card{display:grid;gap:0 1rem;align-items:center;grid-template-columns:1fr auto;padding:1rem;border-radius:.3rem;-webkit-tap-highlight-color:transparent;background-color:rgba(var(--text-color),.06)}.torrent-card .torrent-info{gap:0 1rem;grid-template-columns:auto 1fr;grid-template-areas:"torrent-icon ." "torrent-icon ."}.torrent-card .torrent-type-icon{padding:.8rem}.torrent-card__icon{grid-area:torrent-icon}.torrent-card__icon .icon{height:1.4rem;width:1.4rem}.torrent-card__title{font-weight:600;font-size:1.1rem;margin-bottom:.5rem}.torrent-card__tags,.torrent-card__uploader{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:.85rem;color:rgba(var(--text-color),.7)}.torrent-card__download-button{justify-self:flex-end;align-self:flex-start;background-color:rgba(var(--text-color),.1)}.torrent-card__download-button .icon{height:1.4rem;margin-right:.5rem}.progress-indicator{position:relative;justify-self:flex-end;height:2.3rem;padding:0 .6rem}.progress-percent{font-size:.9rem;font-weight:500;color:rgba(var(--text-color),.8);width:9ch;text-align:right}.placeholder-loader,.progress-loader{height:1.2rem;width:1.2rem;fill:none;padding:.1rem;stroke-width:12;overflow:visible}.progress-loader{stroke-dasharray:201;stroke-dashoffset:201;transform:rotate(-90deg);stroke:var(--accent-color);transition:stroke-dashoffset .3s;z-index:1}.placeholder-loader{position:absolute;stroke:rgba(var(--text-color),.1)}.torrent-preview{display:grid;justify-content:center}.torrent-preview__info-section{display:flex;flex-direction:column;align-content:flex-start}.torrent-type-icon{display:flex;padding:1rem;border-radius:50%;align-items:center;justify-content:center;align-self:flex-start;aspect-ratio:1/1;flex-shrink:0}.torrent-type-icon .icon{fill:#fff}#torrent_type_icon{align-self:center;justify-self:center;padding:2rem;margin:3rem 0 4rem;background-color:rgba(var(--text-color),.06)}#torrent_type_icon .icon{height:3rem;width:3rem;fill:rgba(var(--text-color),.3)}#torrent_tags,#torrent_uploader{display:flex;width:100%;font-size:.85rem;margin-bottom:.5rem;color:rgba(var(--text-color),.8)}#torrent_name{line-height:1.1;font-size:1.8rem;margin-bottom:2rem}#torrent_description{font-size:1rem;color:rgba(var(--text-color),.8)}#torrent_uploader{font-weight:500;margin:1.5rem 0 1rem;width:auto;border-radius:1.5rem;padding:.3rem .8rem;align-self:flex-start;background-color:rgba(var(--text-color),.1)}#download_container{display:flex;align-items:center;height:3rem;margin-top:2rem}#torrent_download_button{align-self:flex-start;color:#fff;flex-shrink:0;padding:.7rem;justify-content:center}#torrent_download_button .icon{fill:#fff;margin-right:.5rem}#torrent_index_tx{padding:.4rem;font-size:.9rem;border-radius:.5rem;align-self:flex-start;border:var(--accent-color) solid thin}#torrent_index_tx .icon{height:1.2rem;margin-right:.5rem}#advance_search_section{align-items:flex-start;padding:1rem 0;margin-bottom:1rem}#advance_search_switch{justify-self:flex-start}#advance_search_switch h4{margin-left:1rem}sm-option{font-size:.9rem}#filter_popup{--width:min(32rem, 100%)}.option-selector{padding:1rem 0}.filter-option{display:inline-flex;margin:0 .5rem .8rem 0}.filter-option input[type=radio]{display:none}.filter-option input[type=radio]:checked~.option-text{color:rgba(255,255,255,.9);background-color:var(--accent-color);border:var(--accent-color) solid thin}.filter-option .option-text{font-weight:500;cursor:pointer;user-select:none;border-radius:.3rem;padding:.5rem .8rem;color:rgba(var(--text-color),.8);border:rgba(var(--text-color),.2) solid thin}#page_selector strip-option,#search_page_selector strip-option{--border-radius:0.3rem;--active-option-color:white;--active-option-backgroud-color:var(--accent-color)}#main_footer{padding:2rem 0;background-color:rgba(var(--text-color),.06)}@media only screen and (max-width:640px){.popup__header{padding:0 1.5rem 0 .5rem}.torrent-card{grid-template-columns:1fr}.torrent-card__icon{margin:0}.torrent-card__title{font-size:.95rem}.torrent-card__tags,.torrent-card__uploader{font-size:.7rem}.torrent-card .progress-indicator,.torrent-card__download-button{margin-top:1rem}#torrent_tags{font-size:.8rem}#loader_container,#torrent_download_button{width:100%;justify-content:center}}@media only screen and (min-width:640px){.popup__header{padding:1.5rem 1.5rem 0 .5rem}#main_header,.torrent-card{padding:1.5rem}.auto-grid-2{grid-template-columns:1fr 1fr}.page-layout{grid-template-columns:1fr 90vw 1fr}.page__title{font-size:3rem}#filter_popup{--min-height:80vh}.torrent-preview{gap:3rem}#torrent_name{font-size:4rem;max-width:16ch}}@media only screen and (min-width:1280px){.page-layout{grid-template-columns:1fr 80vw 1fr}}@media (any-hover:hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color),.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color),.5)}.search-suggestion:hover{background-color:rgba(var(--text-color),.1)}} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index 8633113..2bfcba7 100644 --- a/css/main.scss +++ b/css/main.scss @@ -244,11 +244,18 @@ ul{ .observe-empty-state:not(:empty) ~ .empty-state{ display: none; } + + .icon{ width: 1.5rem; height: 1.5rem; fill: rgba(var(--text-color), 0.9); } +.button__icon{ + height: 1.2rem; + width: 1.2rem; + margin-right: 0.5rem; +} .page-layout{ position: relative; @@ -477,6 +484,7 @@ ul{ } } .progress-indicator{ + position: relative; justify-self: flex-end; height: 2.3rem; padding: 0 0.6rem; @@ -485,23 +493,32 @@ ul{ font-size: 0.9rem; font-weight: 500; color: rgba(var(--text-color), 0.8); + width: 9ch; + text-align: right; } -.progress-loader{ +.progress-loader, +.placeholder-loader{ height: 1.2rem; width: 1.2rem; fill: none; padding: 0.1rem; - stroke-width: 16; + stroke-width: 12; overflow: visible; - margin-right: 0.5rem; +}.progress-loader{ stroke-dasharray: 201; stroke-dashoffset: 201; transform: rotate(-90deg); stroke: var(--accent-color); transition: stroke-dashoffset 0.3s; + z-index: 1; +} +.placeholder-loader{ + position: absolute; + stroke: rgba(var(--text-color), 0.1); } .torrent-preview{ display: grid; + justify-content: center; } .torrent-preview__info-section{ display: flex; @@ -539,20 +556,21 @@ ul{ display: flex; width: 100%; font-size: 0.85rem; - margin-bottom: 0.3rem; + margin-bottom: 0.5rem; color: rgba(var(--text-color), 0.8); } #torrent_name{ + line-height: 1.1; font-size: 1.8rem; margin-bottom: 2rem; } -#torrent__description{ - font-size: 0.9rem; +#torrent_description{ + font-size: 1rem; color: rgba(var(--text-color), 0.8); } #torrent_uploader{ font-weight: 500; - margin-top: 1rem; + margin: 1.5rem 0 1rem 0; width: auto; border-radius: 1.5rem; padding: 0.3rem 0.8rem; @@ -577,6 +595,17 @@ ul{ margin-right: 0.5rem; } } +#torrent_index_tx{ + padding: 0.4rem; + font-size: 0.9rem; + border-radius: 0.5rem; + align-self: flex-start; + border: solid var(--accent-color) thin; + .icon{ + height: 1.2rem; + margin-right: 0.5rem; + } +} #advance_search_section{ align-items: flex-start; padding: 1rem 0; @@ -592,6 +621,35 @@ sm-option{ font-size: 0.9rem; } +#filter_popup{ + --width: min(32rem, 100%); +} + +.option-selector{ + padding: 1rem 0; +} +.filter-option{ + display: inline-flex; + margin: 0 0.5rem 0.8rem 0; + input[type="radio"]{ + display: none; + } + input[type="radio"]:checked ~ .option-text{ + color: rgba(255, 255, 255, 0.9); + background-color: var(--accent-color); + border: solid var(--accent-color) thin; + } + .option-text{ + font-weight: 500; + cursor: pointer; + user-select: none; + border-radius: 0.3rem; + padding: 0.5rem 0.8rem; + color: rgba(var(--text-color), 0.8); + border: solid rgba(var(--text-color), 0.2) thin; + } +} + #page_selector, #search_page_selector{ strip-option{ @@ -636,7 +694,7 @@ sm-option{ } @media only screen and (min-width: 640px) { .popup__header{ - padding: 1.5rem 1.5rem 0 1.5rem; + padding: 1.5rem 1.5rem 0 0.5rem; } .auto-grid-2{ grid-template-columns: 1fr 1fr; @@ -653,7 +711,7 @@ sm-option{ .torrent-card{ padding: 1.5rem; } - #torrent_popup{ + #filter_popup{ --min-height: 80vh; } .torrent-preview{ @@ -661,6 +719,7 @@ sm-option{ } #torrent_name{ font-size: 4rem; + max-width: 16ch; } } @media only screen and (min-width: 1280px) { diff --git a/index.html b/index.html index a0e6325..691b587 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,8 @@ FLO Torrent - + + @@ -25,13 +26,30 @@ OK + + +
+

Category

+
+
+ + +
+
+ +