common.css 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. *,
  2. *::after,
  3. *::before {
  4. box-sizing: border-box;
  5. }
  6. body {
  7. font-family: 'Playfair Display', serif;
  8. color: #3f3f45;
  9. background: #f0f0f3;
  10. transition: background-color 0.8s;
  11. -webkit-font-smoothing: antialiased;
  12. -moz-osx-font-smoothing: grayscale;
  13. }
  14. a {
  15. color: #777785;
  16. outline: none;
  17. display: inline-block;
  18. position: relative;
  19. text-decoration: none;
  20. -webkit-transition: color 0.2s;
  21. transition: color 0.2s;
  22. }
  23. a.link::after {
  24. content: '';
  25. position: absolute;
  26. top: 105%;
  27. width: 100%;
  28. border-bottom: 2px solid;
  29. left: 0;
  30. -webkit-transition: opacity 0.2s, -webkit-transform 0.2s;
  31. transition: opacity 0.2s, -webkit-transform 0.2s;
  32. }
  33. a.link:hover::after {
  34. opacity: 0;
  35. -webkit-transform: translate3d(0,3px,0);
  36. transform: translate3d(0,3px,0);
  37. }
  38. a:hover,
  39. a:focus {
  40. text-decoration: none;
  41. color: #3f3f45;
  42. }
  43. main {
  44. position: relative;
  45. display: -webkit-flex;
  46. display: -ms-flexbox;
  47. display: flex;
  48. -webkit-flex-direction: column;
  49. -ms-flex-direction: column;
  50. flex-direction: column;
  51. overflow-x: hidden;
  52. width: 100vw;
  53. height: 100vh;
  54. }
  55. .hidden {
  56. position: absolute;
  57. overflow: hidden;
  58. width: 0;
  59. height: 0;
  60. pointer-events: none;
  61. }
  62. /* Icons */
  63. .icon {
  64. display: block;
  65. width: 1.5em;
  66. height: 1.5em;
  67. margin: 0 auto;
  68. fill: currentColor;
  69. }
  70. /* Header */
  71. .codrops-header {
  72. position: relative;
  73. z-index: 1000;
  74. display: -webkit-flex;
  75. display: -ms-flexbox;
  76. display: flex;
  77. -webkit-flex-direction: row;
  78. -ms-flex-direction: row;
  79. flex-direction: row;
  80. -webkit-flex-wrap: wrap;
  81. -ms-flex-wrap: wrap;
  82. flex-wrap: wrap;
  83. -webkit-justify-content: space-between;
  84. -ms-flex-pack: justify;
  85. justify-content: space-between;
  86. -webkit-align-items: center;
  87. -ms-flex-align: center;
  88. align-items: center;
  89. -webkit-flex: none;
  90. -ms-flex: none;
  91. flex: none;
  92. width: 100%;
  93. padding: 0.5em 1.25em 0.5em 0.75em;
  94. background: #fff;
  95. }
  96. .codrops-header__main {
  97. display: -webkit-flex;
  98. display: -ms-flexbox;
  99. display: flex;
  100. -webkit-flex-direction: row;
  101. -ms-flex-direction: row;
  102. flex-direction: row;
  103. -webkit-flex-wrap: wrap;
  104. -ms-flex-wrap: wrap;
  105. flex-wrap: wrap;
  106. -webkit-align-items: center;
  107. -ms-flex-align: center;
  108. align-items: center;
  109. }
  110. .codrops-header__title {
  111. font-size: 1.5em;
  112. font-weight: 700;
  113. margin: 0;
  114. line-height: 0.8;
  115. padding: 0 0 0.1em 0;
  116. }
  117. .codrops-header__tagline {
  118. font-family: 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, sans-serif;
  119. padding: 0 0.5em 0 5vw;
  120. margin: 0 auto 0 0;
  121. }
  122. /* Top Navigation Style */
  123. .codrops-links {
  124. position: relative;
  125. display: -webkit-flex;
  126. display: -ms-flexbox;
  127. display: flex;
  128. -webkit-justify-content: center;
  129. -ms-flex-pack: center;
  130. justify-content: center;
  131. text-align: center;
  132. white-space: nowrap;
  133. }
  134. .codrops-links::after {
  135. content: '';
  136. position: absolute;
  137. top: 15%;
  138. left: 50%;
  139. width: 2px;
  140. height: 70%;
  141. opacity: 0.7;
  142. background: rgba(0, 0, 0, 0.25);
  143. -webkit-transform: rotate3d(0, 0, 1, 22.5deg);
  144. transform: rotate3d(0, 0, 1, 22.5deg);
  145. }
  146. .codrops-icon {
  147. display: inline-block;
  148. margin: 0.5em;
  149. padding: 0.5em;
  150. }
  151. /* Demo links */
  152. .codrops-demos {
  153. margin: 0.25em 0;
  154. padding: 0 1em;
  155. font-weight: bold;
  156. }
  157. .codrops-demos a {
  158. display: inline-block;
  159. margin: 0 0.5em 0 0;
  160. }
  161. .codrops-demos a.current-demo {
  162. color: #333;
  163. }
  164. .codrops-demos a.current-demo::after {
  165. display: none;
  166. }
  167. /* Calendar */
  168. .calendar-wrap {
  169. position: relative;
  170. }
  171. .js .calendar-wrap {
  172. -webkit-flex: 1;
  173. -ms-flex: 1;
  174. flex: 1;
  175. }
  176. .calendar {
  177. position: relative;
  178. width: 100%;
  179. height: 100%;
  180. margin: 0 auto;
  181. overflow: hidden;
  182. /* we always want 7 boxes in a row */
  183. padding: 3em calc((100vw - (7 * (7vw + 1vw)))/2);
  184. }
  185. .js .calendar {
  186. position: absolute;
  187. -webkit-perspective: 1000px;
  188. perspective: 1000px;
  189. padding: 0 calc((100vw - (7 * (7vw + 1vw)))/2) 5em;
  190. }
  191. .no-js .calendar {
  192. display: -webkit-flex;
  193. display: -ms-flexbox;
  194. display: flex;
  195. -webkit-flex-wrap: wrap;
  196. -ms-flex-wrap: wrap;
  197. flex-wrap: wrap;
  198. -webkit-align-content: center;
  199. -ms-flex-line-pack: center;
  200. align-content: center;
  201. -webkit-align-items: center;
  202. -ms-flex-align: center;
  203. align-items: center;
  204. }
  205. /* Cubes container */
  206. .cubes {
  207. display: -webkit-flex;
  208. display: -ms-flexbox;
  209. display: flex;
  210. -webkit-flex-wrap: wrap;
  211. -ms-flex-wrap: wrap;
  212. flex-wrap: wrap;
  213. -webkit-align-content: center;
  214. -ms-flex-line-pack: center;
  215. align-content: center;
  216. -webkit-align-items: center;
  217. -ms-flex-align: center;
  218. align-items: center;
  219. width: 100%;
  220. height: 100%;
  221. -webkit-transform-style: preserve-3d;
  222. transform-style: preserve-3d;
  223. }
  224. /* Single cube */
  225. .cube {
  226. position: relative;
  227. display: block;
  228. -webkit-flex: none;
  229. -ms-flex: none;
  230. flex: none;
  231. width: 7vw;
  232. height: 7vw;
  233. margin: 0.5vw;
  234. }
  235. .js .cube {
  236. -webkit-flex: auto;
  237. -ms-flex: auto;
  238. flex: auto;
  239. -webkit-transform-style: preserve-3d;
  240. transform-style: preserve-3d;
  241. }
  242. /* push to the right weekday (we have to push 3 boxes) */
  243. .js .cube:first-child {
  244. margin-left: calc(((7vw + 1vw) * 3) + 0.5vw);
  245. }
  246. .js .cube:not(.cube--inactive) {
  247. cursor: pointer;
  248. }
  249. /* cube sides and rotations */
  250. .cube__side {
  251. position: absolute;
  252. top: 0;
  253. left: 0;
  254. width: inherit;
  255. height: inherit;
  256. -webkit-backface-visibility: hidden;
  257. backface-visibility: hidden;
  258. }
  259. .cube__side--front {
  260. position: relative;
  261. -webkit-transform: translateZ(3.5vw);
  262. transform: translateZ(3.5vw);
  263. }
  264. .cube__side--back {
  265. -webkit-transform: rotateY(180deg) translateZ(3.5vw);
  266. transform: rotateY(180deg) translateZ(3.5vw);
  267. }
  268. .cube__side--right {
  269. -webkit-transform: rotateY(90deg) translateZ(3.5vw);
  270. transform: rotateY(90deg) translateZ(3.5vw);
  271. }
  272. .cube__side--left {
  273. -webkit-transform: rotateY(-90deg) translateZ(3.5vw);
  274. transform: rotateY(-90deg) translateZ(3.5vw);
  275. }
  276. .cube__side--top {
  277. -webkit-transform: rotateX(90deg) translateZ(3.5vw);
  278. transform: rotateX(90deg) translateZ(3.5vw);
  279. }
  280. .cube__side--bottom {
  281. -webkit-transform: rotateX(-90deg) translateZ(3.5vw);
  282. transform: rotateX(-90deg) translateZ(3.5vw);
  283. }
  284. /* Cube counters and numbers */
  285. /* Without JS we want an auto counter */
  286. .no-js .calendar {
  287. counter-reset: boxes-counter;
  288. }
  289. .no-js .cube {
  290. counter-increment: boxes-counter;
  291. }
  292. .no-js .cube::after {
  293. content: counter(boxes-counter);
  294. }
  295. .cube__number,
  296. .no-js .cube::after {
  297. position: absolute;
  298. right: 0;
  299. bottom: 0;
  300. }
  301. /* canvas for snow */
  302. .background {
  303. position: absolute;
  304. top: 0;
  305. left: 0;
  306. width: 100%;
  307. height: 100%;
  308. min-height: 100vh;
  309. transition: background-color 0.8s;
  310. }
  311. /* title that appears on hover */
  312. .title {
  313. font-size: 3.25vw;
  314. font-weight: 700;
  315. position: absolute;
  316. right: 3vw;
  317. bottom: 3vw;
  318. margin: 0;
  319. white-space: nowrap;
  320. pointer-events: none;
  321. opacity: 0;
  322. }
  323. /* number before title */
  324. .title::before {
  325. content: attr(data-number);
  326. display: inline-block;
  327. margin-right: 0.5em;
  328. color: white;
  329. }
  330. /* letter span for animations */
  331. [class*='letter'] {
  332. position: relative;
  333. display: inline-block;
  334. white-space: pre;
  335. }
  336. [class*='letter']:blank {
  337. padding-right: 10em;
  338. }
  339. /* content wrap */
  340. .content {
  341. position: relative;
  342. }
  343. .js .content {
  344. position: absolute;
  345. top: 0;
  346. left: 0;
  347. overflow: hidden;
  348. width: 100%;
  349. height: 100%;
  350. pointer-events: none;
  351. }
  352. /* individual content block */
  353. .content__block {
  354. padding: 10vh 5vw;
  355. }
  356. .js .content__block {
  357. padding: 20vh 5vw;
  358. position: absolute;
  359. z-index: 100;
  360. display: -webkit-flex;
  361. display: -ms-flexbox;
  362. display: flex;
  363. -webkit-flex-direction: column;
  364. -ms-flex-direction: column;
  365. flex-direction: column;
  366. -webkit-justify-content: center;
  367. -ms-flex-pack: center;
  368. justify-content: center;
  369. width: 85%;
  370. height: 100%;
  371. padding: 3em 0 6em 7vw;
  372. -webkit-user-select: none;
  373. -moz-user-select: none;
  374. -ms-user-select: none;
  375. user-select: none;
  376. -webkit-touch-callout: none;
  377. -khtml-user-select: none;
  378. }
  379. .content__title {
  380. font-size: 7vw;
  381. line-height: 0.85;
  382. margin: 0;
  383. }
  384. .content__description {
  385. font-size: 2.25vw;
  386. margin: 1em 0;
  387. padding: 0 0 0 5vw;
  388. }
  389. .content__meta {
  390. font-family: 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, sans-serif;
  391. margin: 0;
  392. padding: 0 0 0 2vw;
  393. }
  394. .content__meta::before {
  395. content: '\2014';
  396. }
  397. .content__number {
  398. position: absolute;
  399. }
  400. .btn-back {
  401. font-size: 2em;
  402. line-height: 2;
  403. position: absolute;
  404. z-index: 100;
  405. right: 0;
  406. bottom: 0;
  407. width: 2em;
  408. margin: 0;
  409. margin: 1em;
  410. padding: 0;
  411. pointer-events: auto;
  412. color: currentColor;
  413. border: 0;
  414. border: 2px solid;
  415. background: none;
  416. }
  417. .btn-back:focus {
  418. outline: none;
  419. }
  420. .no-js .content__number,
  421. .no-js .btn-back {
  422. display: none;
  423. }
  424. .js .content__block,
  425. .js .content__description,
  426. .js .content__meta,
  427. .js .content__number,
  428. .js .btn-back {
  429. opacity: 0;
  430. }
  431. .js .content__block--current {
  432. pointer-events: auto;
  433. opacity: 1;
  434. }
  435. @media screen and (max-width: 50.75em) {
  436. .calendar {
  437. padding: 3em calc((100vw - (7 * (14vw + 1vw)))/2);
  438. }
  439. .js .calendar {
  440. padding: 0 calc((100vw - (7 * (12vw + 1vw)))/2) 5em;
  441. }
  442. .cube {
  443. width: 12vw;
  444. height: 12vw;
  445. }
  446. /* push to the right weekday if in big view (we have to push 3 boxes) */
  447. .js .cube:first-child {
  448. margin-left: calc(((12vw + 1vw) * 3) + 0.5vw);
  449. }
  450. .cube__side--front {
  451. -webkit-transform: translateZ(6vw);
  452. transform: translateZ(6vw);
  453. }
  454. .cube__side--back {
  455. -webkit-transform: rotateY(180deg) translateZ(6vw);
  456. transform: rotateY(180deg) translateZ(6vw);
  457. }
  458. .cube__side--right {
  459. -webkit-transform: rotateY(90deg) translateZ(6vw);
  460. transform: rotateY(90deg) translateZ(6vw);
  461. }
  462. .cube__side--left {
  463. -webkit-transform: rotateY(-90deg) translateZ(6vw);
  464. transform: rotateY(-90deg) translateZ(6vw);
  465. }
  466. .cube__side--top {
  467. -webkit-transform: rotateX(90deg) translateZ(6vw);
  468. transform: rotateX(90deg) translateZ(6vw);
  469. }
  470. .cube__side--bottom {
  471. -webkit-transform: rotateX(-90deg) translateZ(6vw);
  472. transform: rotateX(-90deg) translateZ(6vw);
  473. }
  474. .title {
  475. font-size: 5vw;
  476. }
  477. .content__description {
  478. font-size: 1.15em;
  479. padding: 0 0 0 0.5em;
  480. }
  481. .js .content__block {
  482. padding: 2em;
  483. width: 100%;
  484. }
  485. .btn-back {
  486. font-size: 1.25em;
  487. bottom: auto;
  488. top: 0;
  489. margin: 0.5em;
  490. }
  491. }
  492. @media screen and (max-width: 26em) {
  493. .codrops-header {
  494. font-size: 0.75em;
  495. }
  496. .codrops-header__tagline {
  497. display: none;
  498. }
  499. .codrops-header__title {
  500. font-size: 1.5em;
  501. }
  502. .codrops-demos {
  503. width: 100%;
  504. margin: 0;
  505. padding: 0.5em 1em;
  506. }
  507. }