main.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. /* ====== Basic styles ====== */
  2. * {
  3. box-sizing: border-box;
  4. }
  5. body {
  6. margin: 0;
  7. background-color: #1c1c1c;
  8. font-family: Roboto, Arial, sans-serif;
  9. }
  10. img {
  11. max-width: 100%;
  12. }
  13. p {
  14. margin: 0;
  15. }
  16. p + p {
  17. margin-top: 1.5em;
  18. }
  19. /* ====== Helper classes ====== */
  20. /**
  21. * Make the antialiasing on dark backgrounds a bit lighter
  22. * on WebKit/Firefox OS X.
  23. */
  24. .inverted {
  25. -webkit-font-smoothing: antialiased;
  26. -moz-osx-font-smoothing: grayscale;
  27. }
  28. .wrapper {
  29. width: 95%;
  30. max-width: 60em;
  31. margin: 0 auto;
  32. }
  33. .section {
  34. background-color: #ddd;
  35. padding-top: 4em;
  36. padding-bottom: 4em;
  37. }
  38. .section:after {
  39. content: '';
  40. display: table;
  41. clear: both;
  42. height: 0;
  43. }
  44. /* ====== Header styles ====== */
  45. /**
  46. * 1. SVG file containing JPEG image + a radial gradient mask, then a linear
  47. * gradient background.
  48. */
  49. .page-header {
  50. background-color: #000;
  51. background-image: url(../img/earth.svg),
  52. linear-gradient(to bottom, #000, #102133); /* [1] */
  53. background-repeat: no-repeat;
  54. background-size: 100% auto, cover;
  55. background-position: 50% bottom;
  56. position: relative;
  57. overflow: hidden;
  58. display: flex;
  59. align-items: flex-end;
  60. justify-content: center;
  61. min-height: 12em;
  62. }
  63. /**
  64. * Masked header title.
  65. * 1. Use the -webkit-prefixed properties to create a CSS radial gradient mask.
  66. * These are not supported unprefixed when writing this.
  67. * 2. Size the mask to twice the size. Positioning won't work as the transparent
  68. * background created by simply moving it will mask out the top of the text.
  69. */
  70. .header-title {
  71. color: #fff;
  72. text-align: center;
  73. font-family: Roboto Condensed, Roboto, arial, sans-serif;
  74. font-size: 6em;
  75. font-size: 10vw;
  76. text-transform: uppercase;
  77. -webkit-mask-image: radial-gradient(
  78. ellipse 90% 30% at 50% 50%,
  79. rgba(0,0,0,0) 45%, #000 70%
  80. ); /* [1] */
  81. -webkit-mask-size: 100% 200%; /* [2] */
  82. margin: auto auto 8%;
  83. }
  84. @media only screen and (min-width: 60em) {
  85. .page-header {
  86. background-size: 60em auto, cover;
  87. min-height: 20em;
  88. }
  89. .header-title {
  90. font-size: 160px;
  91. margin-bottom: 60px;
  92. }
  93. }
  94. .section-title {
  95. font-family: Roboto Condensed, Roboto, Arial, sans-serif;
  96. text-transform: uppercase;
  97. -webkit-transform-origin: left center;
  98. transform-origin: left center;
  99. -webkit-transform: skewY(-2deg);
  100. transform: skewY(-2deg);
  101. -webkit-transform: perspective(200px) rotate3d(2,-1,0,-30deg);
  102. transform: perspective(200px) rotate3d(2,-1,0,-30deg);
  103. font-size: 4em;
  104. margin: 0 0 1em;
  105. }
  106. .section-text {
  107. font-size: 1.125em;
  108. }
  109. .fig {
  110. margin: 0 auto;
  111. }
  112. @media only screen and (min-width: 600px) {
  113. .fig {
  114. margin: 0;
  115. float: right;
  116. }
  117. .stacked:nth-of-type(even) .fig {
  118. float: left;
  119. margin-right: 4em;
  120. }
  121. }
  122. .stacked:nth-of-type(even) .section-text {
  123. overflow: hidden;
  124. }
  125. .section-universe {
  126. position: relative;
  127. overflow: hidden;
  128. background-color: #fff !important;
  129. }
  130. .section-sun {
  131. background-color: #D8F4FD;
  132. }
  133. .section-sun .section-title {
  134. color: #1C6E88;
  135. }
  136. .section-moon {
  137. background-color: #000;
  138. color: #fff;
  139. }
  140. /* ===== Figures and images ====== */
  141. /**
  142. * Switch to the following rule to use the margin reference box
  143. * as a shape instead:
  144. */
  145. /*.fig-moon {
  146. max-width: 40%;
  147. border-radius: 50%;
  148. -webkit-shape-outside: margin-box;
  149. shape-outside: margin-box;
  150. margin-left: 2em;
  151. }*/
  152. .fig-moon {
  153. max-width: 40%;
  154. -webkit-shape-outside: circle();
  155. shape-outside: circle();
  156. margin: 2em;
  157. }
  158. /**
  159. * 1. Use the image as the shape – the transparent edges will generate it.
  160. * 2. Uncomment this line to use a polygon instead.
  161. * 3. Use a shape threshold (if using the image) to set the tolerance level
  162. * before the shape is generated.
  163. * 4. Set a margin on the generated shape.
  164. * 5. Add a blend mode to make the image fit in with the background better.
  165. */
  166. .fig-planet {
  167. max-width: 65%;
  168. -webkit-shape-outside: url(../img/saturn.png); /* [1] */
  169. shape-outside: url(../img/saturn.png); /* [1] */
  170. /*shape-outside: polygon(41.85% 100%, 22.75% 92.85%, 5.6% 73.3%, 0.95% 52.6%, 5.6% 35.05%, 21.45% 17.15%, 37.65% 12.35%, 40% 0, 100% 0%, 100% 100%);*/ /* [2] */
  171. -webkit-shape-image-threshold: 0.4; /* [3] */
  172. shape-image-threshold: 0.4; /* [3] */
  173. -webkit-shape-margin: 1em; /* [4] */
  174. shape-margin: 1em; /* [4] */
  175. mix-blend-mode: screen; /* [5] */
  176. }
  177. .fig-sun {
  178. max-width: 40%;
  179. }
  180. /**
  181. * The image of the Sun uses both masking and filters to go from a black-and-white
  182. * image to a colorized version with transparency. See full-example.html for the
  183. * SVG mask version.
  184. * 1. Add a list of filters to colorize the image.
  185. * 2. Mask away the background using a radial gradient.
  186. */
  187. .fig-sun {
  188. -webkit-filter: contrast(0.34) brightness(1.6) sepia(1) hue-rotate(10deg); /* [1] */
  189. filter: contrast(0.34) brightness(1.6) sepia(1) hue-rotate(10deg); /* [1] */
  190. -webkit-mask-image: radial-gradient(circle closest-side at 50%, #000, #000 90%, rgba(0,0,0,0) 93%); /* [2] */
  191. }
  192. .fig-universe {
  193. width: 100%;
  194. display: block;
  195. float: none;
  196. }
  197. .section-text p {
  198. line-height: 1.5;
  199. max-width: 40em;
  200. }
  201. /* ====== Navigation ====== */
  202. /**
  203. * 1. Add a transform to the parent section, to counter a bug in Blink
  204. * where the filter on child items freak out otherwise.
  205. */
  206. .nav-section {
  207. background-color: #16284F;
  208. color: #fff;
  209. transform: translate(0,0); /* [1] */
  210. }
  211. .nav-section ul {
  212. list-style: none;
  213. padding: 0;
  214. }
  215. /**
  216. * Some tiny responsive tweaks to make the menu
  217. * fall back to a simpler appearance on very small screens:
  218. */
  219. @media only screen and (max-width: 599px) {
  220. .nav-section li {
  221. margin-bottom: .25em;
  222. }
  223. .nav-section a {
  224. padding: .5em;
  225. }
  226. }
  227. /* we also scope the enhanced version to a media query: */
  228. @media only screen and (min-width: 600px) {
  229. .nav-section ul {
  230. display: -webkit-flex;
  231. display: -ms-flexbox;
  232. display: flex;
  233. -webkit-justify-content: space-between;
  234. -ms-flex-pack: justify;
  235. justify-content: space-between;
  236. }
  237. /**
  238. * 1. Add a drop-shadow filter (including the -webkit-prefix) to the list-items.
  239. */
  240. .nav-section li {
  241. height: 6.25em;
  242. width: 6.25em;
  243. float: left;
  244. -webkit-flex: none;
  245. -ms-flex: none;
  246. flex: none;
  247. display: -webkit-flex;
  248. display: -ms-flexbox;
  249. display: flex;
  250. -webkit-align-items: stretch;
  251. -ms-flex-align: stretch;
  252. align-items: stretch;
  253. -webkit-filter: drop-shadow(0 0 .5em rgba(0,0,0,0.3)); /* [1] */
  254. filter: drop-shadow(0 0 .5em rgba(0,0,0,0.3)); /* [1] */
  255. }
  256. }
  257. /**
  258. * Uncomment animation code to view the "focus" animation.
  259. * Sadly, this has some very serious rendering bugs at the moment when
  260. * combined with clip-paths.
  261. */
  262. /*.nav-section li {
  263. animation: inFocus 1s both;
  264. }
  265. .nav-section li:nth-child(2) {
  266. animation-delay: .25s;
  267. }
  268. .nav-section li:nth-child(3) {
  269. animation-delay: .50s;
  270. }
  271. .nav-section li:nth-child(4) {
  272. animation-delay: .75s;
  273. }
  274. .nav-section li:nth-child(5) {
  275. animation-delay: 1s;
  276. }
  277. */
  278. /**
  279. * 1. Change the shadow color on hover, to create the glow.
  280. */
  281. .nav-section li:hover {
  282. -webkit-filter: drop-shadow(0 0 .5em rgba(50,50,255,0.2)); /* [1] */
  283. filter: drop-shadow(0 0 .5em rgba(50,50,255,0.2)); /* [1] */
  284. }
  285. /**
  286. * 1. Add a null transform to prevent rendering bugs in Blink/WebKit. This still
  287. * freaks out in Safari, but seemingly only intermittently.
  288. */
  289. .nav-section a {
  290. background-color: #1A4298;
  291. color: #fff;
  292. text-decoration: none;
  293. display: -webkit-flex;
  294. display: -ms-flexbox;
  295. display: -webkit-box;
  296. display: -moz-box;
  297. display: flex;
  298. -webkit-align-items: center;
  299. -ms-flex-align: center;
  300. -webkit-box-align: center;
  301. -moz-box-align: center;
  302. align-items: center;
  303. width: 100%;
  304. -webkit-justify-content: center;
  305. -ms-flex-pack: center;
  306. -webkit-box-pack: center;
  307. -moz-box-pack: center;
  308. justify-content: center;
  309. -webkit-transform: translate(0, 0);
  310. -moz-transform: translate(0, 0);
  311. -ms-transform: translate(0, 0);
  312. -o-transform: translate(0, 0);
  313. transform: translate(0, 0); /* [1] */
  314. }
  315. .nav-section a:focus,
  316. .nav-section a:hover,
  317. .nav-section a:active {
  318. outline: none;
  319. background-color: #1F51BC;
  320. }
  321. .section-planets {
  322. color: #E0CBD9;
  323. background-color: #26122B;
  324. }
  325. /**
  326. * 1. Colorize the Milky Way background using luminosity blend mode.
  327. */
  328. .section-milkyway {
  329. background-image: url(../img/milkyway.jpg);
  330. background-color: #202D53;
  331. background-blend-mode: luminosity; /* [1] */
  332. background-position: 50% 0;
  333. background-size: cover;
  334. color: #fff;
  335. }
  336. /**
  337. * 1. Add a backdrop blur to the semi-transparent text background.
  338. * Falls back to just the normal alpha transparency.
  339. */
  340. .section-milkyway .section-text {
  341. margin-top: 30vh;
  342. color: #fff;
  343. padding: 1em;
  344. -webkit-backdrop-filter: blur(5px); /* [1] */
  345. backdrop-filter: blur(5px); /* [1] */
  346. background-color: #202D53;
  347. background-color: rgba(0,0,0,0.5);
  348. }
  349. .page-footer {
  350. background-color: #222B33;
  351. color: #eee;
  352. }
  353. .page-footer a {
  354. color: inherit;
  355. }
  356. .universe-header {
  357. position: relative;
  358. }
  359. @media only screen and (min-width: 800px) {
  360. .universe-header {
  361. width: 40%;
  362. float: right;
  363. margin: .2em 0 .5em 2em;
  364. position: relative;
  365. }
  366. .section-universe .section-text {
  367. margin-right: 25%;
  368. }
  369. .section-milkyway .section-text {
  370. margin-left: 25%;
  371. }
  372. }
  373. @media only screen and (min-width: 1100px) {
  374. .universe-header {
  375. width: 55%;
  376. }
  377. }
  378. .section-universe {
  379. padding-top: 8em;
  380. padding-bottom: 8em;
  381. }
  382. :root .universe-title {
  383. margin: 0;
  384. width: 90%;
  385. height: 0;
  386. padding-bottom: 27%;
  387. position: absolute;
  388. left: 5%;
  389. right: 5%;
  390. top: 54%;
  391. font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  392. }
  393. .universe-title text {
  394. fill: #602135;
  395. text-transform: uppercase;
  396. }
  397. .universe-title svg {
  398. position: absolute;
  399. top: 0;
  400. right: 0;
  401. bottom: 0;
  402. left: 0;
  403. background-color: #fff;
  404. }
  405. @supports (mix-blend-mode: screen) {
  406. /**
  407. * 1. Only add the mix-blend-mode rules if supported. Screen makes black
  408. * 100% transparent.
  409. * 2. Change the fill color to black for supporting browsers,
  410. * resulting in 100% transparency for the text.
  411. */
  412. .universe-title {
  413. mix-blend-mode: screen;
  414. }
  415. .universe-title text {
  416. fill: #000;
  417. }
  418. }
  419. .universe-span-1 {
  420. font-size: 53.2px;
  421. }
  422. .universe-span-2 {
  423. font-size: 96.2px;
  424. }
  425. /**
  426. * 1. Clip the sections using clip-path and basic shape functions.
  427. */
  428. .stacked {
  429. -webkit-clip-path: polygon(0 3vw, 100% 0, 100% calc(100% - 3vw), 0% 100%); /* [1] */
  430. clip-path: polygon(0 3vw, 100% 0, 100% calc(100% - 3vw), 0% 100%); /* [1] */
  431. }
  432. .page-header {
  433. -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3vw), 0% 100%); /* [1] */
  434. clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3vw), 0% 100%); /* [1] */
  435. }
  436. .page-footer {
  437. -webkit-clip-path: polygon(0 3vw, 100% 0, 100% 100%, 0% 100%); /* [1] */
  438. clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%); /* [1] */
  439. }
  440. /**
  441. * 1. Adjust the negative margin-top for sections to pull them together,
  442. * but only if clip-paths are supported.
  443. */
  444. @supports ((clip-path: polygon(0 0)) or
  445. (-webkit-clip-path: polygon(0 0))) {
  446. .stacked {
  447. margin-bottom: -3.4vw; /* [1] */
  448. }
  449. }
  450. @-webkit-keyframes inFocus {
  451. from {
  452. -webkit-filter: blur(10px);
  453. filter: blur(10px);
  454. }
  455. }
  456. @keyframes inFocus {
  457. from {
  458. -webkit-filter: blur(10px);
  459. filter: blur(10px);
  460. }
  461. }