diff --git a/css/main.css b/css/main.css
index f04db15..8578277 100644
--- a/css/main.css
+++ b/css/main.css
@@ -381,12 +381,14 @@ ul {
display: grid;
gap: 0.5rem;
padding-bottom: 4rem;
- grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}
.torrent-card {
- display: flex;
- flex-direction: column;
+ display: grid;
+ gap: 0 1rem;
+ align-items: center;
+ grid-template-columns: auto 1fr auto;
+ grid-template-areas: "icon title button" "icon tags button";
cursor: pointer;
padding: 1rem;
border-radius: 0.3rem;
@@ -395,26 +397,14 @@ ul {
}
.torrent-card__icon {
grid-area: icon;
- display: flex;
- padding: 0.6rem;
- border-radius: 50%;
- margin-bottom: 1.5rem;
- align-items: center;
- justify-content: center;
- align-self: flex-start;
- aspect-ratio: 1/1;
- flex-shrink: 0;
- background-color: var(--accent-color);
}
.torrent-card__icon .icon {
height: 1.6rem;
width: 1.6rem;
- fill: white;
}
.torrent-card__title {
grid-area: title;
- font-size: 1.2rem;
- margin-bottom: 0.5rem;
+ font-size: 1.1rem;
}
.torrent-card__tags {
grid-area: tags;
@@ -422,7 +412,6 @@ ul {
white-space: nowrap;
text-overflow: ellipsis;
font-size: 0.85rem;
- margin-bottom: 1.5rem;
color: rgba(var(--text-color), 0.7);
}
.torrent-card__description {
@@ -439,8 +428,7 @@ ul {
.torrent-card__download-button {
grid-area: button;
justify-self: flex-end;
- margin-top: auto;
- justify-content: center;
+ align-self: flex-start;
background-color: rgba(var(--text-color), 0.1);
}
.torrent-card__download-button .icon {
@@ -452,16 +440,62 @@ ul {
--width: min(42rem, 100%);
}
+.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;
+ background-color: var(--accent-color);
+}
+.torrent-type-icon .icon {
+ fill: white;
+}
+
+#torrent_type_icon {
+ grid-area: icon;
+ margin-bottom: 1rem;
+}
+#torrent_type_icon .icon {
+ height: 2rem;
+ width: 2rem;
+}
+
+#torrent_name {
+ margin-bottom: 1rem;
+}
+
+#torrent__description {
+ font-size: 0.9rem;
+ color: rgba(var(--text-color), 0.8);
+}
+
+#torrent_download_button {
+ color: white;
+ margin-top: 2rem;
+ background-color: var(--accent-color);
+ width: 100%;
+ justify-content: center;
+ padding: 1rem;
+}
+#torrent_download_button .icon {
+ fill: white;
+}
+
#main_footer {
padding: 3rem 0;
background-color: rgba(var(--text-color), 0.06);
}
@media only screen and (max-width: 640px) {
+ .popup__header {
+ padding: 0 1.5rem;
+ }
+
.torrent-card {
- display: grid;
- gap: 0 1rem;
- align-items: center;
grid-template-columns: auto 1fr;
grid-template-areas: "icon title" "icon tags" "icon button";
}
@@ -469,7 +503,7 @@ ul {
margin: 0;
}
.torrent-card__title {
- font-size: 1.1rem;
+ font-size: 1rem;
}
.torrent-card__tags {
margin-bottom: 0;
@@ -483,6 +517,10 @@ ul {
}
}
@media only screen and (min-width: 640px) {
+ .popup__header {
+ padding: 1.5rem 1.5rem 0 1.5rem;
+ }
+
.page-layout {
grid-template-columns: 1fr 90vw 1fr;
}
@@ -493,7 +531,6 @@ ul {
.torrent-card {
padding: 1.5rem;
- min-height: 22rem;
}
}
@media only screen and (min-width: 1280px) {
diff --git a/css/main.min.css b/css/main.min.css
index 69e96e7..3225709 100644
--- a/css/main.min.css
+++ b/css/main.min.css
@@ -1 +1 @@
-a:any-link,button{position:relative;display:inline-flex;outline:0;cursor:pointer;font-weight:500}.torrent-card__size,a:any-link,button{font-weight:500}a,a:any-link{color:inherit;text-decoration:none}.overflow-ellipsis,.torrent-card__tags{white-space:nowrap;text-overflow:ellipsis}*{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:#2353FF;--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)}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)}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2{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:70ch;line-height:1.5;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;color:inherit;font-size:.9rem;border-radius:.2rem;padding:.5rem .6rem;-webkit-tap-highlight-color:transparent;border:none}.torrent-card,a:any-link{border-radius:.3rem;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:solid rgba(var(--text-color),1)}a:any-link{align-items:center;background:0 0;font-size:.8rem;padding:.4rem .6rem;align-self:flex-start;border:1px solid}a:any-link:focus-visible{outline:solid rgba(var(--text-color),1)}sm-input,sm-textarea{--border-radius:2rem;--background:rgba(var(--text-color), 0.06)}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}.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,.torrent-card{flex-direction:column}.space-between{justify-content:space-between}.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.16);pointer-events:none}.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 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}#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)}#search_section{display:grid;gap:1rem;padding:3rem 0}#search_torrent{width:min(22rem,100%)}#search_torrent .icon{height:1.2rem;fill:rgba(var(--text-color),.7)}#torrent_container{padding:1.5rem 0;display:grid;gap:.5rem;padding-bottom:4rem;grid-template-columns:repeat(auto-fill,minmax(16rem,1fr))}.torrent-card{display:flex;cursor:pointer;padding:1rem;background-color:rgba(var(--text-color),.06)}.torrent-card__icon{grid-area:icon;display:flex;padding:.6rem;border-radius:50%;margin-bottom:1.5rem;align-items:center;justify-content:center;align-self:flex-start;aspect-ratio:1/1;flex-shrink:0;background-color:var(--accent-color)}.torrent-card__icon .icon{height:1.6rem;width:1.6rem;fill:#fff}.torrent-card__title{grid-area:title;font-size:1.2rem;margin-bottom:.5rem}.torrent-card__tags{grid-area:tags;overflow:hidden;font-size:.85rem;margin-bottom:1.5rem;color:rgba(var(--text-color),.7)}.torrent-card__description{font-size:.9rem;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;color:rgba(var(--text-color),.8)}.torrent-card__download-button{grid-area:button;justify-self:flex-end;margin-top:auto;justify-content:center;background-color:rgba(var(--text-color),.1)}.torrent-card__download-button .icon{height:1.4rem;margin-right:.5rem}#torrent_popup{--width:min(42rem, 100%)}#main_footer{padding:3rem 0;background-color:rgba(var(--text-color),.06)}@media only screen and (max-width:640px){.torrent-card{display:grid;gap:0 1rem;align-items:center;grid-template-columns:auto 1fr;grid-template-areas:"icon title" "icon tags" "icon button"}.torrent-card__icon{margin:0}.torrent-card__title{font-size:1.1rem}.torrent-card__tags{margin-bottom:0;font-size:.7rem}.torrent-card__description{display:none}.torrent-card__download-button{margin-top:1rem}}@media only screen and (min-width:640px){#main_header,.torrent-card{padding:1.5rem}.page-layout{grid-template-columns:1fr 90vw 1fr}.torrent-card{min-height:22rem}}@media only screen and (min-width:1280px){.page-layout{grid-template-columns:1fr 90vw 1fr}.multi-form{grid-template-columns:1fr 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)}}
\ No newline at end of file
+a:any-link,button{position:relative;display:inline-flex;background:0 0;outline:0;cursor:pointer}a,a:any-link{color:inherit;text-decoration:none}.hide,.ripple{pointer-events:none}.overflow-ellipsis,.torrent-card__tags{white-space:nowrap;text-overflow:ellipsis}#torrent_name,#torrent_type_icon{margin-bottom:1rem}*{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:#2353FF;--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)}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)}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2{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:70ch;line-height:1.5;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;color:inherit;font-size:.9rem;font-weight:500;border-radius:.2rem;padding:.5rem .6rem;-webkit-tap-highlight-color:transparent;border:none}.torrent-card,a:any-link{border-radius:.3rem;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:solid rgba(var(--text-color),1)}a:any-link{align-items:center;font-weight:500;font-size:.8rem;padding:.4rem .6rem;align-self:flex-start;border:1px solid}a:any-link:focus-visible{outline:solid rgba(var(--text-color),1)}sm-input,sm-textarea{--border-radius:2rem;--background:rgba(var(--text-color), 0.06)}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}.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}.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.16)}.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 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}#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)}#search_section{display:grid;gap:1rem;padding:3rem 0}#search_torrent{width:min(22rem,100%)}#search_torrent .icon{height:1.2rem;fill:rgba(var(--text-color),.7)}#torrent_download_button .icon,.torrent-type-icon .icon{fill:#fff}#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:auto 1fr auto;grid-template-areas:"icon title button" "icon tags button";cursor:pointer;padding:1rem;background-color:rgba(var(--text-color),.06)}.torrent-card__icon{grid-area:icon}.torrent-card__icon .icon{height:1.6rem;width:1.6rem}.torrent-card__title{grid-area:title;font-size:1.1rem}.torrent-card__tags{grid-area:tags;overflow:hidden;font-size:.85rem;color:rgba(var(--text-color),.7)}#torrent__description,.torrent-card__description{font-size:.9rem;color:rgba(var(--text-color),.8)}.torrent-card__description{overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.torrent-card__size{font-weight:500}.torrent-card__download-button{grid-area:button;justify-self:flex-end;align-self:flex-start;background-color:rgba(var(--text-color),.1)}#torrent_download_button,.torrent-type-icon{background-color:var(--accent-color);padding:1rem}.torrent-card__download-button .icon{height:1.4rem;margin-right:.5rem}#torrent_popup{--width:min(42rem, 100%)}.torrent-type-icon{display:flex;border-radius:50%;align-items:center;justify-content:center;align-self:flex-start;aspect-ratio:1/1;flex-shrink:0}#torrent_type_icon{grid-area:icon}#torrent_type_icon .icon{height:2rem;width:2rem}#torrent_download_button{color:#fff;margin-top:2rem;width:100%;justify-content:center}#main_footer{padding:3rem 0;background-color:rgba(var(--text-color),.06)}@media only screen and (max-width:640px){.popup__header{padding:0 1.5rem}.torrent-card{grid-template-columns:auto 1fr;grid-template-areas:"icon title" "icon tags" "icon button"}.torrent-card__icon{margin:0}.torrent-card__title{font-size:1rem}.torrent-card__tags{margin-bottom:0;font-size:.7rem}.torrent-card__description{display:none}.torrent-card__download-button{margin-top:1rem}}@media only screen and (min-width:640px){.popup__header{padding:1.5rem 1.5rem 0}.page-layout{grid-template-columns:1fr 90vw 1fr}#main_header,.torrent-card{padding:1.5rem}}@media only screen and (min-width:1280px){.page-layout{grid-template-columns:1fr 90vw 1fr}.multi-form{grid-template-columns:1fr 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)}}
\ No newline at end of file
diff --git a/css/main.scss b/css/main.scss
index 0036872..d6b2f1f 100644
--- a/css/main.scss
+++ b/css/main.scss
@@ -327,11 +327,14 @@ ul{
display: grid;
gap: 0.5rem;
padding-bottom: 4rem;
- grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
+ // grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}
.torrent-card{
- display: flex;
- flex-direction: column;
+ display: grid;
+ gap: 0 1rem;
+ align-items: center;
+ grid-template-columns: auto 1fr auto;
+ grid-template-areas: 'icon title button' 'icon tags button';
cursor: pointer;
padding: 1rem;
border-radius: 0.3rem;
@@ -339,26 +342,14 @@ ul{
background-color: rgba(var(--text-color), 0.06);
&__icon{
grid-area: icon;
- display: flex;
- padding: 0.6rem;
- border-radius: 50%;
- margin-bottom: 1.5rem;
- align-items: center;
- justify-content: center;
- align-self: flex-start;
- aspect-ratio: 1/1;
- flex-shrink: 0;
- background-color: var(--accent-color);
.icon{
height: 1.6rem;
width: 1.6rem;
- fill: white;
}
}
&__title{
grid-area: title;
- font-size: 1.2rem;
- margin-bottom: 0.5rem;
+ font-size: 1.1rem;
}
&__tags{
grid-area: tags;
@@ -366,7 +357,6 @@ ul{
white-space: nowrap;
text-overflow: ellipsis;
font-size: 0.85rem;
- margin-bottom: 1.5rem;
color: rgba(var(--text-color), 0.7);
}
&__description{
@@ -383,8 +373,7 @@ ul{
&__download-button{
grid-area: button;
justify-self: flex-end;
- margin-top: auto;
- justify-content: center;
+ align-self: flex-start;
background-color: rgba(var(--text-color), 0.1);
.icon{
height: 1.4rem;
@@ -395,22 +384,62 @@ ul{
#torrent_popup{
--width: min(42rem, 100%);
}
+.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;
+ background-color: var(--accent-color);
+ .icon{
+ fill: white;
+ }
+}
+#torrent_type_icon{
+ grid-area: icon;
+ margin-bottom: 1rem;
+ .icon{
+ height: 2rem;
+ width: 2rem;
+ }
+}
+#torrent_name{
+ margin-bottom: 1rem;
+}
+#torrent__description{
+ font-size: 0.9rem;
+ color: rgba(var(--text-color), 0.8);
+}
+#torrent_download_button{
+ color: white;
+ margin-top: 2rem;
+ background-color: var(--accent-color);
+ width: 100%;
+ justify-content: center;
+ padding: 1rem;
+ .icon{
+ fill: white;
+ }
+}
#main_footer{
padding: 3rem 0;
background-color: rgba(var(--text-color), 0.06);
}
@media only screen and (max-width: 640px) {
+ .popup__header{
+ padding: 0 1.5rem;
+ }
.torrent-card{
- display: grid;
- gap: 0 1rem;
- align-items: center;
grid-template-columns: auto 1fr;
grid-template-areas: 'icon title' 'icon tags' 'icon button';
&__icon{
margin: 0;
}
&__title{
- font-size: 1.1rem;
+ font-size: 1rem;
}
&__tags{
margin-bottom: 0;
@@ -425,6 +454,9 @@ ul{
}
}
@media only screen and (min-width: 640px) {
+ .popup__header{
+ padding: 1.5rem 1.5rem 0 1.5rem;
+ }
.page-layout{
grid-template-columns: 1fr 90vw 1fr;
}
@@ -433,7 +465,6 @@ ul{
}
.torrent-card{
padding: 1.5rem;
- min-height: 22rem;
}
}
@media only screen and (min-width: 1280px) {
diff --git a/index.html b/index.html
index c62530d..6d66a60 100644
--- a/index.html
+++ b/index.html
@@ -27,11 +27,17 @@
@@ -61,7 +67,7 @@
-
+
@@ -723,14 +729,26 @@
window.addEventListener('load', e => {
showLatestTorrents()
})
+
+ let currentTorrent
getRef('torrent_container').addEventListener('click', async e => {
if(e.target.closest('.torrent-card__download-button')){
const _target = e.target.closest('.torrent-card__download-button')
const card = _target.closest('.torrent-card')
const cardId = parseInt(card.id)
- const {filename, chunks, startTx} = await getDataFromIDB(cardId)
downloadTorrent(filename, startTx, chunks)
}
+ else if(e.target.closest('.torrent-card')){
+ const card = e.target.closest('.torrent-card')
+ const cardId = parseInt(card.id)
+ currentTorrent = await getDataFromIDB(cardId)
+ const {id, name, description, tags, type = 'misc', size, uploader, startTx, filename, chunks} = currentTorrent
+ getRef('torrent_type_icon').innerHTML = getIcon(type)
+ getRef('torrent_name').textContent = name
+ getRef('torrent_description').textContent = description
+ getRef('torrent_tags').textContent = tags.split('/').join('•')
+ getRef('torrent_popup').show()
+ }
})
const render = {
torrentCard(obj){
@@ -738,11 +756,16 @@
const card = getRef('torrent_card_template').content.cloneNode(true).firstElementChild
card.id = id
card.querySelector('.torrent-card__title').textContent = name
- card.querySelector('.torrent-card__tags').textContent = tags
+ card.querySelector('.torrent-card__tags').textContent = tags.split('/').join('•')
// card.querySelector('.torrent-card__description').textContent = description
// card.querySelector('.torrent-card__size').textContent = size
- let icon
- switch(type.toLowerCase()){
+ card.querySelector('.torrent-card__icon').innerHTML = getIcon(type)
+ return card
+ }
+ }
+ function getIcon(type){
+ let icon
+ switch(type.toLowerCase()){
case 'movie':
icon = ``
break
@@ -770,11 +793,8 @@
default :
icon = ``
break
-
}
- card.querySelector('.torrent-card__icon').innerHTML = icon
- return card
- }
+ return icon
}
function renderTorrents(torrents){
const torrentsFrag = document.createDocumentFragment()
@@ -786,7 +806,7 @@
async function showLatestTorrents(){
getRef('torrent_container').innerHTML = ``
let allTorrents = await getTorrents()
- allTorrents = allTorrents.reverse().slice(0, 8)
+ allTorrents = allTorrents.reverse().slice(0, 50)
getRef('torrent_container').append(renderTorrents(allTorrents))
}