File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en " dir ="ltr ">
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < title > </ title >
6
+ < link rel ="stylesheet " href ="styles.css ">
7
+ </ head >
8
+ < body >
9
+ < div class ="bg "> </ div >
10
+ < div class ="bg bg2 "> </ div >
11
+ < div class ="bg bg3 "> </ div >
12
+ < div class ="content ">
13
+ < h1 > Sliding Diagonals Background Effect</ h1 >
14
+ </ div >
15
+ </ body >
16
+ </ html >
Original file line number Diff line number Diff line change
1
+ html {
2
+ height : 100% ;
3
+ }
4
+
5
+ body {
6
+ margin : 0 ;
7
+ }
8
+
9
+ .bg {
10
+ animation : slide 3s ease-in-out infinite alternate;
11
+ background-image : linear-gradient (-60deg , # 6c3 50% , # 09f 50% );
12
+ bottom : 0 ;
13
+ left : -50% ;
14
+ opacity : .5 ;
15
+ position : fixed;
16
+ right : -50% ;
17
+ top : 0 ;
18
+ z-index : -1 ;
19
+ }
20
+
21
+ .bg2 {
22
+ animation-direction : alternate-reverse;
23
+ animation-duration : 4s ;
24
+ }
25
+
26
+ .bg3 {
27
+ animation-duration : 5s ;
28
+ }
29
+
30
+ .content {
31
+ background-color : rgba (255 , 255 , 255 , .8 );
32
+ border-radius : .25em ;
33
+ box-shadow : 0 0 .25em rgba (0 , 0 , 0 , .25 );
34
+ box-sizing : border-box;
35
+ left : 50% ;
36
+ padding : 10vmin ;
37
+ position : fixed;
38
+ text-align : center;
39
+ top : 50% ;
40
+ transform : translate (-50% , -50% );
41
+ }
42
+
43
+ h1 {
44
+ font-family : monospace;
45
+ }
46
+
47
+ @keyframes slide {
48
+ 0% {
49
+ transform : translateX (-25% );
50
+ }
51
+ 100% {
52
+ transform : translateX (25% );
53
+ }
54
+ }
You can’t perform that action at this time.
0 commit comments