aboutsummaryrefslogtreecommitdiffstats
path: root/src/less/components/controls.less
blob: fb66e869626913ba99f0a3c691a0c19878b7d211 (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
// --------------------------------------------------------------
// Controls
// --------------------------------------------------------------

// Hide native controls
.plyr ::-webkit-media-controls {
    display: none;
}

// Playback controls
.plyr__controls {
    display: flex;
    align-items: center;
    text-align: center;

    // Spacing
    > .plyr__control,
    .plyr__progress,
    .plyr__time,
    .plyr__menu {
        margin-left: (@plyr-control-spacing / 2);

        &:first-child,
        &:first-child + [data-plyr='pause'] {
            margin-left: 0;
        }
    }

    .plyr__volume {
        margin-left: (@plyr-control-spacing / 2);
    }

    @media @plyr-mq-sm {
        > .plyr__control,
        .plyr__progress,
        .plyr__time,
        .plyr__menu {
            margin-left: @plyr-control-spacing;
        }

        > .plyr__control + .plyr__control,
        .plyr__menu + .plyr__control,
        > .plyr__control + .plyr__menu {
            margin-left: (@plyr-control-spacing / 2);
        }
    }
}

// Video controls
.plyr--video .plyr__controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: (@plyr-control-spacing * 3.5) @plyr-control-spacing @plyr-control-spacing;
    background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 70%));
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    color: @plyr-video-control-color;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;

    .plyr__control {
        svg {
            filter: drop-shadow(0 1px 1px fade(#000, 15%));
        }

        // Hover and tab focus
        &.plyr__tab-focus,
        &:hover,
        &[aria-expanded='true'] {
            background: @plyr-video-control-bg-hover;
            color: @plyr-video-control-color-hover;
        }
    }
}

// Hide controls
.plyr--video.plyr--hide-controls .plyr__controls {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

// Audio controls
.plyr--audio .plyr__controls {
    padding: @plyr-control-spacing;
    border-radius: inherit;
    background: @plyr-audio-controls-bg;
    color: @plyr-audio-control-color;
}

// Some options are hidden by default
.plyr [data-plyr='captions'],
.plyr [data-plyr='pip'],
.plyr [data-plyr='airplay'],
.plyr [data-plyr='fullscreen'] {
    display: none;
}
.plyr--captions-enabled [data-plyr='captions'],
.plyr--pip-supported [data-plyr='pip'],
.plyr--airplay-supported [data-plyr='airplay'],
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
    display: inline-block;
}