Skip to content

Instantly share code, notes, and snippets.

@dnslin
Last active December 14, 2022 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnslin/b6a936199c05b77c4c6bc8dae58944ef to your computer and use it in GitHub Desktop.
Save dnslin/b6a936199c05b77c4c6bc8dae58944ef to your computer and use it in GitHub Desktop.
Wavy login form
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
<link href="https://fonts.googleapis.com/css?family=Asap" rel="stylesheet">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<form class="login">
<span>Login</span>
<input type="text" placeholder="Username">
<input type="password" placeholder="Password">
<button>Login</button>
</form>
<!-- partial -->
</body>
</html>
body {
margin: 0px;
background-size: 100% 100%;
background-attachment: fixed;
background-image: url("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201810%2F31%2F20181031113211_cECNW.jpeg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1662097827&t=b475847d661404409771a2fc2f40fd73");
background-repeat: repeat-x;
font-family: "Asap", sans-serif;
}
.login {
overflow: hidden;
background-color: white;
padding: 40px 30px 30px 30px;
border-radius: 10px;
position: absolute;
top: 50%;
left: 50%;
width: 400px;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transition: -webkit-transform 300ms, box-shadow 300ms;
-moz-transition: -moz-transform 300ms, box-shadow 300ms;
transition: transform 300ms, box-shadow 300ms;
box-shadow: 5px 10px 10px rgba(1, 225, 255, 0.2);
}
.login::before, .login::after {
content: "";
position: absolute;
width: 600px;
height: 600px;
border-top-left-radius: 40%;
border-top-right-radius: 45%;
border-bottom-left-radius: 35%;
border-bottom-right-radius: 40%;
z-index: -1;
}
.login::before {
left: 40%;
bottom: -130%;
background-color: rgba(69, 105, 144, 0.15);
-webkit-animation: wawes 6s infinite linear;
-moz-animation: wawes 6s infinite linear;
animation: wawes 6s infinite linear;
}
.login::after {
left: 35%;
bottom: -125%;
background-color: rgba(2, 128, 144, 0.2);
-webkit-animation: wawes 7s infinite;
-moz-animation: wawes 7s infinite;
animation: wawes 7s infinite;
}
.login > input {
font-family: "Asap", sans-serif;
display: block;
border-radius: 5px;
font-size: 16px;
background: white;
width: 100%;
border: 0;
padding: 10px 10px;
margin: 15px -10px;
}
.login > button {
font-family: "Asap", sans-serif;
cursor: pointer;
color: #fff;
font-size: 16px;
text-transform: uppercase;
width: 80px;
border: 0;
padding: 10px 0;
margin-top: 10px;
margin-left: -5px;
border-radius: 5px;
background-color: rgba(61, 149, 165);
-webkit-transition: background-color 300ms;
-moz-transition: background-color 300ms;
transition: background-color 300ms;
}
.login > span {
/* span 居中 */
display: block;
text-align: center;
/* 调整 span 大小 */
width: 100%;
height: 100%;
/* 调整 span 上下间隔 */
line-height: 40px;
font-size: 15 ;
}
@-webkit-keyframes wawes {
from {
-webkit-transform: rotate(0);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes wawes {
from {
-moz-transform: rotate(0);
}
to {
-moz-transform: rotate(360deg);
}
}
@keyframes wawes {
from {
-webkit-transform: rotate(0);
-moz-transform: rotate(0);
-ms-transform: rotate(0);
-o-transform: rotate(0);
transform: rotate(0);
}
to {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment