div+css实现玻璃材质水泡效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现玻璃材质水泡效果代码

代码标签: div css 玻璃 材质 水泡

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

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

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

  
  
<style>
html {
  font-size: 1.2vmin;
}

*:before, *:after, bubble {
  position: absolute;
  inset: 0;
  margin: auto;
  content: "";
}

bubble {
  width: 50rem;
  aspect-ratio: 1/1;
  box-shadow: 8rem 8rem 4rem -6rem rgba(0, 0, 0, 0.5), 8rem 8rem 4rem -2rem rgba(0, 255, 170, 0.1), 8rem 8rem 4rem -2rem rgba(255, 255, 255, 0.05), inset 16rem 16rem 4rem -6rem rgba(0, 0, 0, 0.1), inset 16rem 16rem 4rem -2rem rgba(255, 255, 255, 0.1), 10rem 10rem 4rem rgba(255, 0, 255, 0.1);
  filter: contrast(1.1);
}
bubble, bubble:before, bubble:after {
  border-radius: 50%;
}
bubble:before {
  box-shadow: inset 2rem 0 5rem magenta, inset 0 -2rem 5rem yellow, inset 0 2rem 5rem blue, inset -2rem 0 5rem cyan;
  filter: contrast(1.5);
  opacity: 0.7;
}
bubble:after {
  box-shadow: inset -3rem -3rem 2rem rgba(0, 255, 170, 0.1), inset 0 0 1rem #00ffaa, inset 4rem 4rem 5rem rgba(0, 0, 0, 0.1);
  filter: blur(0.5rem);
  opacity: 0.9;
  background: radial-gradient(at 40% 40%, white, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0) 30%, r.........完整代码请登录后点击上方下载按钮下载查看

网友评论0