Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Don't show "play" overlay when not hovered #17676

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
align-items: center;
position: relative;

.posthog-3000 & {
background-color: var(--bg-3000);
}
.PlayerFrame__content {
position: absolute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@
align-items: center;
z-index: 1;

transition: background-color 100ms;
background-color: rgba(0, 0, 0, 0.08);
transition: opacity 100ms;
background-color: rgba(0, 0, 0, 0.15);
opacity: 0.8;

&:hover {
background-color: rgba(0, 0, 0, 0.15);
opacity: 1;
}

&--only-hover {
// When paused only show on hover to allow people to take screenshots
opacity: 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import './PlayerFrameOverlay.scss'
import { PlayerUpNext } from './PlayerUpNext'
import { useState } from 'react'
import clsx from 'clsx'

export interface PlayerFrameOverlayProps extends SessionRecordingPlayerLogicProps {
nextSessionRecording?: Partial<SessionRecordingType>
Expand All @@ -20,6 +21,9 @@ const PlayerFrameOverlayContent = ({
currentPlayerState: SessionPlayerState
}): JSX.Element | null => {
let content = null
const pausedState =
currentPlayerState === SessionPlayerState.PAUSE || currentPlayerState === SessionPlayerState.READY

if (currentPlayerState === SessionPlayerState.ERROR) {
content = (
<div className="flex flex-col justify-center items-center p-6 bg-bg-light rounded m-6 gap-2 max-w-120 shadow">
Expand Down Expand Up @@ -56,14 +60,17 @@ const PlayerFrameOverlayContent = ({
<div className="SessionRecordingPlayer--buffering text-3xl italic font-medium text-white">Buffering…</div>
)
}
if (currentPlayerState === SessionPlayerState.PAUSE || currentPlayerState === SessionPlayerState.READY) {
if (pausedState) {
content = <IconPlay className="text-6xl text-white" />
}
if (currentPlayerState === SessionPlayerState.SKIP) {
content = <div className="text-3xl italic font-medium text-white">Skipping inactivity</div>
}
return content ? (
<div className="PlayerFrameOverlay__content" aria-busy={currentPlayerState === SessionPlayerState.BUFFER}>
<div
className={clsx('PlayerFrameOverlay__content', pausedState && 'PlayerFrameOverlay__content--only-hover')}
aria-busy={currentPlayerState === SessionPlayerState.BUFFER}
>
{content}
</div>
) : null
Expand Down
Loading