Advertisement
makispaiktis

Codecademy - 14th Exercise (CSS)

Oct 15th, 2019 (edited)
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 8.35 KB | None | 0 0
  1. /* Universal Styles */
  2.  
  3. html {
  4.   font-size: 16px;
  5. }
  6.  
  7. body {
  8.   font-family: "Open Sans", sans-serif;
  9. }
  10.  
  11. a {
  12.   text-decoration: none;
  13.   color: inherit;
  14. }
  15.  
  16. strong {
  17.   font-weight: bold;
  18. }
  19.  
  20.  
  21. .image-container {
  22.   overflow: hidden;
  23. }
  24.  
  25. .image-container img {
  26.   display: block;
  27.   max-width: 100%;
  28. }
  29.  
  30. @media only screen and (max-width: 990px) {
  31.   html {
  32.     font-size: 14px;
  33.   }
  34. }
  35.  
  36. /* Header */
  37.  
  38. header {
  39.   display: flex;
  40.   align-items: center;
  41.   padding: .5rem 3.75rem;
  42.   background-color: #ff8000;
  43. }
  44.  
  45. header .logo-small {
  46.   display: none;
  47. }
  48.  
  49. header .logo-small,
  50. header .logo-big {
  51.   flex-grow: 1;
  52. }
  53.  
  54. nav li {
  55.   display: inline;
  56.   padding-right: 2rem;
  57. }
  58.  
  59. nav li:last-child {
  60.   padding-right: 0;
  61. }
  62.  
  63. @media only screen and (max-width: 990px) {
  64.   header .logo-big {
  65.     display: none;
  66.   }
  67.  
  68.   header .logo-small {
  69.     display: block;
  70.   }
  71. }
  72.  
  73. @media only screen and (max-width: 540px) {
  74.   header {
  75.     flex-direction: column;
  76.     padding-left: 0;
  77.     padding-right: 0;
  78.   }
  79.  
  80.   header .logo-small {
  81.     margin-bottom: 1rem;
  82.   }
  83. }
  84.  
  85. /* Banner */
  86.  
  87. #banner {
  88.   position: relative;
  89.   height: 43.75rem;
  90.   padding: 0 25%;
  91.   background: url(" https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-6/banner.png") center center no-repeat;
  92.   background-size: cover;
  93.   text-align: center;
  94. }
  95.  
  96. #banner:before { /* Orange Overlay */
  97.   position: absolute;
  98.   content: "";
  99.   top: 0;
  100.   left: 0;
  101.   width: 100%;
  102.   height: 100%;
  103.     background-color: rgba(255, 128, 0, 0.75);
  104. }
  105.  
  106. #banner * {
  107.   position: relative; /* Makes elements display above overlay. */
  108. }
  109.  
  110. h1 {
  111.   padding-top: 10.4375rem;
  112.   padding-bottom: 1.25rem;
  113.   font-family: "Creepster", cursive;
  114.   font-size: 8rem;
  115.     color: rgba(0, 0, 0, 0.7);
  116. }
  117.  
  118. #banner p {
  119.   color: white;
  120.   line-height: 1.5;
  121.   font-size: 1.375rem;
  122. }
  123.  
  124. @media only screen and (max-width: 820px) {
  125.   h1 {
  126.     padding-top: 7rem;
  127.     font-size: 6rem;
  128.   }
  129. }
  130.  
  131. @media only screen and (max-width: 590px) {
  132.   h1 {
  133.     font-size: 4rem;
  134.   }
  135. }
  136.  
  137. /* Color Guide */
  138.  
  139. #color-guide {
  140.   padding: 3.875rem 15% 13.5rem 15%;
  141. }
  142.  
  143. #color-guide .introduction {
  144.   padding: 0 10%;
  145.   margin-bottom: .75rem;
  146.   text-align: center;
  147.   font-size: 1.375rem;
  148.   line-height: 1.4;
  149. }
  150.  
  151. #color-guide h2 {
  152.   margin-bottom: 2.4375rem;
  153.   line-height: 1;
  154.   font-size: 2rem;
  155.   color: #ff8000;
  156. }
  157.  
  158. #color-guide .color {
  159.   display: flex;
  160.   justify-content: space-between;
  161.   padding-top: 5.25rem;
  162. }
  163.  
  164. .color .information {
  165.   display: flex;
  166.   flex-direction: column;
  167.   justify-content: space-between;
  168.   width: 35%;
  169. }
  170.  
  171. .color .information h3 {
  172.   padding-bottom: .5rem;
  173.   font-size: 1.375rem;
  174.   font-weight: bold;
  175. }
  176.  
  177. .color .information p {
  178.   font-size: .875rem;
  179.   line-height: 1.4;
  180. }
  181.  
  182. .color .swatches {
  183.   width: 60%;
  184. }
  185.  
  186. .color .swatches h4 {
  187.   margin-bottom: 1.25rem;
  188.   font-size: 1.125rem;
  189.   font-weight: bold;
  190.     color: #9b9b9b;
  191. }
  192.  
  193. .color .swatch {
  194.   display: flex;
  195.   height: 6.6875rem;
  196.   border: 10px solid #e6e6e6;
  197.   margin-bottom: 1.25rem;
  198. }
  199.  
  200. .color .swatch:last-child {
  201.   margin-bottom: 0;
  202. }
  203.  
  204. .color .swatch > div {
  205.   flex-grow: 1;
  206.   border-right: 10px solid #e6e6e6;
  207. }
  208.  
  209. .color .swatch > div:last-child {
  210.   border-right: 0;
  211. }
  212.  
  213. @media only screen and (max-width: 820px) {
  214.   #color-guide .color {
  215.     flex-direction: column;
  216.     align-items: center;
  217.   }
  218.  
  219.   .color .information {
  220.     width: 100%;
  221.     margin-bottom: 3rem;
  222.     align-items: center;
  223.   }
  224.  
  225.   .color .information h3 {
  226.     padding-bottom: 1.5rem;
  227.   }
  228.  
  229.   .color .information p {
  230.     margin-bottom: 2rem;
  231.   }
  232.  
  233.   .color .swatches {
  234.     width: 100%;
  235.   }
  236. }
  237.  
  238. /* Red Swatches */
  239.  
  240. .reds .base-color {
  241.   color: #ff002b;
  242. }
  243.  
  244. /* Red lightness decreases by 15 */
  245. .reds .lightness .color-1 {
  246.     background-color: hsl(350, 100%, 80%);
  247. }
  248.  
  249. .reds .lightness .color-2 {
  250.   background-color: hsl(350, 100%, 65%);
  251. }
  252.  
  253. .reds .lightness .color-3 {
  254.   background-color: hsl(350, 100%, 50%);
  255. }
  256.  
  257. .reds .lightness .color-4 {
  258.   background-color: hsl(350, 100%, 35%);
  259. }
  260.  
  261. .reds .lightness .color-5 {
  262.   background-color: hsl(350, 100%, 20%);
  263. }
  264.  
  265. /* Red saturation decreases by 15 */
  266. .reds .saturation .color-1 {
  267.     background-color: hsl(350, 100%, 50%);
  268. }
  269.  
  270. .reds .saturation .color-2 {
  271.   background-color: hsl(350, 85%, 50%);
  272. }
  273.  
  274. .reds .saturation .color-3 {
  275.   background-color: hsl(350, 70%, 50%);
  276. }
  277.  
  278. .reds .saturation .color-4 {
  279.   background-color: hsl(350, 55%, 50%);
  280. }
  281.  
  282. .reds .saturation .color-5 {
  283.   background-color: hsl(350, 40%, 50%);
  284. }
  285.  
  286. /* Red hue increases by 15 */
  287. .reds .hue .color-1 {
  288.     background-color: hsl(320, 100%, 50%);
  289. }
  290.  
  291. .reds .hue .color-2 {
  292.   background-color: hsl(335, 100%, 50%);
  293. }
  294.  
  295. .reds .hue .color-3 {
  296.   background-color: hsl(350, 100%, 50%);
  297. }
  298.  
  299. .reds .hue .color-4 {
  300.   background-color: hsl(5, 100%, 50%);
  301. }
  302.  
  303. .reds .hue .color-5 {
  304.   background-color: hsl(20, 100%, 50%);
  305. }
  306.  
  307. /* Green Swatches */
  308.  
  309. .greens .base-color {
  310.   color: #00ff2a;
  311. }
  312.  
  313. /* Green lightness decreases by 20 */
  314. .greens .lightness .color-1 {
  315.     background-color: hsl(103, 100%, 85%);
  316. }
  317.  
  318. .greens .lightness .color-2 {
  319.   background-color: hsl(103, 100%, 70%);
  320. }
  321.  
  322. .greens .lightness .color-3 {
  323.   background-color: hsl(103, 100%, 50%);
  324. }
  325.  
  326. .greens .lightness .color-4 {
  327.   background-color: hsl(103, 100%, 30%);
  328. }
  329.  
  330. .greens .lightness .color-5 {
  331.   background-color: hsl(104, 100%, 10%);
  332. }
  333.  
  334. /* Green saturation decreases by 20 */
  335. .greens .saturation .color-1 {
  336.     background-color: hsl(130, 100%, 50%);
  337. }
  338.  
  339. .greens .saturation .color-2 {
  340.   background-color: hsl(130, 80%, 50%);
  341. }
  342.  
  343. .greens .saturation .color-3 {
  344.   background-color: hsl(130, 60%, 50%);
  345. }
  346.  
  347. .greens .saturation .color-4 {
  348.   background-color: hsl(130, 40%, 50%);
  349. }
  350.  
  351. .greens .saturation .color-5 {
  352.   background-color: hsl(131, 20%, 50%);
  353. }
  354.  
  355. /* Green hue increases by 22 */
  356. .greens .hue .color-1 {
  357.     background-color: hsl(86, 100%, 50%);
  358. }
  359.  
  360. .greens .hue .color-2 {
  361.   background-color: hsl(108, 100%, 50%);
  362. }
  363.  
  364. .greens .hue .color-3 {
  365.   background-color: hsl(130, 100%, 50%);
  366. }
  367.  
  368. .greens .hue .color-4 {
  369.   background-color: hsl(152, 100%, 50%);
  370. }
  371.  
  372. .greens .hue .color-5 {
  373.   background-color: hsl(174, 100%, 50%);
  374. }
  375.  
  376. /* Blue Swatches */
  377.  
  378. .blues .base-color {
  379.   color: #0055ff;
  380. }
  381.  
  382. /* Blue lightness decreases by 20 */
  383. .blues .lightness .color-1 {
  384.     background-color: hsl(220, 100%, 90%);
  385. }
  386.  
  387. .blues .lightness .color-2 {
  388.   background-color: hsl(220, 100%, 70%);
  389. }
  390.  
  391. .blues .lightness .color-3 {
  392.   background-color: hsl(220, 100%, 50%);
  393. }
  394.  
  395. .blues .lightness .color-4 {
  396.   background-color: hsl(220, 100%, 30%);
  397. }
  398.  
  399. .blues .lightness .color-5 {
  400.   background-color: hsl(220, 100%, 10%);
  401. }
  402.  
  403. /* Blue saturation decreases by 20 */
  404. .blues .saturation .color-1 {
  405.     background-color: hsl(220, 100%, 50%);
  406. }
  407.  
  408. .blues .saturation .color-2 {
  409.   background-color: hsl(220, 80%, 50%);
  410. }
  411.  
  412. .blues .saturation .color-3 {
  413.   background-color: hsl(220, 60%, 50%);
  414. }
  415.  
  416. .blues .saturation .color-4 {
  417.   background-color: hsl(220, 40%, 50%);
  418. }
  419.  
  420. .blues .saturation .color-5 {
  421.   background-color: hsl(220, 20%, 50%);
  422. }
  423.  
  424. /* Blue hue decreases by 20 */
  425. .blues .hue .color-1 {
  426.     background-color: hsl(260, 100%, 50%);
  427. }
  428.  
  429. .blues .hue .color-2 {
  430.   background-color: hsl(240, 100%, 50%);
  431. }
  432.  
  433. .blues .hue .color-3 {
  434.   background-color: hsl(220, 100%, 50%);
  435. }
  436.  
  437. .blues .hue .color-4 {
  438.   background-color: hsl(200, 100%, 50%);
  439. }
  440.  
  441. .blues .hue .color-5 {
  442.   background-color: hsl(180, 100%, 50%);
  443. }
  444.  
  445. /* Footer */
  446.  
  447. footer {
  448.   position: relative;
  449.   height: 30rem;
  450.   padding: 7.8125rem 30% 0 30%;
  451.   background: url("https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-6/footer.png") center center no-repeat;
  452.   background-size: cover;
  453.   text-align: center;
  454.   font-size: 1.125rem;
  455.   line-height: 1.4;
  456.   color: white;
  457. }
  458.  
  459. footer:before { /* Overlay */
  460.   position: absolute;
  461.   content: "";
  462.   top: 0;
  463.   left: 0;
  464.   width: 100%;
  465.   height: 100%;
  466.     background-color: rgba(255, 128, 0, 0.75);
  467. }
  468.  
  469. footer * {
  470.   position: relative; /* Makes elements display above overlay. */
  471. }
  472.  
  473. footer strong {
  474.   display: block;
  475.   margin-bottom: 1.25rem;
  476.   font-size: 2.25rem;
  477. }
  478.  
  479. footer p {
  480.   margin-bottom: 4.3125rem;
  481. }
  482.  
  483. footer .button {
  484.   padding: 1.25rem 3.75rem;
  485.   border-radius: 4px;
  486.   background-color: #ff8000;
  487. }
  488.  
  489. @media only screen and (max-width: 560px) {
  490.   footer {
  491.     padding: 4.8125rem 15% 0 15%;
  492.   }
  493. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement