π Add background noise
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
f42d5af4fe
ΠΠΎΠΌΠΌΠΈΡ
d94bd73ec1
|
@ -0,0 +1,16 @@
|
|||
const Filter = () => {
|
||||
return (
|
||||
<svg id="noise-filter-wrapper">
|
||||
<filter id="noise-filter">
|
||||
<feTurbulence
|
||||
type="fractalNoise"
|
||||
baseFrequency="6.29"
|
||||
numOctaves="6"
|
||||
stitchTiles="stitch"
|
||||
/>
|
||||
</filter>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export default Filter
|
|
@ -5,19 +5,24 @@ import { useBackground } from '../../contexts/BackgroundContext'
|
|||
import Footer from '../footer/Footer'
|
||||
import Header from '../header/Header'
|
||||
|
||||
import Filter from './Filter'
|
||||
|
||||
const Layout = ({ children }) => {
|
||||
const { animationStep } = useBackground()
|
||||
|
||||
const classes = clsx('layout', { [`step-${animationStep}`]: true })
|
||||
|
||||
return (
|
||||
<div className={classes}>
|
||||
<div className="layout__content">
|
||||
<Header />
|
||||
<main>{children}</main>
|
||||
<Footer />
|
||||
<>
|
||||
<Filter />
|
||||
<div className={classes}>
|
||||
<div className="layout__content">
|
||||
<Header />
|
||||
<main>{children}</main>
|
||||
<Footer />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@
|
|||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
z-index: $index-content;
|
||||
}
|
||||
|
||||
main {
|
||||
|
|
|
@ -15,3 +15,29 @@ a {
|
|||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
// Background filter
|
||||
#noise-filter-wrapper {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body::before {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
mix-blend-mode: darken;
|
||||
// mix-blend-mode: difference;
|
||||
// mix-blend-mode: exclusion;
|
||||
// mix-blend-mode: multiply;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
body::before {
|
||||
background: #fff;
|
||||
filter: url(#noise-filter);
|
||||
z-index: $index-filter;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ $purple: #6b00cf;
|
|||
$red: #e32e40;
|
||||
|
||||
// Indexes
|
||||
$index-filter: 1;
|
||||
$index-content: 5;
|
||||
|
||||
// Transitions
|
||||
$bezier-default: cubic-bezier(0.25, 0.1, 0.25, 1);
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅