You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

84 lines
1.8 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
*{
margin: 0;
}
html,body{
position: relative;
height: 100%;
width: 100%;
}
body{
background: url("./bg.jpg") center no-repeat;
display: flex;
align-items: center;
justify-content: center;
}
#show{
position: relative;
width:fit-content;
/*width:-webkit-fit-content;*/
/*width:-moz-fit-content;*/
font-size: 5rem;
}
#main{
padding: 0 0.5rem;
position: relative;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
-webkit-text-stroke: 2px rgba(255, 255, 255, .8);
white-space:nowrap;
}
#bg{
padding: 0 0.5rem;
position: absolute;
top:0;
left: 0;
height: 100%;
width: 100%;
animation: 500ms show linear;
background: #333333;
}
#text{
padding: 0 0.5rem;
position: absolute;
top:0;
left: 0;
height: 100%;
width: 100%;
overflow: hidden;
white-space:nowrap;
-webkit-background-clip: text;
color: #fefefe;
animation: 500ms show linear;
}
@keyframes show {
from{
width: 0;
}
to{
width: 100%;
}
}
</style>
</head>
<body>
<div id="show">
<div id="main">Hello World!</div>
<div id="bg"></div>
<div id="text">Hello World!</div>
</div>
</body>
</html>