This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed
src/containers/layout/GlobalLayout Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ const GlobalLayoutContainer: FC<TProps> = ({
6969 { /* @ts -ignore */ }
7070 < Addon />
7171 < Skeleton >
72+ < Wallpaper wallpaper = { wallpaper } wallpapers = { wallpapers } />
7273 { /* @ts -ignore */ }
7374 < CustomScroller
7475 instanceKey = { BODY_SCROLLER }
@@ -81,7 +82,6 @@ const GlobalLayoutContainer: FC<TProps> = ({
8182 >
8283 < Wrapper >
8384 < SEO metric = { metric } config = { seoConfig } />
84- < Wallpaper wallpaper = { wallpaper } wallpapers = { wallpapers } />
8585 < InnerWrapper metric = { metric } sidebarPin = { sidebarPin } >
8686 { /* @ts -ignore */ }
8787 < ContentWrapper offsetLeft = { sidebarPin } >
Original file line number Diff line number Diff line change 11import styled from 'styled-components'
2+ import { animate } from '@/utils/css'
23
34export const Wrapper = styled . div < { effect : string } > `
4- ${ ( { effect } ) => effect || '' } ;
5- position: fixed;
5+ position: absolute;
66 top: 0;
7- height: 100vh;
8- width: 100vw;
7+ height: 100%;
8+ width: 100%;
9+
10+ ${ ( { effect } ) => effect || '' } ;
911
12+ /* adjust s value for speed */
1013 /* position: fixed; */
1114 /* see https://www.zhangxinxu.com/wordpress/2015/11/css3-will-change-improve-paint/ */
1215 will-change: transform;
16+ /**
17+ * 可以横向滚动,有点意思。。
18+ * @link https://stackoverflow.com/questions/37903824/how-can-i-make-infinite-flowing-background-with-only-css
19+ */
20+
21+ /* animation: ${ animate . animatedBg } 3000s linear; */
1322 transition: all 0.3s;
1423`
1524export const InnerWrapper = styled . div `
Original file line number Diff line number Diff line change 11import { keyframes } from 'styled-components'
22
3+ const animatedBg = keyframes `
4+ from {
5+ background-position: 0 0;
6+ }
7+ /*use negative width if you want it to flow right to left else and positive for left to right*/
8+ to {
9+ background-position: -10000px 0;
10+ }
11+ `
12+
313const shake = keyframes `
414 from,
515 to {
@@ -110,6 +120,7 @@ const animate = {
110120 breath,
111121 blink,
112122 jump,
123+ animatedBg,
113124}
114125
115126export default animate
You can’t perform that action at this time.
0 commit comments