Skip to content

Truly independent web browser

7.3 KB
Raw Blame
.container {
    --accent-color: #9d7cf2;
    --dark-accent-color: #8a64e5;
    --light-accent-color: #e0d4ff;
    --foreground-color: white;
    --track-color: rgb(20, 20, 20);
    --panel-color: rgb(38, 38, 38);

    overflow: hidden;
    text-align: left;
}

.container.video {
    position: relative;
    width: 100%;
    height: 100%;
}

.controls {
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
    font-size: 12px;
    color: var(--foreground-color);
    user-select: none;
}

.container.video > .controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: color-mix(in srgb, var(--panel-color) 82%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease-in-out;
}

.container.video > .controls.visible {
    opacity: 1;
    pointer-events: auto;
}

.container.audio > .controls {
    inset: 0;
    background: var(--panel-color);
    justify-content: center;
}

.timeline {
    z-index: 1;
    padding: 5px 0;
    margin: -5px 0;
    cursor: pointer;
    flex-shrink: 0;
}

.timeline-track {
    position: relative;
    height: 5px;
    background: var(--track-color);
}

.timeline-buffered {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    mix-blend-mode: hard-light;
    pointer-events: none;
}

.timeline-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    pointer-events: none;
}

.button-bar {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    gap: 8px;
    min-height: 30px;
}

.control-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.icon {
    width: 24px;
    height: 24px;
}

.control-button .icon path {
    fill: var(--foreground-color);
}

.control-button:hover .icon path {
    fill: var(--light-accent-color);
}

.play-pause-icon path {
    display: none;
}
.play-pause-icon:not(.playing) .play-path {
    display: inline;
}
.play-pause-icon.playing .pause-path {
    display: inline;
}

.mute-button {
    margin-left: auto;
}

.mute-button:not(.low, .high) > .icon > .volume-low {
    display: none;
}
.mute-button:not(.high) > .icon > .volume-high {
    display: none;
}

.mute-button.muted > .icon > .volume-low,
.mute-button.muted > .icon > .volume-high,
.mute-button.muted > .icon > .speaker {
    clip-path: url(#muted-clip);
}
.mute-button:not(.muted) > .icon > .muted-line {
    display: none;
}

.timestamp {
    min-width: 0;
    overflow: clip;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.duration {
    display: none;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.volume-area {
    max-width: 60px;
    flex-grow: 1;
    padding: 5px;
    margin: -5px;
    cursor: pointer;
}

.volume-area.hidden {
    display: none;
}

.volume {
    height: 6px;
    background: var(--track-color);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.volume-fill {
    height: 100%;
    width: 100%;
    background: var(--accent-color);
    pointer-events: none;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container.controls-hidden > .video-overlay,
.container.controls-hidden > .controls {
    display: none;
}

/* NB: The overlay would cover the placeholder's button, and the video it plays or pauses is in its own window. */
.container.picture-in-picture > .video-overlay {
    display: none;
}

.picture-in-picture-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    height: 100%;
    background-color: rgb(17, 17, 20);
    color: rgb(220, 220, 225);
    font-family: system-ui, sans-serif;
    font-size: 15px;
    text-align: center;
}

.container.picture-in-picture > .picture-in-picture-placeholder {
    display: flex;
}

.picture-in-picture-placeholder-icon {
    width: 40px;
    height: 30px;
}

.picture-in-picture-placeholder-frame {
    fill: none;
    stroke: rgb(172, 172, 180);
    stroke-width: 2px;
}

.picture-in-picture-placeholder-window {
    fill: rgb(172, 172, 180);
}

.exit-picture-in-picture-button {
    height: 32px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: rgb(242, 242, 245);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.exit-picture-in-picture-button:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* The player in a Picture-in-Picture window has its play button in the middle, and a row of the time, the timeline,
   the duration and the mute button along its bottom, over a shade at its top and bottom. Only the controls take the
   pointer, so that the shade between them leaves the controls to fade. */
.container.picture-in-picture-player > .controls {
    top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0) 60%,
        rgba(0, 0, 0, 0.55) 100%
    );
}

.container.picture-in-picture-player > .controls,
.container.picture-in-picture-player > .controls.visible {
    pointer-events: none;
}

.container.picture-in-picture-player > .controls.visible > * {
    pointer-events: auto;
}

.container.picture-in-picture-player .button-bar {
    display: contents;
}

.container.picture-in-picture-player .timestamp {
    order: 1;
}

.container.picture-in-picture-player > .controls > .timeline {
    order: 2;
    flex: 1;
    margin: -5px 0;
}

.container.picture-in-picture-player .timeline-track {
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.3);
}

.container.picture-in-picture-player .timeline-fill {
    background: var(--foreground-color);
}

.container.picture-in-picture-player .duration {
    display: inline;
    order: 3;
}

.container.picture-in-picture-player .mute-button {
    order: 4;
    margin-left: 0;
    width: 22px;
    height: 22px;
}

.container.picture-in-picture-player .mute-button .icon {
    width: 18px;
    height: 18px;
}

.container.picture-in-picture-player .volume-area {
    display: none;
}

.container.picture-in-picture-player .play-pause-button {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
}

.container.picture-in-picture-player .play-pause-button .icon {
    width: 22px;
    height: 22px;
}

.fullscreen-icon path {
    display: none;
}
.fullscreen-icon:not(.fullscreen) .fullscreen-maximize-path {
    display: inline;
}
.fullscreen-icon.fullscreen .fullscreen-minimize-path {
    display: inline;
}

.placeholder-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--panel-color);
    opacity: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.placeholder-circle:hover {
    background: var(--panel-color);
    opacity: 100%;
}

.placeholder-circle path {
    fill: var(--light-accent-color);
}

.placeholder-icon {
    width: 36px;
    height: 36px;
    margin-left: 4px;
}