div+css实现手风琴式鼠标悬浮图文伸缩效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现手风琴式鼠标悬浮图文伸缩效果代码

代码标签: div css 手风琴 鼠标 悬浮 图文 伸缩

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

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

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

  
  
<style>
:root {
  --color-1:#283242;
  --color-2:#ffdd40;
  --color-3:#131417;
}

::-webkit-scrollbar {
  width: 6px;
  background-color: var(--color-1);
}

::-webkit-scrollbar-button {
  background-color: var(--color-1);
}

::-webkit-scrollbar-thumb {
  height: 50px;
  background-color: var(--color-2);
}

html, body {
  background-image: url("data:image/svg+xml,<svg id='patternId' width='100%' height='100%' xmlns='http://www.w3.org/2000/svg'><defs><pattern id='a' patternUnits='userSpaceOnUse' width='69.283' height='40' patternTransform='scale(2) rotate(0)'><rect x='0' y='0' width='100%' height='100%' fill='hsla(225, 10%, 8%, 1)'/><path d='M46.189-20L57.736 0M46.189 20l11.547 20m-46.189 0l11.547 20M11.547 0l11.547 20m40.415 30H40.415M28.868 30H5.774m23.094-40H5.774m57.735 20H40.415m0 20L28.868 50m11.547-60L28.868 10m46.188 0L63.509 30M5.774 10L-5.773 30m75.056 10H46.189L34.64 20 46.19 0h23.094C73.13 6.667 76.98 13.333 80.83 20zM57.736 60H34.64L23.094 40l11.547-20h23.095c3.848 6.667 7.698 13.333 11.547 20L57.736 60zm0-40H34.64L23.094 0l11.547-20h23.095L69.283 0c-3.87 6.7-8.118 14.06-11.547 20zM34.64 60H11.547L0 40l11.547-20h23.094L46.19 40 34.64 60zm0-40H11.547L0 0l11.547-20h23.094L46.19 0 34.64 20zM23.094 40H0l-5.773-10-5.774-10L0 0h23.094l11.547 20-11.547 20z'  stroke-width='1' stroke='hsla(225, 5%, 10%, 1)' fill='none'/></pattern></defs><rect width='800%' height='800%' transform='translate(0,0)' fill='url(%23a)'/></svg>");
  user-select: none;
  font-family:sans-serif;
}

h1 {
  position: relative;
  font-family: "Khand", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
  color: #eee;
  color: #ffdd40;
}

.container {
  padding: 3rem 0;
  margin: 0 auto;
  width: 80vw;
}

.gallery-wrap {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 70vh;
  border-radius: 2rem;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0);
}

.item {
  flex: 1;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: none;
  overflow: hidden;
  mix-blend-mode: screen;
  filter: grayscale(1) saturate(0) brightness(90%) contrast(150%);
  transition: flex 0.4s cubic-bezier(0.32, 0.79, 0.38, 0.99), filter 0.5s ease-in;
}
.item:hover {
  flex: 7;
  filter: grayscale(0) saturate(1.3) blur(0px);
}
.item:hover .caption {
  opacity: 1;
}
.item:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  #background: radial-gradient(circle closest-side, #333 1px, transparent 1px);
  background-size: 8px 8px;
  filter: contrast(500%);
  transition: opacity 0.2s ease;
  opacity: 0.3;
  pointer-events: none;
}
.item:hover:before {
  opacity: 0;
}

.caption {
  position: fixed;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0;
  margin: 1rem;
  padding: 1rem;
  color: #eee;
  border:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0