blob: bcbeb6c092da6b293ec25fd52747907686ae35f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
<script lang="ts">
import type { AccessibilityFeatures } from '@jet-app/app-store/api/models';
import SystemImage, {
isSystemImageArtwork,
} from '~/components/SystemImage.svelte';
export let item: AccessibilityFeatures;
export let isDetailView: boolean = false;
</script>
<article
class:is-detail-view={isDetailView}
role={isDetailView ? 'presentation' : 'article'}
>
{#if !isDetailView}
{#if item.artwork && isSystemImageArtwork(item.artwork)}
<span class="icon-container" aria-hidden="true">
<SystemImage artwork={item.artwork} />
</span>
{/if}
<h2>{item.title}</h2>
{/if}
<ul class:grid={item.features.length > 1 && !isDetailView}>
{#each item.features as feature}
<li>
{#if isSystemImageArtwork(feature.artwork)}
<span class="feature-icon-container" aria-hidden="true">
<SystemImage artwork={feature.artwork} />
</span>
{/if}
<div class="feature-content">
<h3 class="feature-title">{feature.title}</h3>
{#if feature.description}
<span class="feature-description">
{feature.description}
</span>
{/if}
</div>
</li>
{/each}
</ul>
</article>
<style lang="scss">
@use 'amp/stylekit/core/border-radiuses' as *;
@use '@amp/web-shared-styles/app/core/globalvars' as *;
article {
display: flex;
flex-direction: column;
height: 100%;
padding: 30px;
gap: 8px;
text-align: center;
font: var(--body-tall);
border-radius: $global-border-radius-rounded-large;
background-color: var(--systemQuinary);
&.is-detail-view {
padding: 0;
text-align: start;
background-color: transparent;
}
}
.icon-container {
width: 30px;
margin: 0 auto;
}
.icon-container :global(svg) {
width: 100%;
fill: var(--keyColor);
}
h2 {
font: var(--title-3-emphasized);
margin-bottom: 8px;
}
ul {
display: flex;
flex-direction: column;
gap: 25px;
}
ul.grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
li {
display: flex;
align-items: center;
justify-content: center;
text-align: start;
padding: 4px 0;
gap: 8px;
.is-detail-view & {
gap: 10px;
justify-content: start;
align-items: flex-start;
}
}
.grid li {
justify-content: start;
}
.feature-icon-container {
display: inline-flex;
@media (prefers-color-scheme: dark) {
filter: invert(1);
}
.is-detail-view & {
display: flex;
align-items: center;
@media (prefers-color-scheme: dark) {
filter: none;
}
}
}
.feature-icon-container :global(svg) {
width: 20px;
.is-detail-view & {
width: 30px;
fill: var(--keyColor);
}
}
.feature-content {
display: flex;
flex-direction: column;
gap: 6px;
}
.feature-title {
font: var(--body-tall);
.is-detail-view & {
color: var(--systemPrimary);
font: var(--title-2-emphasized);
}
}
.feature-description {
color: var(--systemSecondary);
font: var(--body);
}
</style>
|