_timeline.scss 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. .timeline {
  2. -webkit-box-sizing: border-box;
  3. box-sizing: border-box;
  4. position: relative;
  5. *,
  6. :after,
  7. :before {
  8. -webkit-box-sizing: inherit;
  9. box-sizing: inherit;
  10. }
  11. &:not(.timeline--horizontal):before {
  12. background-color: #d1d4e4;
  13. inset-block-end: 0;
  14. content: "";
  15. inset-inline-start: 50%;
  16. margin-inline-start: -2px;
  17. position: absolute;
  18. inset-block-start: 0;
  19. width: 4px;
  20. z-index: 1;
  21. }
  22. }
  23. .timeline__wrap {
  24. overflow: hidden;
  25. position: relative;
  26. z-index: 1;
  27. }
  28. .timeline__item {
  29. font-size: 16px;
  30. font-size: 1rem;
  31. padding: 0.625rem 2.5rem 0.625rem 0;
  32. position: relative;
  33. width: 50%;
  34. z-index: 1;
  35. &:after {
  36. background-color: #fff;
  37. border: 4px solid #d1d4e4;
  38. border-radius: 50%;
  39. content: "";
  40. height: 20px;
  41. position: absolute;
  42. inset-inline-end: -10px;
  43. -webkit-transform: translateY(-50%);
  44. -ms-transform: translateY(-50%);
  45. transform: translateY(-50%);
  46. inset-block-start: 50%;
  47. width: 20px;
  48. z-index: 1;
  49. }
  50. &.animated {
  51. -webkit-animation-duration: 1s;
  52. animation-duration: 1s;
  53. -webkit-animation-fill-mode: both;
  54. animation-fill-mode: both;
  55. opacity: 0;
  56. }
  57. &.fadeIn {
  58. -webkit-animation-name: fadeIn;
  59. animation-name: fadeIn;
  60. }
  61. }
  62. .timeline__item--left {
  63. inset-inline-start: 0;
  64. }
  65. .timeline__item--right {
  66. inset-inline-start: 50%;
  67. padding: 0.625rem 0 0.625rem 2.5rem;
  68. &:after {
  69. inset-inline-start: -10px;
  70. }
  71. .timeline__content {
  72. &:before {
  73. border-block-end: 10px solid transparent;
  74. border-inline-end: 12px solid #e1e6f1;
  75. border-inline-start: none;
  76. border-block-start: 10px solid transparent;
  77. inset-inline-start: -12px;
  78. }
  79. &:after {
  80. border-block-end: 9px solid transparent;
  81. border-inline-end: 11px solid #fff;
  82. border-inline-start: none;
  83. border-block-start: 9px solid transparent;
  84. inset-inline-start: -10px;
  85. }
  86. }
  87. }
  88. .timeline__content {
  89. background-color: #fff;
  90. border-radius: 0px;
  91. color: #334151;
  92. border: 1px solid #e1e6f1;
  93. display: block;
  94. padding: 1.25rem;
  95. position: relative;
  96. box-shadow: 0 8px 16px 0 rgba(162, 169, 204, 0.24);
  97. &:after {
  98. content: "";
  99. height: 0;
  100. position: absolute;
  101. -webkit-transform: translateY(-50%);
  102. -ms-transform: translateY(-50%);
  103. transform: translateY(-50%);
  104. inset-block-start: 50%;
  105. width: 0;
  106. }
  107. &:before {
  108. content: "";
  109. height: 0;
  110. position: absolute;
  111. -webkit-transform: translateY(-50%);
  112. -ms-transform: translateY(-50%);
  113. transform: translateY(-50%);
  114. inset-block-start: 50%;
  115. width: 0;
  116. border-block-end: 10px solid transparent;
  117. border-inline-start: 12px solid #e1e6f1;
  118. border-block-start: 10px solid transparent;
  119. inset-inline-end: -12px;
  120. z-index: 1;
  121. }
  122. &:after {
  123. border-block-end: 9px solid transparent;
  124. border-inline-start: 11px solid #fff;
  125. border-block-start: 9px solid transparent;
  126. inset-inline-end: -10px;
  127. z-index: 2;
  128. }
  129. h2 {
  130. font-size: 1rem;
  131. font-weight: 700;
  132. margin: 0 0 0.625rem;
  133. }
  134. p {
  135. font-size: 14px;
  136. line-height: 1.5;
  137. margin-block-end: 10px;
  138. }
  139. }
  140. .timeline--horizontal {
  141. white-space: nowrap;
  142. .timeline-divider {
  143. background-color: #d1d4e4;
  144. display: block;
  145. height: 4px;
  146. inset-inline-start: 40px;
  147. position: absolute;
  148. -webkit-transform: translateY(-50%);
  149. -ms-transform: translateY(-50%);
  150. transform: translateY(-50%);
  151. inset-inline-end: 40px;
  152. z-index: 0;
  153. }
  154. .timeline__items {
  155. -webkit-transition: all 0.8s;
  156. -o-transition: all 0.8s;
  157. transition: all 0.8s;
  158. will-change: transform;
  159. }
  160. .timeline__item {
  161. display: inline-block;
  162. inset-inline-start: 0;
  163. padding: 0 0 2.5rem;
  164. position: relative;
  165. -webkit-transition: none;
  166. -o-transition: none;
  167. transition: none;
  168. vertical-align: top;
  169. white-space: normal;
  170. &:after {
  171. inset-inline-start: 50%;
  172. inset-inline-end: auto;
  173. -webkit-transform: translate(-50%, -50%);
  174. -ms-transform: translate(-50%, -50%);
  175. transform: translate(-50%, -50%);
  176. inset-block-start: 100%;
  177. }
  178. .timeline__item__inner {
  179. display: table;
  180. height: 100%;
  181. width: 100%;
  182. }
  183. .timeline__content__wrap {
  184. display: table-cell;
  185. margin: 0;
  186. padding: 0;
  187. vertical-align: bottom;
  188. }
  189. .timeline__content {
  190. &:before {
  191. border-inline-start: 12px solid transparent;
  192. border-inline-end: 12px solid transparent;
  193. border-block-start: 12px solid #e1e6f1;
  194. inset-inline-start: 50%;
  195. inset-inline-end: auto;
  196. -webkit-transform: translateX(-50%);
  197. -ms-transform: translateX(-50%);
  198. transform: translateX(-50%);
  199. inset-block-start: 100%;
  200. }
  201. &:after {
  202. border-inline-start: 10px solid transparent;
  203. border-inline-end: 10px solid transparent;
  204. border-block-start: 10px solid #fff;
  205. inset-inline-start: 50%;
  206. inset-inline-end: auto;
  207. -webkit-transform: translateX(-50%);
  208. -ms-transform: translateX(-50%);
  209. transform: translateX(-50%);
  210. inset-block-start: 100%;
  211. }
  212. }
  213. }
  214. .timeline__item--bottom {
  215. padding: 2.5rem 0 0;
  216. &:after {
  217. inset-block-start: 0;
  218. }
  219. .timeline__content__wrap {
  220. vertical-align: top;
  221. }
  222. .timeline__content {
  223. &:before {
  224. border-block-end: 12px solid #e1e6f1;
  225. border-inline-start: 12px solid transparent;
  226. border-inline-end: 12px solid transparent;
  227. border-block-start: none;
  228. inset-block-end: 100%;
  229. inset-block-start: auto;
  230. }
  231. &:after {
  232. border-block-end: 10px solid #fff;
  233. border-inline-start: 10px solid transparent;
  234. border-inline-end: 10px solid transparent;
  235. border-block-start: none;
  236. inset-block-end: 100%;
  237. inset-block-start: auto;
  238. }
  239. }
  240. }
  241. }
  242. .timeline-nav-button {
  243. background-color: #fff;
  244. border: 1px solid #e1e6f1;
  245. border-radius: 50px;
  246. -webkit-box-sizing: border-box;
  247. box-sizing: border-box;
  248. -webkit-box-shadow: none;
  249. box-shadow: none;
  250. cursor: pointer;
  251. display: block;
  252. height: 40px;
  253. outline: 0;
  254. position: absolute;
  255. text-indent: -9999px;
  256. -webkit-transform: translateY(-50%);
  257. -ms-transform: translateY(-50%);
  258. transform: translateY(-50%);
  259. inset-block-start: 50%;
  260. width: 40px;
  261. z-index: 10;
  262. &:disabled {
  263. opacity: 0.5;
  264. pointer-events: none;
  265. }
  266. &:before {
  267. background-position: center center;
  268. background-repeat: no-repeat;
  269. content: "";
  270. display: block;
  271. height: 14px;
  272. inset-inline-start: 50%;
  273. position: absolute;
  274. -webkit-transform: translateX(-50%) translateY(-50%);
  275. -ms-transform: translateX(-50%) translateY(-50%);
  276. transform: translateX(-50%) translateY(-50%);
  277. inset-block-start: 50%;
  278. width: 8px;
  279. }
  280. }
  281. .timeline-nav-button--prev {
  282. inset-inline-start: 0;
  283. &:before {
  284. background-image: url(../plugins/timeline/images/arrow-left.svg);
  285. }
  286. }
  287. .timeline-nav-button--next {
  288. inset-inline-end: 0;
  289. &:before {
  290. background-image: url(../plugins/timeline/images/arrow-right.svg);
  291. }
  292. }
  293. .timeline--mobile {
  294. padding: 0;
  295. &:before {
  296. inset-inline-start: 10px !important;
  297. margin: 0 !important;
  298. }
  299. .timeline__item {
  300. inset-inline-start: 0;
  301. padding-inline-start: 40px;
  302. padding-inline-end: 0;
  303. width: 100%;
  304. &:after {
  305. inset-inline-start: 2px;
  306. margin: 0;
  307. }
  308. .timeline__content {
  309. &:before {
  310. inset-inline-start: -12px;
  311. border-block-end: 12px solid transparent;
  312. border-inline-end: 12px solid #e1e6f1;
  313. border-inline-start: none;
  314. border-block-start: 12px solid transparent;
  315. }
  316. &:after {
  317. inset-inline-start: -10px;
  318. border-block-end: 10px solid transparent;
  319. border-inline-end: 10px solid #fff;
  320. border-inline-start: none;
  321. border-block-start: 10px solid transparent;
  322. }
  323. }
  324. }
  325. }
  326. @-webkit-keyframes fadeIn {
  327. 0% {
  328. opacity: 0;
  329. inset-block-start: 70px;
  330. }
  331. 100% {
  332. opacity: 1;
  333. inset-block-start: 0;
  334. }
  335. }
  336. @keyframes fadeIn {
  337. 0% {
  338. opacity: 0;
  339. inset-block-start: 70px;
  340. }
  341. 100% {
  342. opacity: 1;
  343. inset-block-start: 0;
  344. }
  345. }
  346. @-webkit-keyframes liftUp {
  347. 0% {
  348. inset-block-start: 0;
  349. }
  350. 100% {
  351. inset-block-start: -15px;
  352. }
  353. }
  354. @keyframes liftUp {
  355. 0% {
  356. inset-block-start: 0;
  357. }
  358. 100% {
  359. inset-block-start: -15px;
  360. }
  361. }
  362. .timeline--horizontal .timeline__item:nth-child(even):after {
  363. inset-block-start: 0;
  364. }