Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
[Front] Banner Background (#79)
Browse files Browse the repository at this point in the history
* Update banner image and backdrop filter in Gallery page

* Update @fluentui/react-components imports and add useMask styles
  • Loading branch information
Aloento authored Jan 29, 2024
1 parent 727ecea commit a30c201
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Binary file removed public/banner.jpg
Binary file not shown.
Binary file added public/banner.webp
Binary file not shown.
20 changes: 13 additions & 7 deletions src/Pages/Gallery/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Dialog, DialogBody, DialogContent, DialogSurface, DialogTitle, DialogTrigger, Divider, Image, LargeTitle, Text, makeStyles, shorthands, tokens } from "@fluentui/react-components";
import { Button, Dialog, DialogBody, DialogContent, DialogSurface, DialogTitle, DialogTrigger, Divider, Image, LargeTitle, Text, makeResetStyles, makeStyles, mergeClasses, shorthands, tokens } from "@fluentui/react-components";
import { useRefEffect } from "@fluentui/react-hooks";
import Typed from "typed.js";
import { ColFlex, Cover, Flex } from "~/Helpers/Styles";
Expand Down Expand Up @@ -26,7 +26,7 @@ const useStyles = makeStyles({
right: 0,
bottom: "4px",
...shorthands.borderRadius(tokens.borderRadiusXLarge),
backdropFilter: "blur(1px) brightness(105%)",
backdropFilter: "brightness(110%)",
},
info: {
...Flex,
Expand Down Expand Up @@ -55,13 +55,21 @@ const useStyles = makeStyles({
}
});

const useMaskStyle = makeResetStyles({
background: "linear-gradient(to right, transparent, var(--colorScrollbarOverlay))",
"@media screen and (max-width: 1024px)": {
background: tokens.colorBackgroundOverlay
}
})

/**
* @author Aloento
* @since 1.3.5
* @version 1.5.0
* @version 1.5.1
*/
export function Banner() {
const style = useStyles();
const mask = useMaskStyle();

const ref = useRefEffect<HTMLSpanElement>((el) => {
const typed = new Typed(el, {
Expand All @@ -78,10 +86,8 @@ export function Banner() {

return <>
<div className={style.main}>
<Image className={style.img} src="/banner.jpg" />
<div className={style.mask} style={{
background: 'linear-gradient(to right, transparent, var(--colorBackgroundOverlay))',
}} />
<Image className={style.img} src="/banner.webp" />
<div className={mergeClasses(style.mask, mask)} />

<div className={style.info}>
<div className={style.space} />
Expand Down

0 comments on commit a30c201

Please sign in to comment.