css+svg实现熔岩灯动画效果代码

代码语言:html

所属分类:动画

代码描述:css+svg实现熔岩灯动画效果代码

代码标签: css svg 熔岩灯

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

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

<head>

  <meta charset="UTF-8">

  
  
  
<style>
:root {
  --height: 400px;
  --drop-color: #3ee02e;
  --lamp-color: #34a4d296;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(50vh 100vh ellipse, #037b03dd, #000 60%);
  overflow: hidden;
}

.lamp {
  height: var(--height);
  width: calc(var(--height) * 0.45);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lamp .top {
  height: 15%;
  width: 50%;
  background: linear-gradient(90deg, #bebebe 15%, #fdfdfd 30%, #bebebe 40%, #878787 48% 52%, #bebebe 58%, #fdfdfd 65% 70%, #bebebe 80%);
  border-radius: 50% 50% 10% 10%/15% 15% 3% 3%;
  -webkit-clip-path: polygon(7% 0%, 93% 0%, 100% 100%, 0% 100%);
          clip-path: polygon(7% 0%, 93% 0%, 100% 100%, 0% 100%);
}
.lamp .center {
  height: 53%;
  width: 70%;
  background: linear-gradient(#0003 10%, #0000 30% 95%, #fff3 100%), linear-gradient(90deg, #0000 20%, #fff5 50%, #0000 80%), radial-gradient(calc(var(--height) * 0.21) calc(var(--height) * 0.48) at center 35%, #0000 60%, #fff4 90%) var(--lamp-color);
  position: relativ.........完整代码请登录后点击上方下载按钮下载查看

网友评论0