Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 3.48 KB | None | 0 0
  1. /* TIMELINE
  2. –––––––––––––––––––––––––––––––––––––––––––––––––– */
  3.  
  4. .timeline {
  5.   white-space: nowrap;
  6.   overflow-x: hidden;
  7. }
  8.  
  9. .timeline ol {
  10.   font-size: 0;
  11.   width: 100vw;
  12.   padding: 250px 0;
  13.   transition: all 1s;
  14. }
  15.  
  16. .timeline ol li {
  17.   position: relative;
  18.   display: inline-block;
  19.   list-style-type: none;
  20.   width: 160px;
  21.   height: 3px;
  22.   background: #0007;
  23. }
  24.  
  25. .timeline ol li:last-child {
  26.   width: 280px;
  27. }
  28.  
  29. .timeline ol li:not(:first-child) {
  30.   margin-left: 14px;
  31. }
  32.  
  33. .timeline ol li:not(:last-child)::after {
  34.   content: '';
  35.   position: absolute;
  36.   top: 50%;
  37.   left: calc(100% + 1px);
  38.   bottom: 0;
  39.   width: 12px;
  40.   height: 12px;
  41.   transform: translateY(-50%);
  42.   border-radius: 50%;
  43.   background: #0007;
  44. }
  45.  
  46. .timeline ol li div {
  47.   position: absolute;
  48.   left: calc(100% + 7px);
  49.   width: 280px;
  50.   padding: 15px;
  51.   font-size: 1rem;
  52.   white-space: normal;
  53.   color: black;
  54.   background: white;
  55.   box-shadow: 0 10px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
  56. }
  57.  
  58. .timeline ol li div::before {
  59.   content: '';
  60.   position: absolute;
  61.   top: 100%;
  62.   left: 0;
  63.   width: 0;
  64.   height: 0;
  65.   border-style: solid;
  66. }
  67.  
  68. .timeline ol li:nth-child(odd) div {
  69.   top: -16px;
  70.   transform: translateY(-100%);
  71. }
  72.  
  73. .timeline ol li:nth-child(odd) div::before {
  74.   top: 100%;
  75.   border-width: 8px 8px 0 0;
  76.   border-color: white transparent transparent transparent;
  77. }
  78.  
  79. .timeline ol li:nth-child(even) div {
  80.   top: calc(100% + 16px);
  81. }
  82.  
  83. .timeline ol li:nth-child(even) div::before {
  84.   top: -8px;
  85.   border-width: 8px 0 0 8px;
  86.   border-color: transparent transparent transparent white;
  87. }
  88.  
  89. .timeline time {
  90.   display: block;
  91.   font-size: 1.2rem;
  92.   font-weight: bold;
  93.   margin-bottom: 8px;
  94. }
  95.  
  96.  
  97. /* TIMELINE ARROWS
  98. –––––––––––––––––––––––––––––––––––––––––––––––––– */
  99.  
  100. .timeline .arrows {
  101.   display: flex;
  102.   justify-content: center;
  103.   margin-bottom: 20px;
  104. }
  105.  
  106. .timeline .arrows .arrow__prev {
  107.   margin-right: 20px;
  108. }
  109.  
  110. .timeline .disabled {
  111.   opacity: .5;
  112. }
  113.  
  114. .timeline .arrows img {
  115.   width: 45px;
  116.   height: 45px;
  117. }
  118.  
  119.  
  120. /* GENERAL MEDIA QUERIES
  121. –––––––––––––––––––––––––––––––––––––––––––––––––– */
  122. @media screen and (max-width: 599px) {
  123.   .timeline ol,
  124.   .timeline ol li {
  125.     width: auto;
  126.   }
  127.  
  128.   .timeline ol {
  129.     padding: 0;
  130.     transform: none !important;
  131.   }
  132.  
  133.   .timeline ol li {
  134.     display: block;
  135.     height: auto;
  136.     background: transparent;
  137.   }
  138.  
  139.   .timeline ol li:first-child {
  140.     margin-top: 25px;
  141.   }
  142.  
  143.   .timeline ol li:not(:first-child) {
  144.     margin-left: auto;
  145.   }
  146.  
  147.   .timeline ol li div {
  148.     width: 94%;
  149.     height: auto !important;
  150.     margin: 0 auto 25px;
  151.   }
  152.  
  153.   .timeline ol li div {
  154.     position: static;
  155.   }
  156.  
  157.   .timeline ol li:nth-child(odd) div {
  158.     transform: none;
  159.   }
  160.  
  161.   .timeline ol li:nth-child(odd) div::before,
  162.   .timeline ol li:nth-child(even) div::before {
  163.     left: 50%;
  164.     top: 100%;
  165.     transform: translateX(-50%);
  166.     border: none;
  167.     border-left: 1px solid white;
  168.     height: 25px;
  169.   }
  170.  
  171.   .timeline ol li:last-child,
  172.   .timeline ol li:nth-last-child(2) div::before,
  173.   .timeline ol li:not(:last-child)::after,
  174.   .timeline .arrows {
  175.     display: none;
  176.   }
  177. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement