css+div实现书本鼠标悬浮三维翻转显示文字效果代码

代码语言:html

所属分类:悬停

代码描述:css+div实现书本鼠标悬浮三维翻转显示文字效果代码

代码标签: css div 书本 鼠标 悬浮 三维 翻转 显示 文字

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

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

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

    <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;1,300&amp;family=Quicksand:wght@500&amp;display=swap'>
    <style>
        * {
      border: 0;
      margin: 0;
      box-sizing: border-box;
    }
    
    :root {
      --mobile-width: 325px;
      --mobile-height: 670px;
      --mobile-radius: 25px;
      --separator-height: 500px;
      --bg: #fdf3f2;
      --mobile-bg: #fdeae6;
      --intro-bg: #eed7d1;
      --font-color: #807b7b;
      --transition: transform 0.7s ease-in-out;
    }
    
    .container {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background-color: var(--bg);
    }
    
    .info {
      font-family: "Quicksand", sans-serif;
      font-family: "Open Sans", sans-serif;
      font-style: italic;
      font-size: 26px;
      margin-top: 10px;
      color: var(--font-color);
    }
    
    .mobile-layout {
      width: var(--mobile-width);
      height: var(--mobile-height);
      margin: 30px 0;
      border-radius: var(--mobile-radius);
      perspective: 500px;
      overflow: hidden;
      color: var(--font-color);
      background-color: var(--mobile-bg);
      box-shadow: 36px 36px 50px 15px #eed7d1d1;
    }
    .mobile-layout .notification-header {
      position: fixed;
      top: 5px;
      width: 100%;
      padding: 5px 15px;
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      font-family: "Open Sans", sans-serif;
      font-weight: bold;
      z-index: 6;
    }
    .mobile-layout .actions {
      position: fixed;
      top: 37px;
      width: 100%;
      padding: 50px;
      display: flex;
      justify-content: space-between;
      font-size: 20px;
      z-index: 6;
    }
    .mobile-layout .book-cover {
      position: relative;
      height: var(--separator-height);
      width: calc(var(--mobile-width) * 2);
      left: -52.5%;
      border-top-left-radius: var(--mobile-radius);
      border-top-right-radius: var(--mobile-radius);
      background-color: var(--intro-bg);
      transform-style: preserve-3d;
      transform-origin: 50% 40%;
      transition: var(--transition);
      z-index: 4;
    }
    .mobile-layout .book-top {
      width: 170px;
      position: absolute;
      top: 180px;
      left: 250px;
      z-index: 5;
      transform: translateZ(28.5px);
    }
    .mobile-layout .book-side {
      position: absolute;
      top: 430px;
      left: 222px;
      transform: translateY(-15px) translateX(0px) translateZ(15px) rotateX(104deg);
    }
    .mobile-layout .book-cover:hover {
      transform: rotateX(75deg) translateZ(3px) scale(0.75);
    }
    .mobile-layout .book-cover:hover + .preface {
      transform: translateY(-302px);
    }
    .mobile-layout .book-cover:hover + .preface .icon {
      transform: rotateX(180deg);
    }
    .mobile-layout .preface {
      height: var(--separator-height);
      padding: 50px;
      transition: var(--transition);
      background: white;
    }
    .mobile-layout .preface .header {
      display: flex;
      align-items: ce.........完整代码请登录后点击上方下载按钮下载查看

网友评论0