mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 13:01:59 +03:00
perf(component): use png instead of svg for rendering noise svg (#4935)
This commit is contained in:
parent
8d55e5cdf9
commit
9ac8a32e00
@ -3,6 +3,7 @@ import type { ComplexStyleRule } from '@vanilla-extract/css';
|
||||
import { globalStyle, style } from '@vanilla-extract/css';
|
||||
|
||||
import { breakpoints } from '../../styles/mui-theme';
|
||||
|
||||
export const appStyle = style({
|
||||
width: '100%',
|
||||
position: 'relative',
|
||||
@ -22,9 +23,11 @@ export const appStyle = style({
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
opacity: 'var(--affine-noise-opacity)',
|
||||
backgroundSize: '25%',
|
||||
backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.25' numOctaves='10' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,
|
||||
opacity: 'var(--affine-noise-opacity, 0)',
|
||||
backgroundRepeat: 'repeat',
|
||||
backgroundSize: '2.5%',
|
||||
// todo: figure out how to use vanilla-extract webpack plugin to inject img url
|
||||
backgroundImage: `var(--noise-background)`,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -8,6 +8,10 @@
|
||||
/*transition: all 0.1s;*/
|
||||
}
|
||||
|
||||
:root {
|
||||
--noise-background: url(./noise.png);
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
h1,
|
||||
|
BIN
packages/frontend/component/src/theme/noise.png
Normal file
BIN
packages/frontend/component/src/theme/noise.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
Loading…
Reference in New Issue
Block a user