demo.css 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. *,
  2. *::after,
  3. *::before {
  4. box-sizing: border-box;
  5. }
  6. html {
  7. background: #000;
  8. }
  9. body {
  10. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  11. height: 100vh;
  12. overflow: hidden;
  13. color: #fff;
  14. color: var(--color-text);
  15. background-color: #000;
  16. background-color: var(--color-bg);
  17. -webkit-font-smoothing: antialiased;
  18. -moz-osx-font-smoothing: grayscale;
  19. }
  20. /* Color schemes */
  21. .demo-1 {
  22. --color-text: #fff;
  23. --color-bg: #000;
  24. --color-link: #8fe8ff;
  25. --color-link-hover: #fff;
  26. --color-info: #72af3a;
  27. --color-nav: #fff;
  28. }
  29. .demo-2 {
  30. --color-text: #fff;
  31. --color-bg: #000;
  32. --color-link: #9cf9db;
  33. --color-link-hover: #fff;
  34. --color-info: #f3a145;
  35. --color-nav: #fff;
  36. }
  37. .demo-3 {
  38. --color-text: #fff;
  39. --color-bg: #a9b1b7;
  40. --color-link: #201b18;
  41. --color-link-hover: #224d94;
  42. --color-info: #fff473;
  43. --color-nav: #fff;
  44. }
  45. .demo-4 {
  46. --color-text: #81838c;
  47. --color-bg: #000;
  48. --color-link: #96e23e;
  49. --color-link-hover: #fff;
  50. --color-info: #ea7836;
  51. --color-nav: #fff;
  52. }
  53. .demo-5 {
  54. --color-text: #fff;
  55. --color-bg: #000;
  56. --color-link: #fff;
  57. --color-link-hover: #2a3cbb;
  58. --color-info: #f7fb40;
  59. --color-nav: #fff;
  60. }
  61. /* Fade effect */
  62. .js body {
  63. opacity: 0;
  64. transition: opacity 0.3s;
  65. }
  66. .js body.render {
  67. opacity: 1;
  68. }
  69. /* Page Loader */
  70. .js .loading::before {
  71. content: '';
  72. position: fixed;
  73. z-index: 100000;
  74. top: 0;
  75. left: 0;
  76. width: 100%;
  77. height: 100%;
  78. background: var(--color-bg);
  79. }
  80. .js .loading::after {
  81. content: '';
  82. position: fixed;
  83. z-index: 100000;
  84. top: 50%;
  85. left: 50%;
  86. width: 60px;
  87. height: 60px;
  88. margin: -30px 0 0 -30px;
  89. pointer-events: none;
  90. border-radius: 50%;
  91. opacity: 0.4;
  92. background: var(--color-link);
  93. animation: loaderAnim 0.7s linear infinite alternate forwards;
  94. }
  95. @keyframes loaderAnim {
  96. to {
  97. opacity: 1;
  98. transform: scale3d(0.5,0.5,1);
  99. }
  100. }
  101. a {
  102. text-decoration: none;
  103. color: #5d93d8;
  104. color: var(--color-link);
  105. outline: none;
  106. }
  107. a:hover,
  108. a:focus {
  109. color: #423c2b;
  110. color: var(--color-link-hover);
  111. outline: none;
  112. }
  113. .hidden {
  114. position: absolute;
  115. overflow: hidden;
  116. width: 0;
  117. height: 0;
  118. pointer-events: none;
  119. }
  120. .message {
  121. background: var(--color-text);
  122. color: var(--color-bg);
  123. text-align: center;
  124. padding: 1em;
  125. display: none;
  126. position: relative;
  127. z-index: 100;
  128. }
  129. /* Icons */
  130. .icon {
  131. display: block;
  132. width: 1.5em;
  133. height: 1.5em;
  134. margin: 0 auto;
  135. fill: currentColor;
  136. }
  137. main {
  138. position: relative;
  139. width: 100%;
  140. }
  141. .content {
  142. position: relative;
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. min-height: 100vh;
  147. margin: 0 auto;
  148. }
  149. .content--fixed {
  150. position: fixed;
  151. z-index: 10000;
  152. top: 0;
  153. left: 0;
  154. display: grid;
  155. align-content: space-between;
  156. width: 100%;
  157. max-width: none;
  158. height: 100vh;
  159. padding: 1.5em;
  160. pointer-events: none;
  161. grid-template-columns: 50% 50%;
  162. grid-template-rows: auto auto 4em;
  163. grid-template-areas: 'header ...'
  164. '... ...'
  165. 'github demos';
  166. }
  167. .content--fixed a {
  168. pointer-events: auto;
  169. }
  170. /* Header */
  171. .codrops-header {
  172. position: relative;
  173. z-index: 100;
  174. display: flex;
  175. flex-direction: row;
  176. align-items: flex-start;
  177. align-items: center;
  178. align-self: start;
  179. grid-area: header;
  180. justify-self: start;
  181. }
  182. .codrops-header__title {
  183. font-size: 1em;
  184. font-weight: bold;
  185. margin: 0;
  186. padding: 0.75em 0;
  187. }
  188. .info {
  189. margin: 0 0 0 1.25em;
  190. font-style: italic;
  191. color: var(--color-info);
  192. font-weight: bold;
  193. }
  194. .github {
  195. display: block;
  196. align-self: end;
  197. grid-area: github;
  198. justify-self: start;
  199. }
  200. .demos {
  201. position: relative;
  202. display: block;
  203. align-self: end;
  204. text-align: center;
  205. grid-area: demos;
  206. }
  207. .demo {
  208. margin: 0 0 0 0.15em;
  209. }
  210. .demo:hover,
  211. .demo:focus {
  212. opacity: 0.5;
  213. }
  214. .demo span {
  215. white-space: nowrap;
  216. text-transform: lowercase;
  217. pointer-events: none;
  218. }
  219. .demo span::before {
  220. content: '#';
  221. }
  222. a.demo--current {
  223. pointer-events: none;
  224. }
  225. /* Top Navigation Style */
  226. .codrops-links {
  227. position: relative;
  228. display: flex;
  229. justify-content: center;
  230. margin: 0 1em 0 0;
  231. text-align: center;
  232. white-space: nowrap;
  233. }
  234. .codrops-icon {
  235. display: inline-block;
  236. margin: 0.15em;
  237. padding: 0.25em;
  238. }
  239. .scene {
  240. position: fixed;
  241. top: 0;
  242. left: 0;
  243. width: 100%;
  244. height: 100vh;
  245. pointer-events: none;
  246. z-index: 1;
  247. }
  248. @media screen and (min-width: 55em) {
  249. .demos {
  250. display: flex;
  251. justify-self: end;
  252. }
  253. .demo {
  254. display: block;
  255. width: 17px;
  256. height: 17px;
  257. margin: 0 4px;
  258. border-radius: 50%;
  259. background: var(--color-link);
  260. }
  261. a.demo--current {
  262. background: var(--color-link-hover);
  263. }
  264. .demo span {
  265. position: absolute;
  266. line-height: 1;
  267. right: 100%;
  268. display: none;
  269. margin: 0 1em 0 0;
  270. }
  271. .demo--current span {
  272. display: block;
  273. }
  274. }
  275. @media screen and (max-width: 55em) {
  276. .message {
  277. display: block;
  278. }
  279. .content--fixed {
  280. position: relative;
  281. z-index: 1000;
  282. display: block;
  283. padding: 0.85em;
  284. }
  285. .codrops-header {
  286. flex-direction: column;
  287. align-items: center;
  288. }
  289. .codrops-header__title {
  290. font-weight: bold;
  291. padding-bottom: 0.25em;
  292. text-align: center;
  293. }
  294. .github {
  295. display: block;
  296. margin: 1em auto;
  297. }
  298. .codrops-links {
  299. margin: 0;
  300. }
  301. }