Add version footer

This commit is contained in:
Max Goodhart
2025-06-17 01:21:29 +00:00
parent a36a07d177
commit 6e50df1972

View File

@@ -40,10 +40,8 @@ function Overlay({
) )
const overlays = streams.filter((s) => s.kind === 'overlay') const overlays = streams.filter((s) => s.kind === 'overlay')
return ( return (
<div> <OverlayContainer>
<VersionText> <VersionFooter />
<strong>streamwall.io</strong> {packageInfo.version}
</VersionText>
{activeViews.map(({ state, context }) => { {activeViews.map(({ state, context }) => {
const { content, pos } = context const { content, pos } = context
if (!content) { if (!content) {
@@ -107,7 +105,7 @@ function Overlay({
scrolling="no" scrolling="no"
/> />
))} ))}
</div> </OverlayContainer>
) )
} }
@@ -132,6 +130,28 @@ function App() {
return <Overlay config={config} views={views} streams={streams} /> return <Overlay config={config} views={views} streams={streams} />
} }
function VersionFooter() {
const [isShowing, setShowing] = useState(false)
useEffect(() => {
let timeout: ReturnType<typeof setTimeout> | undefined = undefined
const interval = setInterval(() => {
setShowing(true)
timeout = setTimeout(() => {
setShowing(false)
}, 5000)
}, 30 * 1000)
return () => {
clearInterval(interval)
clearTimeout(timeout)
}
}, [])
return (
<VersionText isShowing={isShowing}>
<strong>streamwall.io</strong> {packageInfo.version}
</VersionText>
)
}
function StreamIcon({ url }: { url: string }) { function StreamIcon({ url }: { url: string }) {
let parsedURL let parsedURL
try { try {
@@ -160,6 +180,10 @@ function StreamIcon({ url }: { url: string }) {
return null return null
} }
const OverlayContainer = styled.div`
overflow: hidden;
`
const SpaceBorder = styled.div.attrs(() => ({ const SpaceBorder = styled.div.attrs(() => ({
borderWidth: 2, borderWidth: 2,
}))` }))`
@@ -272,7 +296,7 @@ const BlurCover = styled.div`
` `
const VersionText = styled.div` const VersionText = styled.div`
position: absolute; position: fixed;
bottom: 4px; bottom: 4px;
right: 4px; right: 4px;
color: white; color: white;
@@ -285,7 +309,8 @@ const VersionText = styled.div`
backdrop-filter: blur(30px); backdrop-filter: blur(30px);
padding: 1px 4px; padding: 1px 4px;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
opacity: 0.65; opacity: ${({ isShowing }) => (isShowing ? '.65' : '.35')};
transition: ease-out 500ms all;
` `
const OverlayIFrame = styled.iframe` const OverlayIFrame = styled.iframe`