hammer.js实现自适应响应式时间线大事记效果代码

代码语言:html

所属分类:响应式

代码描述:hammer.js实现自适应响应式时间线大事记效果代码

代码标签: hammer.js 自适应 响应式 时间线 大事记

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

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

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

    <style>
        *,
        *::before,
        *::after {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
        }
        
        button {
          background: transparent;
          border: none;
          cursor: pointer;
          outline: none;
        }
        
        body {
          font: normal 16px/1.5 "Helvetica Neue", sans-serif;
          background: #456990;
          color: #fff;
        }
        
        
        /* .section SECTION
        –––––––––––––––––––––––––––––––––––––––––––––––––– */
        
        .section {
          background: #F45B69;
          padding: 50px 0;
        }
        
        .section .container {
          width: 90%;
          max-width: 1200px;
          margin: 0 auto;
          text-align: center;
        }
        
        .section h1 {
          font-size: 2.5rem;
        }
        
        .section h2 {
          font-size: 1.3rem;
        }
        
        
        /* TIMELINE
        –––––––––––––––––––––––––––––––––––––––––––––––––– */
        
        .timeline {
          white-space: nowrap;
          overflow-x: hidden;
        }
        
        .timeline ol {
          font-size: 0;
          width: 100vw;
          padding: 250px 0;
          transition: all 1s;
        }
        
        .timeline ol li {
          position: relative;
          display: inline-block;
          list-style-type: none;
          width: 160px;
          height: 3px;
          background: #fff;
        }
        
        .timeline ol li:last-child {
          width: 280px;
        }
        
        .timeline ol li:not(:first-child) {
          margin-left: 14px;
        }
        
        .timeline ol li:not(:last-child)::after {
          content: '';
          position: absolute;
          top: 50%;
          left: calc(100% + 1px);
          bottom: 0;
          width: 12px;
          height: 12px;
          transform: translateY(-50%);
          border-radius: 50%;
          background: #F45B69;
        }
        
        .timeline ol li div {
          position: absolute;
          left: calc(100% + 7px);
          width: 280px;
          padding: 15px;
          font-size: 1rem;
          white-space: normal;
          color: black;
          background: white;
        }
        
        .timeline .........完整代码请登录后点击上方下载按钮下载查看

网友评论0