MENU

CSS 文件夹悬停交互效果,鼠标悬停

• October 23, 2020 • 技术教程,信息互联,WEB#

HTML

<div class="folder">
  <div class="folder__back">
    <div class="paper"></div>
    <div class="paper"></div>
    <div class="paper"></div>
    <div class="folder__front"></div>
    <div class="folder__front right"></div>
  </div>
</div>

CSS

body{
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  background: #1f1f1f;
  display: flex;
  justify-content: center;
  align-items: center;
}

.folder {
  transition: all 0.2s ease-in;
}
.folder__back {
  position: relative;
  width: 100px;
  height: 80px;
  background: #4786ff;
  border-radius: 0px 5px 5px 5px;
}
.folder__back::after {
  position: absolute;
  bottom: 98%;
  left: 0;
  content: "";
  width: 30px;
  height: 10px;
  background: #4786ff;
  border-radius: 5px 5px 0 0;
}
.folder__back .paper {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translate(-50%, 10%);
  width: 70%;
  height: 80%;
  background: #e6e6e6;
  border-radius: 5px;
  transition: all 0.3s ease-in-out;
}
.folder__back .paper:nth-child(2) {
  background: #f2f2f2;
  width: 80%;
  height: 70%;
}
.folder__back .paper:nth-child(3) {
  background: white;
  width: 90%;
  height: 60%;
}
.folder__back .folder__front {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #70a1ff;
  border-radius: 5px;
  transform-origin: bottom;
  transition: all 0.3s ease-in-out;
}
.folder:hover {
  transform: translateY(-8px);
}
.folder:hover .paper {
  transform: translate(-50%, 0%);
}
.folder:hover .folder__front {
  transform: skew(15deg) scaleY(0.6);
}
.folder:hover .right {
  transform: skew(-15deg) scaleY(0.6);
}

原文链接

- - - The END - - -
  • 文章标题:CSS 文件夹悬停交互效果,鼠标悬停
  • 文章链接:http://blog.uiuweb.cn/index.php/archives/12203.html
  • 版权所有:本文版权归 刘一彪 所有,转载请注明出处!除特殊注明外 (如有侵权,请 点此联系我 )
  • Archives QR Code Tip
    QR Code for this page
    Tipping QR Code