js+css实现文字横向分割显示动画效果代码

代码语言:html

所属分类:动画

代码描述:js+css实现文字横向分割显示动画效果代码

代码标签: js css 文字 横向 分割 显示 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">




    <style>
        body {
        				background-color: #545454; /* Dark grey */
        				margin: 0;
        				padding: 0;
        				position: relative; 
        				overflow: hidden;
        				justify-content: center;
              			align-items: center;
              			text-align:center;
        			}
        			.black-line {
        				position: absolute;
        				height: 22px;
        				width: 100%; 
        				background-color: black; 
        				color: white; 
        				white-space: nowrap;
        				transform: translateX(100vw);					
        			}
        			.words {
        				position: absolute;
        				top: 180px; /* too hard to do with % or ems */
        				height: 85px;
        				width: 100%;	
        			}
        			.word-line{
        				font-size: 85px;
        				font-family: Arial, sans-serif;
        				font-weight: bold;
        				margin: 0;
        				padding: 0;
        				color: white;
        				height: 85px;
        				position: absolute;
        				width: 100%; 
        				background-color: transparent; 
        				white-space: nowrap;
        				transform: translateX(100vw); 							
        			}
        /*odd numbers first*/
        	#line1 {animation: slideIn 2s forwards .5s, waitawhile 3s forwards 10s, slideOut 1s forwards 9.5s;}		
        	#line9{/*goes with 9a*/		
            	animation: slideIn 2s forwards 3s, waitawhile 3s forwards 10s, slideOut 1s forwards 11s,slideBack 2s forwards 13s;			    
        			}
        	#line10{/*goes with 9b*/
        				animation: slideIn 2s forwards 4s, waitawhile 3s forwards 10s;
        			}
        	#line11{/*goes with 9c*/
        			animation: slideIn 2s forwards 2s, 
                       waitawhile 3s forwards 10s, 
                       slideOut 1s forwards 9.5s,/*was 9.5*/
                       slideBack 2s forwards 19s,
                       slice 2s forwards 22s; /* have to start after other anims */
                     }
        	#line3 {animation: slideIn 2s forwards 2s, waitawhile 3s forwards 10s, slideOut 1s forwards 11s,slideBack 2s forwards 13s;}
        	#line5 {animation: slideIn 2s forwards 4.25s, waitawhile 3s forwards 10s, slideOut 1s forwards 11.5s,slideBack 2s forwards 13s;}
        	#line7 {animation: slideIn 2s forwards 1.5s, waitawhile 3s forwards 10s, slideOut 1s forwards 9.75s,slideBack 2s forwards 13s;}
        	#line9a{/*top hitchcock*/
        				clip-path: inset(0 0 67% 0);
        				animation: slideIn 2s forwards 3s, waitawhile 3s forwards 10s, slideOut 1s forwards 9s;
        				z-index: 4;	
        			}
        	#line9b{/* middle hitchcock and PSYCHO*/
        			animation: slideIn 2s forwards 4s, 
                       waitawhile 3s forwards 10s, 
                       slideOut 1s forwards 8s,/*was 9.5*/
                       slideBack 2s forwards 16s,
                       slice 2s forwards 22s; /* Start after slideOut */
        			clip-path: inset(32% 0 33% 0);
        				z-index: 2;
        			}
        	#line9c {/*bottom hitchcock*/
        		animation: slideIn 2s forwards 2s, 
                       waitawhile 3s forwards 9s, 
                       slideOut 1s forwards 9.5s;/*was 9.5*/
                     /* Start after slideOut */
        		clip-path: inset(66.8% 0 0 0);
        		z-index: 3;
        			}
        			/*top of  PSYCHO*/
        	#line9d{animation: slideIn 2s forwards 12s;
        		clip-path: inset(0 0 67% 0);
        		z-index: 4;	
        		background-color:black;
        		}
        	#line9f{/*black background for Psycho-not working*/
        			animation: slideIn 2s forwards 10s;
        			background-color:black;
        			height:24px;/*get rid of pesky grey line*/
        	}
        		/*bottom of PSYCHO*/
        	#line9e{animation: slideIn 2s forwards 12s;
        		clip-path: inset(66.8% 0 0 0);
        		z-index: 3;	
        		background-color:black;
        		}
        	#line13 {animation: slideIn 2s forwards 3.5s, waitawhile 3s forwards 10s, slideOut 1s forwards 10.5s, slideBack 2s forwards 13s;}
        	#line15 {animation: slideIn 2s forwards 2.75s, waitawhile 3s forwards 10s, slideOut 1s forwards 9s, slideBack 2s forwards 13s;}
        	#line17 {animation: slideIn 2s forwards 2s, waitawhile 3s forwards 10s, slideOut 1s forwards 10s,slideBack 2s forwards 13s;}
        	#line19 {animation: slideIn 2s forwards 3.25s, waitawhile 3s forwards 10s, slideOut 1s forwards 12s,slideBack 2s forwards 13s;}
        			
        	/*even numbers make background solid black- so comes last - with the 9b text*/
        #line2{animation: slideIn 2s forwards 5s, waitawhile 3s forwards 10s;}
        #line8{animation: slideIn 2s forwards 5s, waitawhile 3s forwards 10s;}
        #line4{animation: slideIn 2s forwards 5.5s, waitawhile 3s forwards 10s;}
        #line6{animation: slideIn 2s forwards 4.75s, waitawhile 3s forwards 10s;}
        #line12{animation: slideIn 2s forwards 4s, waitawhile 3s forwards 10s;}
        #line14{animation: slideIn 2s forwards 5.25s, waitawhile 3s forwards 10s;}
        #line16{animation: slideIn 2s forwards 6s, waitawhile 3s forwards 10s;}
        #line18{animation: slideIn 2s forwards 5.25s, waitawhile 3s forwards 10s;}
        #line20{animation: slideIn 2s forwards 5.5s, wa.........完整代码请登录后点击上方下载按钮下载查看

网友评论0