Skip to content

Instantly share code, notes, and snippets.

@ra-kesh
Created February 16, 2023 06:12
Show Gist options
  • Select an option

  • Save ra-kesh/ee6a2ce1e8eb710e693c25c33019977e to your computer and use it in GitHub Desktop.

Select an option

Save ra-kesh/ee6a2ce1e8eb710e693c25c33019977e to your computer and use it in GitHub Desktop.
import type { ComponentType } from "react"
import styled from "@emotion/styled"
const GradientBlur = styled.div`
user-select: none;
pointer-events: none;
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: min(96px,128px);
z-index: 10;
opacity: 0.95;
backdrop-filter: blur(5px);
-webkit-mask-image: linear-gradient(to bottom,#000 25%,transparent);
`
export function withBlur(Component): ComponentType {
return (props) => {
return <GradientBlur />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment