비디오 배경이 있는 로그인 및 등록 투명 양식을 만듭니다.
5850 단어 designjavascripthtmlcss
점진적인 세부 사항에 들어가고 싶다면
.
내가 배경으로 사용하는 비디오는 pixabay에서 찾았습니다. 원하는 사람을 사용할 수 있습니다.
index.html
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<video poster="screenshot.jpg" autoplay playsinline muted loop>
<source src="thecity.mp4" type="video/mp4">
</video>
<div class="video">
<div class="form">
<div class="button">
<div id="btn"></div>
<button type="button" class="toggle-btn" onclick="loginform()">Log In</button>
<button type="button" class="toggle-btn" onclick="signupform()">Sign Up</button>
</div>
<form id="loginform" class="input-group">
<input type="text" class="input-field" placeholder="Username" required />
<input type="password" class="input-field" placeholder="Password" required />
<p class="Fpass"><a href="/">Forgot Password</a></p>
<button type="submit" class="submit-btn">Log In</button>
</form>
<form id="signupform" class="input-group">
<input type="text" class="input-field" placeholder="Username" required />
<input type="email" class="input-field" placeholder="E-mail" required />
<input type="password" class="input-field" placeholder="Password" required />
<button type="submit" class="submit-btn">Sign Up</button>
</form>
</div>
</div>
<script>
</script>
</body>
Javascript
<script>
var x = document.getElementById("loginform");
var y = document.getElementById("signupform");
var z = document.getElementById("btn");
function signupform() {
x.style.left = "-400px";
y.style.left = "50px";
z.style.left = "110px";
}
function loginform() {
x.style.left = "50px";
y.style.left = "450px";
z.style.left = "0";
}
</script>
Style.css
* {
margin: 0;
padding: 0;
font-family: sans-serif;
}
video { /* video background before known as a hero*/
width: 100vw;
height: 100vh;
object-fit: cover;
position: fixed;
top: 0;
left: 0;
z-index: -1;
}
.form { /* invisible form here settings*/
width: 380px;
height: 480px;
position: relative;
margin: 6% auto;
background: rgba(255, 255, 255, 0.062);
padding: 5px;
overflow: hidden;
}
.button {
width: 220px;
margin: 35px auto;
position: relative;
border-radius: 30px;
}
.toggle-btn {
padding: 10px 30px;
cursor: pointer;
background: transparent;
border: 0;
outline: none;
position: relative;
}
#btn {
top: 0;
left: 0;
position: absolute;
width: 100px;
height: 100%;
background: linear-gradient(to right, #10b3ff, #06ffc9);
border-radius: 0px;
transition: .5s;
}
.input-group {
top: 180px;
position: absolute;
width: 280px;
transition: .5s;
}
.input-field {
width: 100%;
padding: 10px 0;
margin: 5px 0;
border-left: 0;
border-top: 0;
border-right: 0;
border-bottom: 1px solid rgb(255, 255, 255);
outline: none;
background: transparent;
}
input, select, textarea {
color: rgb(255, 255, 255);
}
::placeholder { /* Placeholder text color*/
color: rgb(255, 255, 255);
opacity: 1;
}
.submit-btn {
width: 65%;
cursor: pointer;
display: block;
margin: 50;
background: transparent;
border-radius: 80px;
height: 40px;
line-height: 40px;
padding: 0 10px;
color: white;
border: solid 1px;
border-image: linear-gradient(to left, #10b3ff, #06ffc9);
border-image-slice: 1;
clip-path: polygon(0 0, 12px 0, 12px 1px, 24px 1px, 24px 0, 100% 0, 100% 100%, 0 100%);
}
span {
color: rgb(255, 255, 255);
font-size: 12px;
bottom: 68px;
position: absolute;
}
#loginform {
left: 50px;
}
#signupform {
left: 450px;
}
.Fpass a {
position:relative;
text-decoration: none;
color: rgb(42, 214, 214);
transition:color .15s ease-in-out;
top: 10px;
}
.Fpass a:hover {
background-size: 100% 100%;
cursor: pointer;
}
.Fpass a:after {
display:block;
content:"";
position: absolute;
right:0;
left:0;
width:100%;
height:3px;
opacity:0;
transform:translateY(-150%);
transition:transform .15s ease-in-out, opacity .15s ease-in-out;
background-color: rgba(0, 247, 255, 0.589);
}
.Fpass a.is-active,
.Fpass a:active,
.Fpass a:focus,
.Fpass a:hover {
color: rgba(0, 247, 255, 0.589);
}
.Fpass a.is-active:after,
.Fpass a:active:after,
.Fpass a:focus:after,
.Fpass a:hover:after {
transform:translateY(0);
opacity:1;
}
Reference
이 문제에 관하여(비디오 배경이 있는 로그인 및 등록 투명 양식을 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/herofoxfire/create-login-register-transparent-form-with-video-background-55mh텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)