WebGL可调参数扭曲特效(黑洞 漩涡 鱼眼 玻璃球 )四种效果代码

代码语言:html

所属分类:动画

代码描述:WebGL可调参数扭曲特效(黑洞 漩涡 鱼眼 玻璃球 )四种效果代码

代码标签: WebGL 参数 扭曲 特效 黑洞 漩涡 鱼眼 玻璃球 四种 效果 代码

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

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

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

  
  
  
<style>
body {
  margin: 0;
  color: #fff;
  background-color: #000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  overflow: hidden;
}

input {
  display: none;
}

canvas {
  height: 100vh;
  width: auto;
}

#CTA {
  margin: .5em;
  position: absolute;
  pointer-events: none;
  top: 0;
  display: none;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-weight: bold;
  font-size: 30px;
  text-shadow: -5px -5px 5px #000;
  animation: fade 1s ease-in-out forwards 4s;
}

@keyframes fade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

#overlay {
  position: absolute;
  inset: 0%;
  display: flex;
  flex-direction: row;
  justify-content:space-around;
  pointer-events: none;
  transition: inset .5s ease-in-out;

  & > * {
    position: relative;
  }
}

#ghostCanvas {
  height: 100vmin;
  aspect-ratio: 1;
}

#circle, #distort {
  pointer-events: none;
  display: flex;
  width: -webkit-fill-available;
  width: -moz-available;
}

#circle {
  justify-content: space-evenly;

  & > * {
    place-items: center;
  }
}

#distort {
  flex-direction: column;
  justify-content: space-around;
  align-items: center;

  & label {
    pointer-events: all;
  }
}

.paramG {
  pointer-events: all;
  position: relative;
  height: 100vh;
  width: 50%;
  display: grid;
  grid-template-rows: 10vh 80vh 10vh;
  grid-template-columns: unset;
  transition: filter .5s ease-in-out;
}

.paramG.inactive {
  filter: saturate(0) brightness(.5);
  pointer-events: none;
}

.bar {
  position: relative;
  display: grid;
  justify-items: center;
  width: 66%;
  height: 80vh;
  --grad: transparent calc(50% - 2px), #fff 0 calc(50% + 2px), transparent 0;
  background: linear-gradient(90deg, var(--grad));
}

.slider {
  width: 100%;
  height: 0;
  position: absolute;
  display: grid;
  place-items: center;
  pointer-events: none;

  &::before {
    content: '';
    position: absolute;
    width: 30px;
    background: #fff;
    aspect-ratio: 1;
    border-radius: 50%;
    z-index: 3;
  }
}

.loIcon, .hiIcon {
  justify-self: center;
  position: relative;
  height: 100%;
  aspect-ratio: 1;
}

#loScale {
  scale: 33%;
  background: #480;
}.........完整代码请登录后点击上方下载按钮下载查看

网友评论0