div+css实现玻璃体动态背景登录表单页面代码

代码语言:html

所属分类:表单美化

代码描述:div+css实现玻璃体动态背景登录表单页面代码

代码标签: div css 玻璃体 动态 背景 登录 表单 代码

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

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

<head>
    <meta charset="UTF-8">
<style>
    @import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600;1,700;1,800;1,900&display=swap");
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
html {
  font-size: 62.5%;
  --main-color: rgb(192, 60, 165);
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-image: linear-gradient(80deg, #34278d, #e0d3ef);
  font-family: "Poppins", sans-serif;
}
.top {
  position: absolute;
  max-height: 80rem;
  max-width: 80rem;
  height: 100%;
  width: 100%;
  border-radius: 50%;

  background-image: linear-gradient(80deg, #e0d3ef, var(--main-color));
  filter: blur(40px);
  animation: bottom 30s infinite;
}
@keyframes bottom {
  0%,
  100% {
    top: -10rem;
  }
  80% {
    top: 50rem;
  }
}
.bottom {
  position: absolute;
  max-height: 50rem;
  max-width: 50rem;
  height: 100%;
  width: 100%;
  right: 0;
  border-radius: 50%;

  background-image: linear-gradient(80deg, var(--main-color), #ebe9ee);

  filter: blur(2rem);
  animation: top 30s infinite;
}
@keyframes top {
  0%,
  100% {
    bottom: -10rem;
  }
  80% {
    bottom: 50rem;
  }
}
.left {
  position: absolute;
  max-height: 50rem;
  max-width: 50rem;
  height: 100%;
  width: 100%;
  left: 0;
  border-radius: 50%;

  background-image: linear-gradient(80deg, #ebe9ee, #a42322);
  filter: blur(6rem);
  animation: left 30s infinite;
}
@keyframes left {
  0%,
  100% {
    left: -10rem;
  }
  80% {
    left: 80rem;
  }
}

.right {
  position: absolute;
  max-height: 50rem;
  max-width: 50rem;
  height: 100%;
  width: 100%;
  right: 0;
  border-radius: 50%;

  background: linear-gradient(80deg, #a42322, #34278d);

  filter: blur(30px);
  animation: right 30s infinite;
}
@keyframes right {
  0%,
  100% {
    right: -10rem;
  }
  80% {
    right: 80rem;
  }
}
.bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  width: 100%;
  z-index: -1;
  overflow: hidden;
}
.container {
  height: 70vh;
  width: clamp(25rem, 32rem, 25%);
  height: clamp(50rem, 70vh, 55rem);
  position: absolute;
  z-index: 2;
}
.glass {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right bottom,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.1)
  );
  z-index: 3;
  backdrop-filter: blur(1rem);
  border-radius: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  border-bottom-left-radius: 20rem;
  border-bottom-right-radius: 20rem;
  box-shadow: 0 1.5rem 0 rgba(255, 255, 255, 0.61),
    inset 0 -1.5rem rgba(238, 238, 238, 0.692), 0 4.5rem 0 rgba(0, 0, 0, 0.05);
}
.icon {
  position: absolute;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background-color: black;
  top: -1rem;
}
.icon2 {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background-color: black;
}

/* ************************************************************************* */
form {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 2rem;
  font-size: 2.2rem;
}

.log__box {
  position: relative;
  height: 5rem;
  width: 80%;
}
.input-style {
  width: 100%;
  border: none;
  outline: none;
  height: 100%;
  padding: 0 3rem;
  font-size: 1.2rem;
  color: #777;
  border-bottom: 4px solid #ccc;
  transition: all 0.3s;
  background: linear-gradient(
    to right bottom,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.1)
  );
  border-radius: 1rem;
}
form .i {
  font-size: 2.2rem;
  position: absolute;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
  color: var(--main-color);
}
.log__box input:is(:focus, :valid) {
  border-bottom-color: var(--main-color);
  font-size: 1.6rem;
  color: var(--main-color);
}

.log__box input:is(:focus, :valid) ~ .i {
  color: var(--main-color);
}
.log__remember label {
  font-size: 1.6rem;
  color: #777;
}
.log__remember {
  margin-top: -1rem;
  height: fit-content;
}
form button {
  width: 80%;
  height: 5rem;
  font-size: 1.6rem;
  border-radius: 1rem;
  font-weigh.........完整代码请登录后点击上方下载按钮下载查看

网友评论0