Skip to content

Commit 1747768

Browse files
committed
Theming and cleanup
1 parent 1a11b51 commit 1747768

File tree

2 files changed

+85
-17
lines changed

2 files changed

+85
-17
lines changed

src/css/tailwind.css

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,29 @@ footer p a:focus {
152152
}
153153

154154
@supports (outline: none) {
155+
.group:hover .group-hover\:card-shadow-blue-seafoam,
156+
.group:focus .group-hover\:card-shadow-blue-seafoam,
155157
.hover\:card-shadow-blue-seafoam:hover,
156158
.hover\:card-shadow-blue-seafoam:focus {
157159
outline: none;
158160
box-shadow: 0px 3px 20px rgba(1, 159, 220, 0.6);
159161
}
162+
.group:hover .group-hover\:card-shadow-seafoam,
163+
.group:focus .group-hover\:card-shadow-seafoam,
160164
.hover\:card-shadow-seafoam:hover,
161165
.hover\:card-shadow-seafoam:focus {
162166
outline: none;
163167
box-shadow: 0px 3px 20px rgba(135, 249, 237, 0.7);
164168
}
169+
.group:hover .group-hover\:card-shadow-sunrise,
170+
.group:focus .group-hover\:card-shadow-sunrise,
165171
.hover\:card-shadow-sunrise:hover,
166172
.hover\:card-shadow-sunrise:focus {
167173
outline: none;
168174
box-shadow: 0px 3px 20px rgba(246, 62, 103, 0.6);
169175
}
176+
.group:hover .group-hover\:card-shadow-gold,
177+
.group:focus .group-hover\:card-shadow-gold,
170178
.hover\:card-shadow-gold:hover,
171179
.hover\:card-shadow-gold:focus {
172180
outline: none;
@@ -335,6 +343,7 @@ details[open] .summary-swap-open {
335343
.ais-SearchBox-input {
336344
@apply bg-blue-900;
337345
@apply text-white;
346+
@apply font-bold;
338347
@apply p-4;
339348
@apply my-8;
340349
@apply mx-auto;
@@ -347,15 +356,68 @@ details[open] .summary-swap-open {
347356
.aspect-ratio-youtube {
348357
padding-top: 74.9295775%;
349358
}
359+
.jamstacktv-card,
360+
.jamstacktv-img {
361+
border-radius: 1em 0 1em 1em;
362+
}
350363
.jamstacktv-time {
351364
display: inline-block;
352-
font-size: .75em;
353-
border: 1px solid #eee;
354-
padding: 0 .5em;
355-
margin-right: .5em;
356-
border-radius: .25em;
357-
word-spacing: 0.25em; /* 4px /16 */
358-
font-weight: 700;
365+
font-size: 0.6666666666667em; /* 16px /24 */
366+
border-right: 1px solid;
367+
padding: 0 .75em 0 0;
368+
margin-right: .75em;
369+
font-weight: 500;
370+
@apply border-gray-400;
371+
}
372+
.jamstacktv-time > b {
373+
display: inline-block;
374+
width: 0;
375+
height: 0;
376+
border-top: .4em solid transparent;
377+
border-bottom: .4em solid transparent;
378+
border-left: .4em solid currentColor;
379+
margin: 0 2px 0 0;
380+
}
381+
.jamstacktv-time > b + b {
382+
margin-left: 0;
383+
margin-right: .25em;
384+
}
385+
.jamstacktv-item {
386+
display: flex;
387+
flex-direction: column;
388+
justify-content: center;
389+
}
390+
.jamstacktv-meta {
391+
@apply leading-normal;
392+
}
393+
.jamstacktv-category:after {
394+
content: ": ";
395+
}
396+
.jamstacktv-no-skip .jamstacktv-category:after {
397+
content: "";
398+
}
399+
.jamstacktv-no-skip .jamstacktv-category {
400+
display: block;
401+
}
402+
.jamstacktv-caption {
403+
@apply text-xl;
404+
@apply font-normal;
405+
}
406+
.jamstacktv-caption-quote {
407+
@apply italic;
408+
}
409+
.jamstacktv-caption-quote:before {
410+
content: "“"
411+
}
412+
.jamstacktv-caption-quote:after {
413+
content: "”"
414+
}
415+
.jamstacktv-no-skip .jamstacktv-title {
416+
@apply text-2xl;
417+
@apply font-bold;
418+
}
419+
.jamstacktv-no-skip .jamstacktv-caption {
420+
display: none;
359421
}
360422
/* purgecss end ignore */
361423

src/site/tv.njk

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,38 @@ search.addWidgets([
4444
...item,
4545
url: `https://www.youtube.com/watch?v=${item.video.id}}&t=${start}s`,
4646
};
47-
if(start > 0) {
47+
48+
if(start > 10) { // only show for deep links > 10 seconds
4849
let secondsInOne = {
4950
hour: 60*60,
5051
minute: 60
5152
}
53+
5254
function pad(num) { return num < 10 ? `0${num}` : num; }
5355
let hours = Math.floor(start / secondsInOne.hour);
5456
let minutes = Math.floor((start % secondsInOne.hour) / secondsInOne.minute);
5557
let seconds = Math.floor(start % secondsInOne.minute);
56-
obj.displayStart = `<span class="jamstacktv-time">⏱ ${hours ? `${pad(hours)}:`: ""}${pad(minutes)}:${pad(seconds)}</span>`;
58+
59+
obj.displayStart = `<span class="jamstacktv-time"><b></b><b></b>${hours ? `${pad(hours)}:`: ""}${hours ? pad(minutes) : minutes}:${pad(seconds)}</span>`;
5760
//obj._highlightResult.caption.content = `…${obj._highlightResult.caption.content}`;
61+
} else {
62+
obj.wrapperClass = "jamstacktv-no-skip";
5863
}
5964
return obj;
6065
});
6166
},
6267
templates: {
6368
item: `
64-
<a href="{{ url }}" class="grid grid-cols-4 gap-4 mb-4">
65-
<div class="aspect-ratio-youtube relative">
66-
<img src="{{ video.thumbnails.medium }}" alt="{{ video.title }}" class="absolute top-0">
69+
<a href="{{ url }}" class="grid grid-cols-4 gap-4 mb-4 group">
70+
<div class="aspect-ratio-youtube relative bg-gradient-card-sunrise card-shadow group-hover:card-shadow-sunrise jamstacktv-card">
71+
<img src="{{ video.thumbnails.medium }}" alt="{{ video.title }}" class="absolute top-0 jamstacktv-img">
6772
</div>
68-
<div class="col-span-3">
69-
<div>{{#helpers.highlight}}{ "attribute": "playlist.title" }{{/helpers.highlight}}: {{#helpers.highlight}}{ "attribute": "video.title" }{{/helpers.highlight}}</div>
70-
<span class="text-2xl">{{{ displayStart }}}</span>
71-
<strong class="text-2xl">{{#helpers.highlight}}{ "attribute": "caption.content" }{{/helpers.highlight}}</strong>
72-
<div></div>
73+
<div class="col-span-3 jamstacktv-item {{ wrapperClass }}">
74+
<div class="jamstacktv-meta mb-1">
75+
<span class="jamstacktv-category">{{#helpers.highlight}}{ "attribute": "playlist.title" }{{/helpers.highlight}}</span>
76+
<span class="jamstacktv-title">{{#helpers.highlight}}{ "attribute": "video.title" }{{/helpers.highlight}}</span>
77+
</div>
78+
<strong class="jamstacktv-caption">{{{ displayStart }}}<span class="jamstacktv-caption-quote">{{#helpers.highlight}}{ "attribute": "caption.content" }{{/helpers.highlight}}</span></strong>
7379
</div>
7480
</div>
7581
`,

0 commit comments

Comments
 (0)