css实现立体磨砂透明文件夹效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现立体磨砂透明文件夹效果代码,当悬浮时,文件由抽出动画。

代码标签: css 立体 磨砂 透明 文件夹

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    @charset "UTF-8";
:root {
  --color-primary: #0e91eb;
  --color-secondary: #0a78eb;
  --color-tertiary: #deee75;
  --color-quaternary: #9375ee;
  --color-surface: #f5f5f5;
}

.folder {
  border-top: 0.4vmin solid rgba(255, 255, 255, 0.5);
  width: 50vmin;
  aspect-ratio: 1;
  border-radius: 12vmin;
  position: relative;
  overflow: hidden;
  background: var(--color-secondary);
  box-shadow: -1px 2px 0 2px color-mix(in srgb, var(--color-secondary), rgba(0, 0, 0, 0.2) 65%), -1px 2px 0 2px color-mix(in srgb, var(--color-secondary), rgba(0, 0, 0, 0.2) 65%), 0 3vmin 4vmin color-mix(in srgb, var(--color-secondary), rgba(0, 0, 0, 0.04) 80%);
}
.folder:after {
  border-radius: 1.5vmin;
  padding: 0 0.5vmin;
  line-height: 6vmin;
  content: "✿";
  -webkit-backdrop-filter: blur(0.2rem);
          backdrop-filter: blur(0.2rem);
  background-color: rgba(0, 0, 0, 0.14);
  z-index: 1111;
  position: absolute;
  left: 6vmin;
  bottom: 6vmin;
  font-size: 6vmin;
}
@media (hover) {
  .folder {
    cursor: pointer;
  }
  .folder:hover .doc {
    top: 7vmin;
  }
  .folder:hover .doc:before {
    transform: translateY(-1vmin) translateX(0.5vmin) rotate(15deg);
  }
  .folder:hover .doc:after {
    transform: translateY(-2vmin) translateY(-0.5vmin) rotate(-15deg);
  }
}

.dots {
  pointer-events: none;
  filter: url(#noise);
  position: absolute;
  inset: 0;
  border-radius: inherit;
  mix-blend-mode: screen;
  opacity: 0.16;
}

.scratches {
  pointer-events: none;
}
.scratches:before {
  filter: url(#noise);
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  mix-blend-mode: screen;
  opacity: 0.12;
  transform: rotate(55deg) scaleY(61.5);
}
.scratches:after {
  filter: url(#noise);
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  mix-blend-mode: screen;
  opacity: 0.15;
  transform: rotate(25deg) scaleY(111.5);
}

.fg {
  position: absolute;
  border-radius: 0 6vmin;
  bottom: -0.6vmin;
  left: 0;
  right: 0;
  aspect-ratio: 1/0.498;
}
.fg:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  --highlight-color: rgba(255, 255, 255, 0.4);
  --darken-color: color-mix(in srgb, var(--color-secondary), black 30%);
  background: radial-gradient(14vmin 0.7vmin at 30vmin 24.6vmin, var(--darken-color), transparent), radial-gradient(14vmin 0.7vmin at 10.3vmin 24.6vmin, var(--darken-color), transparent), radial-gradient(14vmin 0.7vmin at 45vmin 0, var(--highlight-color), transparent), radial-gradient(6vmin 2vmin at 50vmin 0, var(--highlight-color), transparent), color-mix(in srgb, var(--color-primary), rgba(255, 255, 255, 0.1) 70%);
  -webkit-backdrop-filter: blur(0.5rem);
          backdrop-filter: blur(0.5rem);
  --shadow-color: color-mix(in srgb, var(--color-secondary), black 10%);
  border-bottom: 0.25vmin solid color-mix(in srgb, var(--color-secondary), black 30%);
}

.fg-top {
  background: color-mix(in srgb, var(--color-primary), rgba(255, 255, 255, 0.1) 70%);
  -webkit-backdrop-filter: blur(0.5rem);
          backdrop-filter: blur(0.5rem);
  position: absolute;
  inset: 0;
  --size: 7vmin;
  height: var(--size);
  transform: translateY(calc(-1 * var(--size)));
  border-top: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 12vmin 0 0 0;
  width: 20vmin;
}

.fg-top-2 {
  position: absolute;
  left: 20vmin;
  top: -7vmin;
  width: 4vmin;
  border-radius: 0 12vmin 0 0;
  --size: 7vmin;
  height: var(--size);
  background: color-mix(in srgb, var(--color-primary), rgba(255, 255, 255, 0.1) 70%);
  -webkit-backdrop-filter: blur(0.5rem);
          backdrop-filter: blur(0.5rem);
  border-top: 3px solid rgba(255, 255, 255, 0.5);
  bottom: 0;
}

.fg-top-3 {
  position: absolute;
  left: 24vmin;
  width: 4vmin;
  top: -4vmin;
  border-radius: 0 12vmin 0 0;
  --size: 4vmin;
  height: var(--size);
  -w.........完整代码请登录后点击上方下载按钮下载查看

网友评论0