@canopy-iiif/app 1.6.21 → 1.7.0

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.
@@ -0,0 +1,350 @@
1
+ .canopy-gallery {
2
+ position: relative;
3
+ margin-block: clamp(1.5rem, 2vw, 3rem);
4
+ --canopy-gallery-gap: 1.5rem;
5
+ --canopy-gallery-min-column: 16rem;
6
+ --canopy-gallery-radius: 1rem;
7
+ color: var(--color-gray-900);
8
+
9
+ &__close-anchor {
10
+ position: absolute;
11
+ width: 1px;
12
+ height: 1px;
13
+ margin: -1px;
14
+ padding: 0;
15
+ overflow: hidden;
16
+ clip: rect(0 0 0 0);
17
+ border: 0;
18
+ }
19
+
20
+ &__header {
21
+ margin-bottom: clamp(1rem, 2vw, 1.5rem);
22
+ }
23
+
24
+ &__heading {
25
+ font-size: clamp(1.5rem, 2.5vw, 2rem);
26
+ line-height: 1.2;
27
+ margin: 0;
28
+ }
29
+
30
+ &__description {
31
+ margin: 0.5rem 0 0;
32
+ font-size: 1rem;
33
+ max-width: 65ch;
34
+ color: var(--color-gray-muted);
35
+ }
36
+
37
+ &__grid {
38
+ display: grid;
39
+ grid-template-columns: repeat(
40
+ auto-fit,
41
+ minmax(var(--canopy-gallery-min-column, 16rem), 1fr)
42
+ );
43
+ gap: var(--canopy-gallery-gap, 1.5rem);
44
+ }
45
+
46
+ &__item {
47
+ position: relative;
48
+ display: flex;
49
+ flex-direction: column;
50
+ height: 100%;
51
+ padding: clamp(0.75rem, 1vw, 1rem);
52
+ border: 1px solid var(--color-gray-200);
53
+ border-radius: var(--canopy-gallery-radius, 1rem);
54
+ background-color: #fff;
55
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
56
+
57
+ &:focus-within {
58
+ outline: 2px solid var(--color-accent-default, #3b82f6);
59
+ outline-offset: 3px;
60
+ }
61
+ }
62
+
63
+ &__media {
64
+ position: relative;
65
+ aspect-ratio: 4 / 3;
66
+ overflow: hidden;
67
+ border-radius: calc(var(--canopy-gallery-radius, 1rem) - 0.25rem);
68
+ background: var(--color-gray-100);
69
+
70
+ img,
71
+ picture,
72
+ video,
73
+ iframe {
74
+ width: 100%;
75
+ height: 100%;
76
+ display: block;
77
+ object-fit: cover;
78
+ }
79
+ }
80
+
81
+ &__placeholder {
82
+ width: 100%;
83
+ height: 100%;
84
+ background-image: linear-gradient(
85
+ 45deg,
86
+ rgba(255, 255, 255, 0.45) 25%,
87
+ transparent 25%,
88
+ transparent 50%,
89
+ rgba(255, 255, 255, 0.45) 50%,
90
+ rgba(255, 255, 255, 0.45) 75%,
91
+ transparent 75%,
92
+ transparent
93
+ );
94
+ background-size: 1.5rem 1.5rem;
95
+ }
96
+
97
+ &__caption {
98
+ margin: clamp(0.75rem, 1vw, 1rem) 0 0;
99
+ display: flex;
100
+ flex-direction: column;
101
+ gap: 0.35rem;
102
+ }
103
+
104
+ &__kicker {
105
+ text-transform: uppercase;
106
+ letter-spacing: 0.08em;
107
+ font-size: 0.75rem;
108
+ color: var(--color-gray-muted);
109
+ }
110
+
111
+ &__title-text {
112
+ font-weight: 600;
113
+ font-size: 1.05rem;
114
+ line-height: 1.3;
115
+ color: var(--color-gray-900);
116
+ }
117
+
118
+ &__summary {
119
+ font-size: 0.95rem;
120
+ color: var(--color-gray-muted);
121
+ }
122
+
123
+ &__meta {
124
+ margin: 0.35rem 0 0;
125
+ padding: 0;
126
+ list-style: none;
127
+ display: flex;
128
+ flex-wrap: wrap;
129
+ gap: 0.75rem;
130
+ font-size: 0.8rem;
131
+ color: var(--color-gray-muted);
132
+
133
+ &--modal {
134
+ font-size: 0.9rem;
135
+ gap: 1rem;
136
+ }
137
+ }
138
+
139
+ &__trigger {
140
+ position: absolute;
141
+ inset: 0;
142
+ border-radius: inherit;
143
+ text-decoration: none;
144
+ border: 0;
145
+ z-index: 2;
146
+ color: inherit;
147
+ background: transparent;
148
+ }
149
+
150
+ &__trigger-label {
151
+ position: absolute;
152
+ width: 1px;
153
+ height: 1px;
154
+ padding: 0;
155
+ margin: -1px;
156
+ overflow: hidden;
157
+ clip: rect(0 0 0 0);
158
+ border: 0;
159
+ }
160
+
161
+ &__modals {
162
+ position: relative;
163
+ z-index: 100;
164
+ }
165
+
166
+ &__modal {
167
+ position: fixed;
168
+ inset: 0;
169
+ opacity: 0;
170
+ pointer-events: none;
171
+ visibility: hidden;
172
+ z-index: 200;
173
+
174
+ &:target,
175
+ &[data-canopy-gallery-active="1"] {
176
+ opacity: 1;
177
+ pointer-events: auto;
178
+ visibility: visible;
179
+ }
180
+ }
181
+
182
+ &__modal-scrim {
183
+ min-height: 100vh;
184
+ display: block;
185
+ background: rgba(15, 23, 42, 1);
186
+ padding: 0;
187
+ }
188
+
189
+ &__modal-panel {
190
+ background: #fff;
191
+ color: var(--color-gray-900);
192
+ border-radius: 0;
193
+ width: 100%;
194
+ height: 100vh;
195
+ max-height: none;
196
+ overflow: auto;
197
+ display: flex;
198
+ flex-direction: column;
199
+ box-shadow: none;
200
+ }
201
+
202
+ &__modal-header {
203
+ padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 3vw, 2.5rem);
204
+ border-bottom: 1px solid rgba(15, 23, 42, 0.08);
205
+ display: flex;
206
+ gap: clamp(1rem, 2vw, 2rem);
207
+ }
208
+
209
+ &__modal-thumb {
210
+ flex: 0 0 auto;
211
+ width: clamp(5rem, 12vw, 8rem);
212
+ aspect-ratio: 4 / 3;
213
+ border-radius: 0.5rem;
214
+ overflow: hidden;
215
+ background: var(--color-gray-100);
216
+
217
+ img,
218
+ picture,
219
+ video,
220
+ iframe {
221
+ width: 100%;
222
+ height: 100%;
223
+ object-fit: cover;
224
+ display: block;
225
+ }
226
+ }
227
+
228
+ &__modal-text {
229
+ flex: 1;
230
+ min-width: 0;
231
+ }
232
+
233
+ &__modal-kicker {
234
+ text-transform: uppercase;
235
+ letter-spacing: 0.08em;
236
+ font-size: 0.8rem;
237
+ color: var(--color-gray-muted);
238
+ margin: 0 0 0.5rem;
239
+ }
240
+
241
+ &__modal-title {
242
+ margin: 0;
243
+ font-size: clamp(1.5rem, 3vw, 2rem);
244
+ line-height: 1.2;
245
+ }
246
+
247
+ &__modal-summary {
248
+ margin: 0.75rem 0 0;
249
+ font-size: 1rem;
250
+ color: var(--color-gray-muted);
251
+ }
252
+
253
+ &__modal-body {
254
+ padding: clamp(1rem, 3vw, 2.5rem);
255
+ flex: 1;
256
+ overflow: auto;
257
+ }
258
+
259
+ &__modal-footer {
260
+ padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 3vw, 2.5rem);
261
+ display: flex;
262
+ flex-wrap: wrap;
263
+ align-items: center;
264
+ gap: 1rem;
265
+ border-top: 1px solid rgba(15, 23, 42, 0.08);
266
+ }
267
+
268
+ &__modal-close {
269
+ background: var(--color-accent-100);
270
+ border-radius: 999px;
271
+ padding: 0.35rem 1.25rem;
272
+ font-weight: 600;
273
+ }
274
+
275
+ &__modal-nav {
276
+ margin-left: auto;
277
+ display: flex;
278
+ align-items: center;
279
+ gap: 1rem;
280
+ }
281
+
282
+ &__modal-nav-link {
283
+ font-weight: 600;
284
+
285
+ &--prev::before {
286
+ content: "← ";
287
+ }
288
+
289
+ &--next::after {
290
+ content: " →";
291
+ }
292
+ }
293
+
294
+ @media (max-width: 640px) {
295
+ &__grid {
296
+ grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
297
+ }
298
+
299
+ &__item {
300
+ padding: 0.75rem;
301
+ }
302
+
303
+ &__modal-panel {
304
+ max-height: 100vh;
305
+ }
306
+
307
+ &__modal-header {
308
+ flex-direction: column;
309
+ }
310
+
311
+ &__modal-thumb {
312
+ width: 100%;
313
+ }
314
+
315
+ &__modal-nav {
316
+ width: 100%;
317
+ justify-content: space-between;
318
+ margin-left: 0;
319
+ }
320
+ }
321
+ }
322
+
323
+ body[data-canopy-gallery-locked="1"] {
324
+ overflow: hidden;
325
+ }
326
+
327
+ .canopy-gallery--popup-medium {
328
+ .canopy-gallery__modal-scrim {
329
+ min-height: 100vh;
330
+ display: flex;
331
+ align-items: center;
332
+ justify-content: center;
333
+ padding: clamp(1.5rem, 3vw, 3rem);
334
+ background: rgba(15, 23, 42, 0.85);
335
+ }
336
+
337
+ .canopy-gallery__modal-panel {
338
+ width: min(960px, calc(100% - clamp(2rem, 4vw, 4rem)));
339
+ height: auto;
340
+ max-height: min(90vh, 960px);
341
+ border-radius: 0.75rem;
342
+ box-shadow: 0 25px 60px rgba(15, 23, 42, 0.45);
343
+ }
344
+ }
345
+
346
+ .canopy-gallery--popup-full {
347
+ .canopy-gallery__modal-scrim {
348
+ padding: 0;
349
+ }
350
+ }
@@ -19,3 +19,4 @@
19
19
  @use "./work";
20
20
  @use "./timeline";
21
21
  @use "./map";
22
+ @use "./gallery";
@@ -1,3 +1,4 @@
1
+ @charset "UTF-8";
1
2
  /**
2
3
  * Main stylesheet for the @canopy-iiif/app/ui package
3
4
  */
@@ -3005,6 +3006,296 @@ html.dark .clover-iiif-image-openseadragon .clover-iiif-image-openseadragon-anno
3005
3006
  box-sizing: content-box;
3006
3007
  }
3007
3008
 
3009
+ .canopy-gallery {
3010
+ position: relative;
3011
+ margin-block: clamp(1.5rem, 2vw, 3rem);
3012
+ --canopy-gallery-gap: 1.5rem;
3013
+ --canopy-gallery-min-column: 16rem;
3014
+ --canopy-gallery-radius: 1rem;
3015
+ color: var(--color-gray-900);
3016
+ }
3017
+ .canopy-gallery__close-anchor {
3018
+ position: absolute;
3019
+ width: 1px;
3020
+ height: 1px;
3021
+ margin: -1px;
3022
+ padding: 0;
3023
+ overflow: hidden;
3024
+ clip: rect(0 0 0 0);
3025
+ border: 0;
3026
+ }
3027
+ .canopy-gallery__header {
3028
+ margin-bottom: clamp(1rem, 2vw, 1.5rem);
3029
+ }
3030
+ .canopy-gallery__heading {
3031
+ font-size: clamp(1.5rem, 2.5vw, 2rem);
3032
+ line-height: 1.2;
3033
+ margin: 0;
3034
+ }
3035
+ .canopy-gallery__description {
3036
+ margin: 0.5rem 0 0;
3037
+ font-size: 1rem;
3038
+ max-width: 65ch;
3039
+ color: var(--color-gray-muted);
3040
+ }
3041
+ .canopy-gallery__grid {
3042
+ display: grid;
3043
+ grid-template-columns: repeat(auto-fit, minmax(var(--canopy-gallery-min-column, 16rem), 1fr));
3044
+ gap: var(--canopy-gallery-gap, 1.5rem);
3045
+ }
3046
+ .canopy-gallery__item {
3047
+ position: relative;
3048
+ display: flex;
3049
+ flex-direction: column;
3050
+ height: 100%;
3051
+ padding: clamp(0.75rem, 1vw, 1rem);
3052
+ border: 1px solid var(--color-gray-200);
3053
+ border-radius: var(--canopy-gallery-radius, 1rem);
3054
+ background-color: #fff;
3055
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
3056
+ }
3057
+ .canopy-gallery__item:focus-within {
3058
+ outline: 2px solid var(--color-accent-default, #3b82f6);
3059
+ outline-offset: 3px;
3060
+ }
3061
+ .canopy-gallery__media {
3062
+ position: relative;
3063
+ aspect-ratio: 4/3;
3064
+ overflow: hidden;
3065
+ border-radius: calc(var(--canopy-gallery-radius, 1rem) - 0.25rem);
3066
+ background: var(--color-gray-100);
3067
+ }
3068
+ .canopy-gallery__media img,
3069
+ .canopy-gallery__media picture,
3070
+ .canopy-gallery__media video,
3071
+ .canopy-gallery__media iframe {
3072
+ width: 100%;
3073
+ height: 100%;
3074
+ display: block;
3075
+ object-fit: cover;
3076
+ }
3077
+ .canopy-gallery__placeholder {
3078
+ width: 100%;
3079
+ height: 100%;
3080
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.45) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0.45) 75%, transparent 75%, transparent);
3081
+ background-size: 1.5rem 1.5rem;
3082
+ }
3083
+ .canopy-gallery__caption {
3084
+ margin: clamp(0.75rem, 1vw, 1rem) 0 0;
3085
+ display: flex;
3086
+ flex-direction: column;
3087
+ gap: 0.35rem;
3088
+ }
3089
+ .canopy-gallery__kicker {
3090
+ text-transform: uppercase;
3091
+ letter-spacing: 0.08em;
3092
+ font-size: 0.75rem;
3093
+ color: var(--color-gray-muted);
3094
+ }
3095
+ .canopy-gallery__title-text {
3096
+ font-weight: 600;
3097
+ font-size: 1.05rem;
3098
+ line-height: 1.3;
3099
+ color: var(--color-gray-900);
3100
+ }
3101
+ .canopy-gallery__summary {
3102
+ font-size: 0.95rem;
3103
+ color: var(--color-gray-muted);
3104
+ }
3105
+ .canopy-gallery__meta {
3106
+ margin: 0.35rem 0 0;
3107
+ padding: 0;
3108
+ list-style: none;
3109
+ display: flex;
3110
+ flex-wrap: wrap;
3111
+ gap: 0.75rem;
3112
+ font-size: 0.8rem;
3113
+ color: var(--color-gray-muted);
3114
+ }
3115
+ .canopy-gallery__meta--modal {
3116
+ font-size: 0.9rem;
3117
+ gap: 1rem;
3118
+ }
3119
+ .canopy-gallery__trigger {
3120
+ position: absolute;
3121
+ inset: 0;
3122
+ border-radius: inherit;
3123
+ text-decoration: none;
3124
+ border: 0;
3125
+ z-index: 2;
3126
+ color: inherit;
3127
+ background: transparent;
3128
+ }
3129
+ .canopy-gallery__trigger-label {
3130
+ position: absolute;
3131
+ width: 1px;
3132
+ height: 1px;
3133
+ padding: 0;
3134
+ margin: -1px;
3135
+ overflow: hidden;
3136
+ clip: rect(0 0 0 0);
3137
+ border: 0;
3138
+ }
3139
+ .canopy-gallery__modals {
3140
+ position: relative;
3141
+ z-index: 100;
3142
+ }
3143
+ .canopy-gallery__modal {
3144
+ position: fixed;
3145
+ inset: 0;
3146
+ opacity: 0;
3147
+ pointer-events: none;
3148
+ visibility: hidden;
3149
+ z-index: 200;
3150
+ }
3151
+ .canopy-gallery__modal:target, .canopy-gallery__modal[data-canopy-gallery-active="1"] {
3152
+ opacity: 1;
3153
+ pointer-events: auto;
3154
+ visibility: visible;
3155
+ }
3156
+ .canopy-gallery__modal-scrim {
3157
+ min-height: 100vh;
3158
+ display: block;
3159
+ background: rgb(15, 23, 42);
3160
+ padding: 0;
3161
+ }
3162
+ .canopy-gallery__modal-panel {
3163
+ background: #fff;
3164
+ color: var(--color-gray-900);
3165
+ border-radius: 0;
3166
+ width: 100%;
3167
+ height: 100vh;
3168
+ max-height: none;
3169
+ overflow: auto;
3170
+ display: flex;
3171
+ flex-direction: column;
3172
+ box-shadow: none;
3173
+ }
3174
+ .canopy-gallery__modal-header {
3175
+ padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 3vw, 2.5rem);
3176
+ border-bottom: 1px solid rgba(15, 23, 42, 0.08);
3177
+ display: flex;
3178
+ gap: clamp(1rem, 2vw, 2rem);
3179
+ }
3180
+ .canopy-gallery__modal-thumb {
3181
+ flex: 0 0 auto;
3182
+ width: clamp(5rem, 12vw, 8rem);
3183
+ aspect-ratio: 4/3;
3184
+ border-radius: 0.5rem;
3185
+ overflow: hidden;
3186
+ background: var(--color-gray-100);
3187
+ }
3188
+ .canopy-gallery__modal-thumb img,
3189
+ .canopy-gallery__modal-thumb picture,
3190
+ .canopy-gallery__modal-thumb video,
3191
+ .canopy-gallery__modal-thumb iframe {
3192
+ width: 100%;
3193
+ height: 100%;
3194
+ object-fit: cover;
3195
+ display: block;
3196
+ }
3197
+ .canopy-gallery__modal-text {
3198
+ flex: 1;
3199
+ min-width: 0;
3200
+ }
3201
+ .canopy-gallery__modal-kicker {
3202
+ text-transform: uppercase;
3203
+ letter-spacing: 0.08em;
3204
+ font-size: 0.8rem;
3205
+ color: var(--color-gray-muted);
3206
+ margin: 0 0 0.5rem;
3207
+ }
3208
+ .canopy-gallery__modal-title {
3209
+ margin: 0;
3210
+ font-size: clamp(1.5rem, 3vw, 2rem);
3211
+ line-height: 1.2;
3212
+ }
3213
+ .canopy-gallery__modal-summary {
3214
+ margin: 0.75rem 0 0;
3215
+ font-size: 1rem;
3216
+ color: var(--color-gray-muted);
3217
+ }
3218
+ .canopy-gallery__modal-body {
3219
+ padding: clamp(1rem, 3vw, 2.5rem);
3220
+ flex: 1;
3221
+ overflow: auto;
3222
+ }
3223
+ .canopy-gallery__modal-footer {
3224
+ padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 3vw, 2.5rem);
3225
+ display: flex;
3226
+ flex-wrap: wrap;
3227
+ align-items: center;
3228
+ gap: 1rem;
3229
+ border-top: 1px solid rgba(15, 23, 42, 0.08);
3230
+ }
3231
+ .canopy-gallery__modal-close {
3232
+ background: var(--color-accent-100);
3233
+ border-radius: 999px;
3234
+ padding: 0.35rem 1.25rem;
3235
+ font-weight: 600;
3236
+ }
3237
+ .canopy-gallery__modal-nav {
3238
+ margin-left: auto;
3239
+ display: flex;
3240
+ align-items: center;
3241
+ gap: 1rem;
3242
+ }
3243
+ .canopy-gallery__modal-nav-link {
3244
+ font-weight: 600;
3245
+ }
3246
+ .canopy-gallery__modal-nav-link--prev::before {
3247
+ content: "← ";
3248
+ }
3249
+ .canopy-gallery__modal-nav-link--next::after {
3250
+ content: " →";
3251
+ }
3252
+ @media (max-width: 640px) {
3253
+ .canopy-gallery__grid {
3254
+ grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
3255
+ }
3256
+ .canopy-gallery__item {
3257
+ padding: 0.75rem;
3258
+ }
3259
+ .canopy-gallery__modal-panel {
3260
+ max-height: 100vh;
3261
+ }
3262
+ .canopy-gallery__modal-header {
3263
+ flex-direction: column;
3264
+ }
3265
+ .canopy-gallery__modal-thumb {
3266
+ width: 100%;
3267
+ }
3268
+ .canopy-gallery__modal-nav {
3269
+ width: 100%;
3270
+ justify-content: space-between;
3271
+ margin-left: 0;
3272
+ }
3273
+ }
3274
+
3275
+ body[data-canopy-gallery-locked="1"] {
3276
+ overflow: hidden;
3277
+ }
3278
+
3279
+ .canopy-gallery--popup-medium .canopy-gallery__modal-scrim {
3280
+ min-height: 100vh;
3281
+ display: flex;
3282
+ align-items: center;
3283
+ justify-content: center;
3284
+ padding: clamp(1.5rem, 3vw, 3rem);
3285
+ background: rgba(15, 23, 42, 0.85);
3286
+ }
3287
+ .canopy-gallery--popup-medium .canopy-gallery__modal-panel {
3288
+ width: min(960px, 100% - clamp(2rem, 4vw, 4rem));
3289
+ height: auto;
3290
+ max-height: min(90vh, 960px);
3291
+ border-radius: 0.75rem;
3292
+ box-shadow: 0 25px 60px rgba(15, 23, 42, 0.45);
3293
+ }
3294
+
3295
+ .canopy-gallery--popup-full .canopy-gallery__modal-scrim {
3296
+ padding: 0;
3297
+ }
3298
+
3008
3299
  /**
3009
3300
  * Define source files for utility classes
3010
3301
  */