css+svg实现磨砂透明层渐变弹出动画效果代码

代码语言:html

所属分类:弹出层

代码描述:css+svg实现磨砂透明层渐变弹出动画效果代码

代码标签: css svg 磨砂 透明 渐变 弹出 动画

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

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

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


  
  
<style>
body {
  background: #161616;
}

* {
  margin: 0;
  padding: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
  text-rendering: geometricPrecision;
  box-sizing: border-box;
}
*::-webkit-scrollbar {
  display: none;
}

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --side-panel: 200px;
}

h1, p {
  font-family: "Hanken Grotesk", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  color: #fff;
}

h1 {
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.05em;
}

p {
  font-size: 16px;
  letter-spacing: 0em;
  line-height: 140%;
}

p.bold {
  font-weight: 400;
  color: rgba(255,255,255,0.65);
}

p.light {
  font-weight: 400;
  color: rgba(255,255,255,0.45);
}

main {
  position: relative;
  width: 100%;
  height: 100vh;
  padding: 32px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0%;
}

.content {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 100%;
  min-height: 500px;
  background: #161616;
  box-shadow: inset 0 0 150px rgba(52,46,45,1);
  display: flex;
  align-items: start;
  justify-content: start;
  gap: 16px;
  transform: translate3d(0,0,0);
  border-radius: 50px;
  border: 2px solid #232120;
  -webkit-border-radius: 50px;
  will-change: box-shadow;
  -webkit-will-change: box-shadow;
  transition: 1s cubic-bezier(.17,1,.33,1);
}

.content.active {
  box-shadow: inset 0 0 150px rgba(52,46,45,0.7);
  background: #0F0F0F;
}

.main-content {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 48px;
  -webkit-border-radius: 48px;
  overflow: hidden;
  transform: translate3d(0,0,0) scale(1);
  filter: blur(0px) brightness(1);
  will-change: transform, filter;
  -webkit-will-change: transform, filter;
  transition: 0.6s cubic-bezier(.17,1,.33,1);
}

.content.active .main-content {
  transform: translate3d(0,0,0) scale(0.9);
  filter: blur(16px) brightness(0.7);
  transition: 0.3s ease-out;
}

.photo-wrapper {
  position: relative;
  height: 50%;
  width: 100%;
  max-height: 400px;
}

.photo {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: contain;
  background: #161616;
  border-radius: 44px;
}

.main-info {
  position: relative;
  width: 100%;
  z-index: 1;
  display: flex;
  flex-flow: column;
  gap: 32px;
  padding: 32px;
}

.title-container {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.title-info {
  display: flex;
  gap: 12px;
  padding-right: 4px;
}

@media screen and (max-width: 600px) {
  .title-info {
    display: none;
  }
}

.songs {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 6px;
}

.song {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 100%;
  min-height: 72px;
  border-radius: 32px;
  border: 2px solid rgba(255,255,255,0.04);
  padding: 0 22px;
  margin: 0 -22px;
  box-shadow: inset 0 0 0px 0 rgba(255,255,255,0.15);
  transition: .2s ease;
  cursor: pointer;
}

.songs .song:hover {
  box-shadow: inset 0 0 64px 0 rgba(255,255,255,0.075);
}

.end {
  display: flex;
  align-items: center;
  gap: 24px;
}

.song svg {
  opacity: 0;
  transition: 0.2s ease;
}

.songs .song:hover svg {
  opacity: 0.5;
}

.song svg:hover {
  opacity: 1!important;
  cursor: pointer;
}



/* progressive blur stuffs */

.gradient-blur {
  position: absolute;
  top: 0!important;
  left: 0!important;
  width: 100%;
  height: 101%;
  inset: auto 0 0 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.song-modal .gradient-blur {
  height: 800px;
  top: auto!important;
  bottom: 0;
}

.gradient-blur > div {
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0