Skip to content

Commit ae59c11

Browse files
committed
feat: demo style tweaks
1 parent 8da1a78 commit ae59c11

File tree

10 files changed

+66
-70
lines changed

10 files changed

+66
-70
lines changed

demo/index.html

+23-16
Original file line numberDiff line numberDiff line change
@@ -66,42 +66,46 @@
6666
<h1>Pl<span>a</span>y<span>e</span>r</h1>
6767
<p>
6868
A simple, accessible and customisable media player for
69-
<button type="button" class="faux-link" data-source="video">
69+
<button type="button" class="link" data-source="video">
7070
<svg class="icon">
7171
<title>HTML5</title>
7272
<path
7373
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
74-
></path></svg
75-
>Video</button
74+
></path>
75+
</svg>
76+
Video</button
7677
>,
77-
<button type="button" class="faux-link" data-source="audio">
78+
<button type="button" class="link" data-source="audio">
7879
<svg class="icon">
7980
<title>HTML5</title>
8081
<path
8182
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
82-
></path></svg
83-
>Audio</button
83+
></path>
84+
</svg>
85+
Audio</button
8486
>,
85-
<button type="button" class="faux-link" data-source="youtube">
87+
<button type="button" class="link" data-source="youtube">
8688
<svg class="icon" role="presentation">
8789
<title>YouTube</title>
8890
<path
8991
d="M15.8,4.8c-0.2-1.3-0.8-2.2-2.2-2.4C11.4,2,8,2,8,2S4.6,2,2.4,2.4C1,2.6,0.3,3.5,0.2,4.8C0,6.1,0,8,0,8
9092
s0,1.9,0.2,3.2c0.2,1.3,0.8,2.2,2.2,2.4C4.6,14,8,14,8,14s3.4,0,5.6-0.4c1.4-0.3,2-1.1,2.2-2.4C16,9.9,16,8,16,8S16,6.1,15.8,4.8z
9193
M6,11V5l5,3L6,11z"
92-
></path></svg
93-
>YouTube
94+
></path>
95+
</svg>
96+
YouTube
9497
</button>
9598
and
96-
<button type="button" class="faux-link" data-source="vimeo">
99+
<button type="button" class="link" data-source="vimeo">
97100
<svg class="icon" role="presentation">
98101
<title>Vimeo</title>
99102
<path
100103
d="M16,4.3c-0.1,1.6-1.2,3.7-3.3,6.4c-2.2,2.8-4,4.2-5.5,4.2c-0.9,0-1.7-0.9-2.4-2.6C4,9.9,3.4,5,2,5
101104
C1.9,5,1.5,5.3,0.8,5.8L0,4.8c0.8-0.7,3.5-3.4,4.7-3.5C5.9,1.2,6.7,2,7,3.8c0.3,2,0.8,6.1,1.8,6.1c0.9,0,2.5-3.4,2.6-4
102105
c0.1-0.9-0.3-1.9-2.3-1.1c0.8-2.6,2.3-3.8,4.5-3.8C15.3,1.1,16.1,2.2,16,4.3z"
103-
></path></svg
104-
>Vimeo
106+
></path>
107+
</svg>
108+
Vimeo
105109
</button>
106110
</p>
107111

@@ -177,7 +181,10 @@ <h1>Pl<span>a</span>y<span>e</span>r</h1>
177181
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
178182
></path>
179183
</svg>
180-
<a href="https://itunes.apple.com/au/movie/view-from-a-blue-moon/id1041586323" target="_blank"
184+
<a
185+
href="https://itunes.apple.com/au/movie/view-from-a-blue-moon/id1041586323"
186+
target="_blank"
187+
class="link"
181188
>View From A Blue Moon</a
182189
>
183190
&copy; Brainfarm
@@ -191,7 +198,7 @@ <h1>Pl<span>a</span>y<span>e</span>r</h1>
191198
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
192199
></path>
193200
</svg>
194-
<a href="http://www.kishibashi.com/" target="_blank"
201+
<a href="http://www.kishibashi.com/" target="_blank" class="link"
195202
>Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;</a
196203
>
197204
&copy; Kishi Bashi
@@ -215,7 +222,7 @@ <h1>Pl<span>a</span>y<span>e</span>r</h1>
215222
</li>
216223
<li class="plyr__cite plyr__cite--vimeo" hidden>
217224
<small>
218-
<a href="https://vimeo.com/40648169" target="_blank">Toob “Wavaphon” Music Video</a>
225+
<a href="https://vimeo.com/40648169" target="_blank" class="link">Toob “Wavaphon” Music Video</a>
219226
on&nbsp;
220227
<span class="color--vimeo">
221228
<svg class="icon" role="presentation">
@@ -248,7 +255,7 @@ <h1>Pl<span>a</span>y<span>e</span>r</h1>
248255
<a
249256
href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&amp;url=http%3A%2F%2Fplyr.io&amp;via=Sam_Potts"
250257
target="_blank"
251-
class="js-shr"
258+
class="link js-shr"
252259
>tweet it</a
253260
>
254261
👍

demo/src/sass/components/buttons.scss

+25-20
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
.button__count {
88
align-items: center;
99
border: 0;
10-
border-radius: $border-radius-base;
11-
box-shadow: 0 1px 1px rgba(#000, 0.1);
10+
border-radius: $border-radius-medium;
1211
display: inline-flex;
1312
padding: ($spacing-base * 0.75);
1413
position: relative;
@@ -19,27 +18,34 @@
1918

2019
// Buttons
2120
.button {
22-
background: $color-button-background;
21+
--shadow-color: 0deg 0% 20%;
22+
align-items: center;
23+
background-color: $color-button-background;
24+
background-image: linear-gradient(0deg, transparent, rgba(255, 255, 255, 0.05));
25+
border: 1px solid darken($color-button-background, 5);
26+
box-shadow: 0 0.8px 1px hsl(var(--shadow-color) / 0.05), 0 1.3px 1.6px -1px hsl(var(--shadow-color) / 0.06),
27+
0 2.8px 3.4px -2px hsl(var(--shadow-color) / 0.07);
2328
color: $color-button-text;
29+
display: inline-flex;
2430
font-weight: $font-weight-bold;
31+
gap: 0.25rem;
2532
padding-left: ($spacing-base * 1.25);
2633
padding-right: ($spacing-base * 1.25);
34+
text-decoration: none;
35+
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
2736
transition: all 0.2s ease;
2837

2938
&:hover,
3039
&:focus {
3140
background: $color-button-background-hover;
41+
border-color: darken($color-button-background, 7);
3242

3343
// Remove the underline/border
3444
&::after {
35-
display: none;
45+
display: none !important;
3646
}
3747
}
3848

39-
&:hover {
40-
box-shadow: 0 2px 2px rgba(#000, 0.1);
41-
}
42-
4349
&:focus {
4450
outline: 0;
4551
}
@@ -49,15 +55,12 @@
4955
}
5056

5157
&:active {
58+
box-shadow: none;
5259
top: 1px;
5360
}
54-
}
55-
56-
// Button group
57-
.button--with-count {
58-
display: inline-flex;
5961

60-
.button .icon {
62+
.icon {
63+
filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
6164
flex-shrink: 0;
6265
}
6366
}
@@ -66,19 +69,21 @@
6669
.button__count {
6770
animation: fade-in 0.2s ease;
6871
background: $color-button-count-background;
72+
border: 1px solid $color-gray-100;
6973
color: $color-button-count-text;
7074
margin-left: ($spacing-base * 0.75);
7175

7276
&::before {
73-
border: $arrow-size solid transparent;
74-
border-left-width: 0;
75-
border-right-color: $color-button-count-background;
77+
background-color: $color-button-count-background;
78+
border: inherit;
79+
border-width: 0 0 1px 1px;
7680
content: '';
77-
height: 0;
81+
display: block;
82+
height: 8px;
7883
position: absolute;
7984
right: 100%;
8085
top: 50%;
81-
transform: translateY(-50%);
82-
width: 0;
86+
transform: translateY(-50%) translateX(50%) translateX(-1px) rotate(45deg);
87+
width: 8px;
8388
}
8489
}

demo/src/sass/components/links.scss

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22
// Links
33
// ==========================================================================
44

5-
// Make a <button> look like an <a>
6-
button.faux-link {
7-
@extend a; // stylelint-disable-line
8-
@include cancel-button-styles;
9-
}
10-
11-
// Links
12-
a {
13-
border-bottom: 1px dotted currentColor;
5+
.link {
6+
align-items: center;
7+
border-bottom: 1px dashed currentColor;
148
color: $color-link;
159
position: relative;
1610
text-decoration: none;

demo/src/sass/components/players.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66

77
// Example players
88
.plyr {
9-
border-radius: $border-radius-large;
10-
box-shadow: 0 2px 15px rgba(#000, 0.1);
9+
--shadow-color: 197deg 32% 65%;
10+
border-radius: $border-radius-2x-large;
11+
box-shadow: 0 0.5px 0.6px hsl(var(--shadow-color) / 0.36), 0 1.7px 1.9px -0.8px hsl(var(--shadow-color) / 0.36),
12+
0 4.3px 4.8px -1.7px hsl(var(--shadow-color) / 0.36), -0.1px 10.6px 11.9px -2.5px hsl(var(--shadow-color) / 0.36);
1113
margin: $spacing-base auto;
1214

1315
&.plyr--audio {
@@ -17,6 +19,7 @@
1719

1820
.plyr__video-wrapper::after {
1921
border: 1px solid rgba(#000, 0.15);
22+
border-bottom-color: rgba(#000, 0.25);
2023
border-radius: inherit;
2124
bottom: 0;
2225
content: '';

demo/src/sass/layout/core.scss

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ main {
3737
aside {
3838
align-items: center;
3939
background: #fff;
40+
box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
4041
display: flex;
4142
flex-shrink: 0;
4243
justify-content: center;

demo/src/sass/lib/mixins.scss

-19
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,6 @@
44

55
@use 'sass:math';
66

7-
// Convert a <button> into an <a>
8-
// ---------------------------------------
9-
@mixin cancel-button-styles() {
10-
background: transparent;
11-
border: 0;
12-
border-radius: 0;
13-
cursor: pointer;
14-
font: inherit;
15-
line-height: $line-height-base;
16-
margin: 0;
17-
padding: 0;
18-
position: relative;
19-
text-align: inherit;
20-
text-shadow: inherit;
21-
user-select: text;
22-
vertical-align: baseline;
23-
width: auto;
24-
}
25-
267
// Nicer focus styles
278
// ---------------------------------------
289
@mixin focus-visible($color: $focus-default-color) {

demo/src/sass/lib/reset.scss

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
*::before {
1010
box-sizing: border-box;
1111
}
12+
13+
button {
14+
all: unset;
15+
}

demo/src/sass/settings/cosmetic.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
$arrow-size: 5px;
77

88
// Radii
9-
$border-radius-base: 4px;
10-
$border-radius-large: 8px;
9+
$border-radius-small: 4px;
10+
$border-radius-medium: 6px;
11+
$border-radius-2x-large: 12px;
1112

1213
// Background
1314
$page-background: linear-gradient(to left top, $color-background-from, $color-background-to);

src/sass/plugins/preview-thumbnails/settings.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
$plyr-preview-padding: $plyr-tooltip-padding !default;
66
$plyr-preview-background: $plyr-tooltip-background !default;
7-
$plyr-preview-radius: $plyr-tooltip-radius !default;
7+
$plyr-preview-radius: $plyr-menu-radius !default;
88
$plyr-preview-shadow: $plyr-tooltip-shadow !default;
99
$plyr-preview-arrow-size: $plyr-tooltip-arrow-size !default;
1010
$plyr-preview-image-background: $plyr-color-gray-200 !default;

src/sass/settings/menus.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// ==========================================================================
44

55
$plyr-menu-background: var(--plyr-menu-background, rgba(#fff, 0.9)) !default;
6-
$plyr-menu-radius: var(--plyr-menu-radius, 4px) !default;
6+
$plyr-menu-radius: var(--plyr-menu-radius, 8px) !default;
77
$plyr-menu-color: var(--plyr-menu-color, $plyr-color-gray-700) !default;
88
$plyr-menu-shadow: var(--plyr-menu-shadow, 0 1px 2px rgba(#000, 0.15)) !default;
99
$plyr-menu-arrow-size: var(--plyr-menu-arrow-size, 4px) !default;

0 commit comments

Comments
 (0)