@internetarchive/collection-browser 0.2.1 → 0.2.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/{tiles/grid → assets/img}/icons/favorite-filled.d.ts +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/favorite-filled.js +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/favorite-filled.js.map +1 -1
- package/dist/src/{tiles/grid → assets/img}/icons/reviews.d.ts +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/reviews.js +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/reviews.js.map +1 -1
- package/dist/src/{tiles/grid → assets/img}/icons/upload.d.ts +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/upload.js +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/upload.js.map +1 -1
- package/dist/src/assets/img/icons/views.d.ts +1 -0
- package/dist/src/{tiles/grid → assets/img}/icons/views.js +1 -1
- package/dist/src/assets/img/icons/views.js.map +1 -0
- package/dist/src/mediatype/mediatype-config.js +10 -10
- package/dist/src/mediatype/mediatype-config.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +3 -0
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.d.ts +1 -0
- package/dist/src/tiles/grid/account-tile.js +31 -68
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +1 -0
- package/dist/src/tiles/grid/item-tile.js +43 -91
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +10 -0
- package/dist/src/tiles/grid/tile-stats.js +111 -0
- package/dist/src/tiles/grid/tile-stats.js.map +1 -0
- package/dist/src/tiles/list/tile-list-compact.d.ts +0 -1
- package/dist/src/tiles/list/tile-list-compact.js +0 -9
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +0 -1
- package/dist/src/tiles/list/tile-list.js +0 -9
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.js +5 -1
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/package.json +2 -2
- package/src/{tiles/grid → assets/img}/icons/favorite-filled.ts +0 -0
- package/src/{tiles/grid → assets/img}/icons/reviews.ts +0 -0
- package/src/{tiles/grid → assets/img}/icons/upload.ts +0 -0
- package/src/{tiles/grid → assets/img}/icons/views.ts +1 -1
- package/src/mediatype/mediatype-config.ts +10 -10
- package/src/sort-filter-bar/sort-filter-bar.ts +3 -0
- package/src/tiles/grid/account-tile.ts +30 -67
- package/src/tiles/grid/item-tile.ts +46 -94
- package/src/tiles/grid/tile-stats.ts +109 -0
- package/src/tiles/list/tile-list-compact.ts +0 -9
- package/src/tiles/list/tile-list.ts +0 -9
- package/src/tiles/mediatype-icon.ts +5 -1
- package/dist/src/tiles/grid/icons/account.d.ts +0 -1
- package/dist/src/tiles/grid/icons/account.js +0 -12
- package/dist/src/tiles/grid/icons/account.js.map +0 -1
- package/dist/src/tiles/grid/icons/views.d.ts +0 -2
- package/dist/src/tiles/grid/icons/views.js.map +0 -1
- package/src/tiles/grid/icons/account.ts +0 -12
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "The Internet Archive Collection Browser.",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"author": "Internet Archive",
|
|
6
|
-
"version": "0.2.1",
|
|
6
|
+
"version": "0.2.4-alpha.1",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@internetarchive/feature-feedback": "^0.1.2",
|
|
26
26
|
"@internetarchive/field-parsers": "^0.1.3",
|
|
27
27
|
"@internetarchive/histogram-date-range": "^0.1.6",
|
|
28
|
-
"@internetarchive/infinite-scroller": "^0.1.
|
|
28
|
+
"@internetarchive/infinite-scroller": "^0.1.3",
|
|
29
29
|
"@internetarchive/local-cache": "^0.2.1",
|
|
30
30
|
"@internetarchive/search-service": "^0.3.4",
|
|
31
31
|
"@internetarchive/shared-resize-observer": "^0.2.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { svg } from 'lit';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export const viewsIcon = svg`
|
|
4
4
|
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
5
5
|
<path
|
|
6
6
|
d="m98 50.5704143c-.2830293-.471515-.671154-1.1088947-1.1643742-1.9121392s-1.6003642-2.3617474-3.3214321-4.6755089c-1.7210678-2.3137614-3.522258-4.5325939-5.4035703-6.6564975-1.8813124-2.1239037-4.2828993-4.473133-7.2047606-7.0476881-2.9218612-2.5745551-5.8895067-4.7933876-8.9029363-6.6564976-3.0134295-1.86311-6.4628491-3.4330878-10.3482587-4.7099336-3.8854095-1.2768458-7.7822651-1.9142256-11.6905667-1.9121443-3.9083017.0020914-7.8051573.6154781-11.6905668 1.8401652-3.8854096 1.2246871-7.3702078 2.8301329-10.4543947 4.8163375-3.0841869 1.9862045-6.0278997 4.1695691-8.8311384 6.5500937s-5.2048256 4.7652219-7.2047605 7.1540919c-1.99993501 2.38887-3.75430043 4.5722346-5.26309632 6.5500938s-2.63883199 3.583305-3.39010829 4.8163374l-1.13003609 1.8401602c.2830293.4715149.67115403 1.1088946 1.16437421 1.9121391.49322017.8032445 1.5878776 2.3617475 3.28397229 4.6755089s3.47439274 4.521119 5.3348942 6.6220728c1.8605014 2.1009538 4.2506422 4.4387083 7.1704224 7.0132633 2.9197801 2.5745551 5.8874256 4.7819127 8.9029363 6.6220729 3.0155106 1.8401601 6.4774168 3.398663 10.3857184 4.6755088 3.9083017 1.2768458 7.8176438 1.9142256 11.7280266 1.9121443 3.9103827-.0020914 7.7957922-.6154781 11.6562286-1.8401652s7.3337886-2.818658 10.4200566-4.7819127 6.0299808-4.1351444 8.8311384-6.515669 5.2152311-4.7652219 7.2422203-7.1540919 3.8052873-4.5607597 5.3348942-6.515669c1.5296068-1.9549093 2.6721295-3.5488802 3.427568-4.7819127zm-24.5142913 0c0 6.467683-2.3079374 12.0152859-6.9238123 16.6428087s-10.1495139 6.9412843-16.600917 6.9412843c-6.4992683 0-12.0453939-2.3137615-16.6383767-6.9412843s-6.8894742-10.1751257-6.8894742-16.6428087 2.2964914-12.003811 6.8894742-16.608384 10.1391084-6.9068595 16.6383767-6.9068595c6.4534842 0 11.9871232 2.3022865 16.600917 6.9068595s6.9217312 10.140701 6.9238123 16.608384zm-23.5247293-10.552755c2.8261308 0 5.2870289 1.0619518 7.3826944 3.1858555 2.0956655 2.1239036 3.1434982 4.5795368 3.1434982 7.3668995 0 2.8332624-1.0478327 5.2888956-3.1434982 7.3668995-2.0956655 2.078004-4.5565636 3.1170059-7.3826944 3.1170059-2.873996 0-5.3348941-1.0264838-7.3826944-3.0794516-2.0478002-2.0529677-3.0717003-4.5200758-3.0717003-7.4013243 0-2.8332624 1.0239001-5.3003705 3.0717003-7.4013243 2.0478003-2.1009538 4.5086984-3.1514307 7.3826944-3.1514307z"
|
|
@@ -19,12 +19,12 @@ export const mediatypeConfig: { [key: string]: any } = {
|
|
|
19
19
|
text: 'Account',
|
|
20
20
|
},
|
|
21
21
|
audio: {
|
|
22
|
-
color: '#
|
|
22
|
+
color: '#00adef',
|
|
23
23
|
icon: audioIcon,
|
|
24
24
|
text: 'Audio',
|
|
25
25
|
},
|
|
26
26
|
collection: {
|
|
27
|
-
color: '#
|
|
27
|
+
color: '#4666ff',
|
|
28
28
|
icon: collectionIcon,
|
|
29
29
|
text: 'Collection',
|
|
30
30
|
},
|
|
@@ -34,7 +34,7 @@ export const mediatypeConfig: { [key: string]: any } = {
|
|
|
34
34
|
text: 'Data',
|
|
35
35
|
},
|
|
36
36
|
etree: {
|
|
37
|
-
color: '#
|
|
37
|
+
color: '#00adef',
|
|
38
38
|
icon: etreeIcon,
|
|
39
39
|
text: 'E-tree',
|
|
40
40
|
},
|
|
@@ -44,12 +44,12 @@ export const mediatypeConfig: { [key: string]: any } = {
|
|
|
44
44
|
text: 'Film',
|
|
45
45
|
},
|
|
46
46
|
image: {
|
|
47
|
-
color: '#
|
|
47
|
+
color: '#aa99c9',
|
|
48
48
|
icon: imagesIcon,
|
|
49
49
|
text: 'Image',
|
|
50
50
|
},
|
|
51
51
|
movies: {
|
|
52
|
-
color: '#
|
|
52
|
+
color: '#f1644b',
|
|
53
53
|
icon: filmIcon,
|
|
54
54
|
text: 'Movie',
|
|
55
55
|
},
|
|
@@ -59,27 +59,27 @@ export const mediatypeConfig: { [key: string]: any } = {
|
|
|
59
59
|
text: 'Radio',
|
|
60
60
|
},
|
|
61
61
|
software: {
|
|
62
|
-
color: '#
|
|
62
|
+
color: '#9ecc4f',
|
|
63
63
|
icon: softwareIcon,
|
|
64
64
|
text: 'Software',
|
|
65
65
|
},
|
|
66
66
|
texts: {
|
|
67
|
-
color: '#
|
|
67
|
+
color: '#faab3c',
|
|
68
68
|
icon: textsIcon,
|
|
69
69
|
text: 'Text',
|
|
70
70
|
},
|
|
71
71
|
tv: {
|
|
72
|
-
color: '#
|
|
72
|
+
color: '#f1644b',
|
|
73
73
|
icon: tvIcon,
|
|
74
74
|
text: 'TV',
|
|
75
75
|
},
|
|
76
76
|
video: {
|
|
77
|
-
color: '#
|
|
77
|
+
color: '#f1644b',
|
|
78
78
|
icon: videoIcon,
|
|
79
79
|
text: 'Video',
|
|
80
80
|
},
|
|
81
81
|
web: {
|
|
82
|
-
color: '#
|
|
82
|
+
color: '#ffcd27',
|
|
83
83
|
icon: webIcon,
|
|
84
84
|
text: 'Web',
|
|
85
85
|
},
|
|
@@ -359,6 +359,7 @@ export class SortFilterBar
|
|
|
359
359
|
this.displayMode = 'grid';
|
|
360
360
|
}}
|
|
361
361
|
class=${this.displayMode === 'grid' ? 'active' : ''}
|
|
362
|
+
title="Tile view"
|
|
362
363
|
>
|
|
363
364
|
${tileIcon}
|
|
364
365
|
</button>
|
|
@@ -370,6 +371,7 @@ export class SortFilterBar
|
|
|
370
371
|
this.displayMode = 'list-detail';
|
|
371
372
|
}}
|
|
372
373
|
class=${this.displayMode === 'list-detail' ? 'active' : ''}
|
|
374
|
+
title="Extended list view"
|
|
373
375
|
>
|
|
374
376
|
${listIcon}
|
|
375
377
|
</button>
|
|
@@ -381,6 +383,7 @@ export class SortFilterBar
|
|
|
381
383
|
this.displayMode = 'list-compact';
|
|
382
384
|
}}
|
|
383
385
|
class=${this.displayMode === 'list-compact' ? 'active' : ''}
|
|
386
|
+
title="Compact list view"
|
|
384
387
|
>
|
|
385
388
|
${compactIcon}
|
|
386
389
|
</button>
|
|
@@ -2,10 +2,7 @@ import { css, html, LitElement } from 'lit';
|
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { TileModel } from '../../models';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { favoriteFilledIcon } from './icons/favorite-filled';
|
|
7
|
-
import { reviewsIcon } from './icons/reviews';
|
|
8
|
-
import { uploadIcon } from './icons/upload';
|
|
5
|
+
import './tile-stats';
|
|
9
6
|
|
|
10
7
|
@customElement('account-tile')
|
|
11
8
|
export class AccountTile extends LitElement {
|
|
@@ -14,43 +11,37 @@ export class AccountTile extends LitElement {
|
|
|
14
11
|
render() {
|
|
15
12
|
return html`
|
|
16
13
|
<div class="outer-holder">
|
|
14
|
+
<div id="header-holder">
|
|
15
|
+
<div id="title-holder">
|
|
16
|
+
<h1 class="truncated">${this.model?.identifier}</h1>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
17
20
|
<div class="inner-holder">
|
|
18
|
-
<div id="
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
id="avatar"
|
|
25
|
-
style="background-image: url('https://archive.org/services/img/${this
|
|
26
|
-
.model?.identifier}')"
|
|
27
|
-
></div>
|
|
28
|
-
</div>
|
|
21
|
+
<div id="avatar-holder">
|
|
22
|
+
<img
|
|
23
|
+
id="avatar"
|
|
24
|
+
alt="patron-avatar"
|
|
25
|
+
src="https://archive.org/services/img/${this.model?.identifier}"
|
|
26
|
+
/>
|
|
29
27
|
</div>
|
|
28
|
+
|
|
30
29
|
<div id="year-holder">
|
|
31
30
|
<div id="archivist-since">
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<h3>${this.model?.dateAdded?.getFullYear()}</h3>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
<div id="status-holder">
|
|
39
|
-
<div id="patron-icon">${accountIcon}</div>
|
|
40
|
-
<div class="stat-icon">
|
|
41
|
-
${uploadIcon}
|
|
42
|
-
<h3>${this.model?.itemCount}</h3>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="stat-icon">
|
|
45
|
-
${favoriteFilledIcon}
|
|
46
|
-
<h3>${this.model?.favCount}</h3>
|
|
47
|
-
</div>
|
|
48
|
-
<div class="stat-icon">
|
|
49
|
-
${reviewsIcon}
|
|
50
|
-
<h3>${this.model?.commentCount}</h3>
|
|
31
|
+
<span>
|
|
32
|
+
Archivist since ${this.model?.dateAdded?.getFullYear()}
|
|
33
|
+
</span>
|
|
51
34
|
</div>
|
|
52
35
|
</div>
|
|
53
36
|
</div>
|
|
37
|
+
|
|
38
|
+
<tile-stats
|
|
39
|
+
.mediatype=${this.model?.mediatype}
|
|
40
|
+
.itemCount=${this.model?.itemCount}
|
|
41
|
+
.favCount=${this.model?.favCount}
|
|
42
|
+
.commentCount=${this.model?.commentCount}
|
|
43
|
+
>
|
|
44
|
+
</tile-stats>
|
|
54
45
|
</div>
|
|
55
46
|
`;
|
|
56
47
|
}
|
|
@@ -63,9 +54,8 @@ export class AccountTile extends LitElement {
|
|
|
63
54
|
margin: 0;
|
|
64
55
|
}
|
|
65
56
|
|
|
66
|
-
|
|
57
|
+
span {
|
|
67
58
|
font-size: 14px;
|
|
68
|
-
font-weight: bold;
|
|
69
59
|
color: #2c2c2c;
|
|
70
60
|
margin: 0px;
|
|
71
61
|
}
|
|
@@ -77,27 +67,22 @@ export class AccountTile extends LitElement {
|
|
|
77
67
|
box-shadow: 1px 1px 2px 0px;
|
|
78
68
|
height: 100%;
|
|
79
69
|
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
80
71
|
text-align: center;
|
|
81
72
|
width: 100%;
|
|
82
73
|
}
|
|
83
74
|
|
|
84
75
|
.inner-holder {
|
|
85
|
-
|
|
86
|
-
width: 100%;
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
#header-holder {
|
|
92
|
-
flex: 1;
|
|
76
|
+
flex-grow: 1;
|
|
93
77
|
}
|
|
94
78
|
|
|
95
79
|
#title-holder {
|
|
80
|
+
flex-shrink: 0;
|
|
96
81
|
height: 40px;
|
|
97
|
-
margin-bottom: 5px;
|
|
98
82
|
}
|
|
99
83
|
|
|
100
84
|
#avatar-holder {
|
|
85
|
+
margin-top: 5px;
|
|
101
86
|
margin-bottom: 5px;
|
|
102
87
|
display: flex;
|
|
103
88
|
align-items: center;
|
|
@@ -117,22 +102,6 @@ export class AccountTile extends LitElement {
|
|
|
117
102
|
height: 40px;
|
|
118
103
|
}
|
|
119
104
|
|
|
120
|
-
#year-holder {
|
|
121
|
-
margin: 0px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
#status-holder {
|
|
125
|
-
height: 25px;
|
|
126
|
-
display: flex;
|
|
127
|
-
justify-content: space-evenly;
|
|
128
|
-
line-height: initial;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
#patron-icon {
|
|
132
|
-
height: 25px;
|
|
133
|
-
width: 25px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
105
|
.truncated {
|
|
137
106
|
flex: 1;
|
|
138
107
|
min-width: 0; /* Important for long words! */
|
|
@@ -142,15 +111,9 @@ export class AccountTile extends LitElement {
|
|
|
142
111
|
display: -webkit-box;
|
|
143
112
|
-webkit-box-orient: vertical;
|
|
144
113
|
word-wrap: break-word;
|
|
145
|
-
word-break: break-all;
|
|
146
114
|
line-height: 2rem;
|
|
147
115
|
text-align: center;
|
|
148
116
|
}
|
|
149
|
-
|
|
150
|
-
.stat-icon {
|
|
151
|
-
height: 10px;
|
|
152
|
-
width: 10px;
|
|
153
|
-
}
|
|
154
117
|
`;
|
|
155
118
|
}
|
|
156
119
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/* eslint-disable import/no-duplicates */
|
|
2
2
|
import { css, CSSResultGroup, html, LitElement, nothing } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
5
|
|
|
5
6
|
import { TileModel } from '../../models';
|
|
6
|
-
import { formatCount } from '../../utils/format-count';
|
|
7
|
-
|
|
8
|
-
import { favoriteFilledIcon } from './icons/favorite-filled';
|
|
9
|
-
import { reviewsIcon } from './icons/reviews';
|
|
10
|
-
import viewsIcon from './icons/views';
|
|
11
7
|
|
|
12
8
|
import '../mediatype-icon';
|
|
13
9
|
import '../item-image';
|
|
10
|
+
import './tile-stats';
|
|
14
11
|
|
|
15
12
|
@customElement('item-tile')
|
|
16
13
|
export class ItemTile extends LitElement {
|
|
@@ -19,84 +16,74 @@ export class ItemTile extends LitElement {
|
|
|
19
16
|
@property({ type: String }) baseImageUrl?: string;
|
|
20
17
|
|
|
21
18
|
render() {
|
|
22
|
-
const itemTitle = this.model?.title
|
|
19
|
+
const itemTitle = this.model?.title;
|
|
23
20
|
const itemCreator = this.model?.creator;
|
|
24
21
|
return html`
|
|
25
22
|
<div id="container">
|
|
26
|
-
<div id="
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
<item-image .model=${this.model} .baseImageUrl=${this.baseImageUrl}>
|
|
30
|
-
</item-image>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="item-creator">
|
|
33
|
-
<div class="truncated">
|
|
34
|
-
${itemCreator
|
|
35
|
-
? html`<span>by ${itemCreator}</span>`
|
|
36
|
-
: nothing}
|
|
37
|
-
</div>
|
|
23
|
+
<div id="inner-wrapper">
|
|
24
|
+
<div class="title-wrapper">
|
|
25
|
+
<h1 id="item-title" title=${ifDefined(itemTitle)}>${itemTitle}</h1>
|
|
38
26
|
</div>
|
|
39
|
-
</div>
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.mediatype=${this.model?.mediatype}
|
|
48
|
-
.collection=${this.model?.collections}
|
|
49
|
-
style="--iconHeight:25px; --iconWidth:25px;"
|
|
50
|
-
>
|
|
51
|
-
</mediatype-icon>
|
|
52
|
-
</div>
|
|
53
|
-
<div class="col">
|
|
54
|
-
${viewsIcon}
|
|
55
|
-
<p class="status-text">
|
|
56
|
-
${formatCount(this.model?.viewCount, 'short', 'short')}
|
|
57
|
-
</p>
|
|
28
|
+
<div class="image-wrapper">
|
|
29
|
+
<div id="item-image-container">
|
|
30
|
+
<item-image
|
|
31
|
+
.model=${this.model}
|
|
32
|
+
.baseImageUrl=${this.baseImageUrl}>
|
|
33
|
+
</item-image>
|
|
58
34
|
</div>
|
|
59
|
-
<div class="
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<p class="status-text">
|
|
68
|
-
${formatCount(this.model?.favCount, 'short', 'short')}
|
|
69
|
-
</p>
|
|
35
|
+
<div class="item-creator">
|
|
36
|
+
<div class="truncated">
|
|
37
|
+
${
|
|
38
|
+
itemCreator
|
|
39
|
+
? html`<span>by ${itemCreator}</span>`
|
|
40
|
+
: nothing
|
|
41
|
+
}
|
|
42
|
+
</div>
|
|
70
43
|
</div>
|
|
71
44
|
</div>
|
|
72
45
|
</div>
|
|
46
|
+
|
|
47
|
+
<tile-stats
|
|
48
|
+
.mediatype=${this.model?.mediatype}
|
|
49
|
+
.viewCount=${this.model?.viewCount}
|
|
50
|
+
.favCount=${this.model?.favCount}
|
|
51
|
+
.commentCount=${this.model?.commentCount}>
|
|
52
|
+
</tile-stats>
|
|
53
|
+
</div>
|
|
73
54
|
</div>
|
|
74
55
|
`;
|
|
75
56
|
}
|
|
76
57
|
|
|
77
58
|
static get styles(): CSSResultGroup {
|
|
78
|
-
const cornerRadiusCss = css`var(--collectionTileCornerRadius, 4px)`;
|
|
79
|
-
|
|
80
59
|
return css`
|
|
81
60
|
#container {
|
|
82
61
|
background-color: #ffffff;
|
|
83
|
-
border-radius:
|
|
62
|
+
border-radius: var(--collectionTileCornerRadius, 4px);
|
|
84
63
|
box-shadow: 1px 1px 2px 0px;
|
|
85
64
|
display: flex;
|
|
86
65
|
flex-direction: column;
|
|
87
66
|
height: 100%;
|
|
88
|
-
position: relative;
|
|
89
67
|
}
|
|
90
68
|
|
|
91
|
-
#
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
69
|
+
#inner-wrapper {
|
|
70
|
+
padding-top: 5px;
|
|
71
|
+
padding-left: 5px;
|
|
72
|
+
padding-right: 5px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.title-wrapper {
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.image-wrapper {
|
|
80
|
+
flex-grow: 1;
|
|
96
81
|
}
|
|
97
82
|
|
|
98
83
|
#item-title {
|
|
84
|
+
flex: 1;
|
|
99
85
|
color: #2c2c2c;
|
|
86
|
+
min-width: 0; /* Important for long words! */
|
|
100
87
|
font-size: 1.6rem;
|
|
101
88
|
text-align: center;
|
|
102
89
|
margin-top: 0rem;
|
|
@@ -104,6 +91,7 @@ export class ItemTile extends LitElement {
|
|
|
104
91
|
overflow: hidden;
|
|
105
92
|
text-overflow: ellipsis;
|
|
106
93
|
display: -webkit-box;
|
|
94
|
+
word-wrap: break-word;
|
|
107
95
|
-webkit-line-clamp: 2;
|
|
108
96
|
-webkit-box-orient: vertical;
|
|
109
97
|
line-height: 2rem;
|
|
@@ -114,6 +102,7 @@ export class ItemTile extends LitElement {
|
|
|
114
102
|
display: flex;
|
|
115
103
|
justify-content: center;
|
|
116
104
|
flex: 1;
|
|
105
|
+
height: 16rem;
|
|
117
106
|
}
|
|
118
107
|
|
|
119
108
|
.hidden {
|
|
@@ -139,6 +128,7 @@ export class ItemTile extends LitElement {
|
|
|
139
128
|
align-items: flex-end; /* Important to start text from bottom */
|
|
140
129
|
height: 3rem;
|
|
141
130
|
padding-top: 1rem;
|
|
131
|
+
margin-top: 5px;
|
|
142
132
|
}
|
|
143
133
|
|
|
144
134
|
.truncated {
|
|
@@ -158,44 +148,6 @@ export class ItemTile extends LitElement {
|
|
|
158
148
|
line-height: 2rem;
|
|
159
149
|
text-align: center;
|
|
160
150
|
}
|
|
161
|
-
|
|
162
|
-
.hr {
|
|
163
|
-
border: 0.5px solid #ccc;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
#item-stats-container {
|
|
167
|
-
align-items: center;
|
|
168
|
-
display: flex;
|
|
169
|
-
height: 5.5rem;
|
|
170
|
-
padding-left: 1rem;
|
|
171
|
-
padding-right: 0.5rem;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
#stats-holder {
|
|
175
|
-
align-items: center;
|
|
176
|
-
display: flex;
|
|
177
|
-
flex: 1;
|
|
178
|
-
justify-content: space-evenly;
|
|
179
|
-
text-align: center;
|
|
180
|
-
width: 100%;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
svg {
|
|
184
|
-
height: 10px;
|
|
185
|
-
width: 10px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.status-text {
|
|
189
|
-
font-size: 14px;
|
|
190
|
-
color: #2c2c2c;
|
|
191
|
-
margin: auto;
|
|
192
|
-
display: block;
|
|
193
|
-
text-align: center;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.col {
|
|
197
|
-
width: 25%;
|
|
198
|
-
}
|
|
199
151
|
`;
|
|
200
152
|
}
|
|
201
153
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { css, CSSResultGroup, html, LitElement } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
|
|
4
|
+
import { favoriteFilledIcon } from '../../assets/img/icons/favorite-filled';
|
|
5
|
+
import { reviewsIcon } from '../../assets/img/icons/reviews';
|
|
6
|
+
import { uploadIcon } from '../../assets/img/icons/upload';
|
|
7
|
+
import { viewsIcon } from '../../assets/img/icons/views';
|
|
8
|
+
|
|
9
|
+
import { formatCount } from '../../utils/format-count';
|
|
10
|
+
|
|
11
|
+
@customElement('tile-stats')
|
|
12
|
+
export class TileStats extends LitElement {
|
|
13
|
+
@property({ type: String }) mediatype?: string;
|
|
14
|
+
|
|
15
|
+
@property({ type: Number }) itemCount?: number;
|
|
16
|
+
|
|
17
|
+
@property({ type: Number }) viewCount?: number;
|
|
18
|
+
|
|
19
|
+
@property({ type: Number }) favCount?: number;
|
|
20
|
+
|
|
21
|
+
@property({ type: Number }) commentCount?: number;
|
|
22
|
+
|
|
23
|
+
render() {
|
|
24
|
+
return html`
|
|
25
|
+
<div class="stats-wrapper">
|
|
26
|
+
<div class="hr"></div>
|
|
27
|
+
|
|
28
|
+
<div id="stats-holder">
|
|
29
|
+
<div class="col">
|
|
30
|
+
<mediatype-icon
|
|
31
|
+
.mediatype=${this.mediatype}
|
|
32
|
+
style="--iconHeight:25px; --iconWidth:25px;"
|
|
33
|
+
>
|
|
34
|
+
</mediatype-icon>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="col">
|
|
37
|
+
${this.mediatype === 'account' ? uploadIcon : viewsIcon}
|
|
38
|
+
<p class="status-text">
|
|
39
|
+
${formatCount(
|
|
40
|
+
this.mediatype === 'account' ? this.itemCount : this.viewCount,
|
|
41
|
+
'short',
|
|
42
|
+
'short'
|
|
43
|
+
)}
|
|
44
|
+
</p>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="col">
|
|
47
|
+
${favoriteFilledIcon}
|
|
48
|
+
<p class="status-text">
|
|
49
|
+
${formatCount(this.favCount, 'short', 'short')}
|
|
50
|
+
</p>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="col">
|
|
53
|
+
${reviewsIcon}
|
|
54
|
+
<p class="status-text">
|
|
55
|
+
${formatCount(this.commentCount, 'short', 'short')}
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static get styles(): CSSResultGroup {
|
|
64
|
+
return css`
|
|
65
|
+
.stats-wrapper {
|
|
66
|
+
height: 35px;
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.hr {
|
|
71
|
+
display: block;
|
|
72
|
+
border-top: 1px solid #bbb;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#stats-holder {
|
|
76
|
+
align-items: center;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex: 1;
|
|
79
|
+
justify-content: space-evenly;
|
|
80
|
+
text-align: center;
|
|
81
|
+
width: 100%;
|
|
82
|
+
padding-top: 4px;
|
|
83
|
+
padding-bottom: 5px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.col {
|
|
87
|
+
width: 25%;
|
|
88
|
+
height: 25px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
svg {
|
|
92
|
+
height: 10px;
|
|
93
|
+
width: 10px;
|
|
94
|
+
display: block;
|
|
95
|
+
margin: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.status-text {
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
height: 15px;
|
|
101
|
+
color: #2c2c2c;
|
|
102
|
+
line-height: 15px;
|
|
103
|
+
margin: auto;
|
|
104
|
+
display: block;
|
|
105
|
+
text-align: center;
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -45,7 +45,6 @@ export class TileListCompact extends LitElement {
|
|
|
45
45
|
<mediatype-icon
|
|
46
46
|
.mediatype=${this.model?.mediatype}
|
|
47
47
|
.collections=${this.model?.collections}
|
|
48
|
-
style="--iconCustomFillColor: ${ifDefined(this.collectionColor)}"
|
|
49
48
|
>
|
|
50
49
|
</mediatype-icon>
|
|
51
50
|
</div>
|
|
@@ -56,14 +55,6 @@ export class TileListCompact extends LitElement {
|
|
|
56
55
|
`;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
// Only in list, not tile
|
|
60
|
-
private get collectionColor() {
|
|
61
|
-
if (this.model?.mediatype !== 'collection') {
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
return '#4666FF';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
58
|
private get imageTemplate() {
|
|
68
59
|
if (!this.model?.identifier) {
|
|
69
60
|
return nothing;
|
|
@@ -159,21 +159,12 @@ export class TileList extends LitElement {
|
|
|
159
159
|
<mediatype-icon
|
|
160
160
|
.mediatype=${this.model?.mediatype}
|
|
161
161
|
.collections=${this.model?.collections}
|
|
162
|
-
style="--iconCustomFillColor: ${ifDefined(this.collectionColor)}"
|
|
163
162
|
>
|
|
164
163
|
</mediatype-icon>
|
|
165
164
|
</div>
|
|
166
165
|
`;
|
|
167
166
|
}
|
|
168
167
|
|
|
169
|
-
// Only in list, not tile
|
|
170
|
-
private get collectionColor() {
|
|
171
|
-
if (this.model?.mediatype !== 'collection') {
|
|
172
|
-
return undefined;
|
|
173
|
-
}
|
|
174
|
-
return '#4666FF';
|
|
175
|
-
}
|
|
176
|
-
|
|
177
168
|
private get titleTemplate() {
|
|
178
169
|
if (!this.model?.title) {
|
|
179
170
|
return nothing;
|
|
@@ -50,6 +50,10 @@ export class MediatypeIcon extends LitElement {
|
|
|
50
50
|
|
|
51
51
|
static get styles(): CSSResultGroup {
|
|
52
52
|
return css`
|
|
53
|
+
#icon {
|
|
54
|
+
height: var(--iconHeight, 25px);
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
.status-text {
|
|
54
58
|
font-size: 14px;
|
|
55
59
|
color: #2c2c2c;
|
|
@@ -68,7 +72,7 @@ export class MediatypeIcon extends LitElement {
|
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
.fill-color {
|
|
71
|
-
fill: var(--
|
|
75
|
+
fill: var(--iconFillColor, '#000000');
|
|
72
76
|
}
|
|
73
77
|
`;
|
|
74
78
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const accountIcon: import("lit-html").TemplateResult<2>;
|