css实现两张图片blend上下混合融合调整效果代码

代码语言:html

所属分类:其他

代码描述:css实现两张图片blend上下混合融合调整效果代码

代码标签: css 两张 图片 blend 上下 混合 融合 调整

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


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

<head>

  <meta charset="UTF-8">

  
  
<style>
:root {
  --pct1: 33;
  --pct2: 66;
  --angle: 90;
}

body {
  display: grid;
  min-height: 100vh;
  place-content: center;
  padding: 2rem;
}

.s {
  position: relative;
  min-height: 40vh;
  min-width: 50vw;
  aspect-ratio: 3/2;
}
.s > * {
  position: absolute;
  inset: 0;
  background-size: cover;
}
.s .p1 {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/62954fe830e9e.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_400,h_300,/quality,q_90);
}
.s .p2 {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/6286f765e3931.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_400,h_300,/quality,q_90);
  -webkit-mask-image: linear-gradient(calc(var(--angle) * 1deg), transparent calc(var(--pct1) * 1%), #fff calc(var(--pct2) * 1%));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
</style>



</head>

<body >
  <h2>faded image blend</h2>
<div class="s">
  <div class="p1"></div>
  <div class="p2"></div>
</div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tweakpane.3.02.js"></script>
      <script  >
console.clear();

// tweakpane parameters
const minmax = { min: 0, max: 100, step: 1 };
c.........完整代码请登录后点击上方下载按钮下载查看

网友评论0