Skip to content

Commit

Permalink
feat: add backdrop filter (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuireu authored Oct 1, 2023
1 parent ab0345a commit da69048
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/components/organisms/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const Header = () => {

return (
<header className={`${isScrolling ? `--is-scrolling` : ``}`}>
<div className='backdrop' />
<section className={`wrapper`}>
<Link
className={`logo__link ${isMenuActive ? `--is-active` : ``}`}
Expand Down
27 changes: 24 additions & 3 deletions src/components/organisms/Header/Header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@import '../../../styles/global/functions';

header {
backdrop-filter: blur(1.25rem);
background: rgba(color(others, white), .75);
// backdrop-filter: blur(1.25rem);
//background: rgba(color(others, white), .75);
margin-inline: auto;
padding: 1.5rem 0;
position: fixed;
Expand All @@ -12,14 +12,31 @@ header {
z-index: 1000;

&.--is-scrolling {
box-shadow: 0 .125rem .375rem color(neutral, neutral-3);
//box-shadow: 0 .125rem .375rem color(neutral, neutral-3);

&::after {
clip-path: polygon(0% 0%, 100% 0%, 100% 120%, 0% 120%);
}
}
}

.backdrop {
--extended-by: 100px;
--cutoff: calc(100% - var(--extended-by));
--blur: 15px;
pointer-events: none;
position: absolute;
inset:0;
bottom: calc(-1 * var(--extended-by));
-webkit-mask-image:linear-gradient(
to bottom,
black 0,
black var(--cutoff),
transparent var(--cutoff)
);
backdrop-filter: blur(var(--blur));
}

.logo {
height: 100%;
max-height: 14rem;
Expand All @@ -28,6 +45,10 @@ header {
width: 100%;
}

.logo__link:not(.--is-active){
position: relative;
}

.logo__link.--is-active .logo {
animation: to-front .5s forwards .3s;
fill: color(others, white);
Expand Down
18 changes: 9 additions & 9 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Index = ({
},
},
}) => {
return (
/* return (
<h1
style={{
textAlign: `center`,
Expand All @@ -34,15 +34,15 @@ const Index = ({
<br/>
We&apos;ll be back soon
</h1>
)
)*/

//return <Layout>
// <SEO title="Home"/>
// <HomeJumbotron {...jumbotron} />
// <Testimonials {...testimonials} />
// <MyWork {...myWork} />
// <HomeLatestArticles //{...latestArticles} />
// </Layout>
return <Layout>
<SEO title="Home"/>
<HomeJumbotron {...jumbotron} />
<Testimonials {...testimonials} />
<MyWork {...myWork} />
<HomeLatestArticles {...latestArticles} />
</Layout>
};

export const homeData = graphql`
Expand Down

0 comments on commit da69048

Please sign in to comment.