You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

267 lines
6.0 KiB

  1. /*!
  2. =========================================================
  3. * NextJS Material Kit - v1.1.0 based on Material Kit - v2.0.2 and Material Kit React - v1.8.0
  4. =========================================================
  5. * Product Page: https://www.creative-tim.com/product/nextjs-material-kit
  6. * Copyright 2020 Creative Tim (https://www.creative-tim.com)
  7. * Licensed under MIT (https://github.com/creativetimofficial/nextjs-material-kit/blob/master/LICENSE.md)
  8. =========================================================
  9. * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  10. */
  11. // ##############################
  12. // // // Variables - Styles that are used on more than one component
  13. // #############################
  14. const hexColorToRGB = function(hexColor) {
  15. let detectShorthand = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; // #000 vs #000000
  16. hexColor = hexColor.replace(detectShorthand, function(m, r, g, b) {
  17. return r + r + g + g + b + b;
  18. });
  19. const hex_array = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexColor); // #000000 to #ffffff
  20. return hex_array
  21. ? {
  22. r: parseInt(hex_array[1], 16), // 0-255
  23. g: parseInt(hex_array[2], 16), // 0-255
  24. b: parseInt(hex_array[3], 16) // 0-255
  25. }
  26. : null;
  27. };
  28. const hexToRGBAlpha = function(hexColor, alpha) {
  29. let rgb = hexColorToRGB(hexColor);
  30. return `rgba(${rgb.r},${rgb.g},${rgb.b},${alpha})`;
  31. };
  32. const drawerWidth = 260;
  33. const transition = {
  34. transition: "all 0.33s cubic-bezier(0.685, 0.0473, 0.346, 1)"
  35. };
  36. const conatinerFluid = {
  37. paddingRight: "15px",
  38. paddingLeft: "15px",
  39. marginRight: "auto",
  40. marginLeft: "auto",
  41. width: "100%"
  42. };
  43. const container = {
  44. ...conatinerFluid,
  45. "@media (min-width: 576px)": {
  46. maxWidth: "540px"
  47. },
  48. "@media (min-width: 768px)": {
  49. maxWidth: "720px"
  50. },
  51. "@media (min-width: 992px)": {
  52. maxWidth: "960px"
  53. },
  54. "@media (min-width: 1200px)": {
  55. maxWidth: "1140px"
  56. }
  57. };
  58. const boxShadow = {
  59. boxShadow:
  60. "0 10px 30px -12px rgba(0, 0, 0, 0.42), 0 4px 25px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2)"
  61. };
  62. const card = {
  63. display: "inline-block",
  64. position: "relative",
  65. width: "100%",
  66. margin: "25px 0",
  67. boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.14)",
  68. borderRadius: "3px",
  69. color: "rgba(0, 0, 0, 0.87)",
  70. background: "#fff"
  71. };
  72. const defaultFont = {
  73. fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
  74. fontWeight: "300",
  75. lineHeight: "1.5em"
  76. };
  77. const primaryColor = "#9c27b0";
  78. const warningColor = "#ff9800";
  79. const dangerColor = "#f44336";
  80. const successColor = "#4caf50";
  81. const infoColor = "#00acc1";
  82. const roseColor = "#e91e63";
  83. const grayColor = "#999999";
  84. const primaryBoxShadow = {
  85. boxShadow: `0 12px 20px -10px ${hexToRGBAlpha(
  86. primaryColor,
  87. 0.28
  88. )}, 0 4px 20px 0px rgba(0, 0, 0, 0.12), 0 7px 8px -5px ${hexToRGBAlpha(
  89. primaryColor,
  90. 0.2
  91. )}`
  92. };
  93. const infoBoxShadow = {
  94. boxShadow: `0 12px 20px -10px ${hexToRGBAlpha(
  95. infoColor,
  96. 0.28
  97. )}, 0 4px 20px 0px rgba(0, 0, 0, 0.12), 0 7px 8px -5px ${hexToRGBAlpha(
  98. infoColor,
  99. 0.2
  100. )}`
  101. };
  102. const successBoxShadow = {
  103. boxShadow: `0 12px 20px -10px ${hexToRGBAlpha(
  104. successColor,
  105. 0.28
  106. )}, 0 4px 20px 0px rgba(0, 0, 0, 0.12), 0 7px 8px -5px ${hexToRGBAlpha(
  107. successColor,
  108. 0.2
  109. )}`
  110. };
  111. const warningBoxShadow = {
  112. boxShadow: `0 12px 20px -10px ${hexToRGBAlpha(
  113. warningColor,
  114. 0.28
  115. )}, 0 4px 20px 0px rgba(0, 0, 0, 0.12), 0 7px 8px -5px ${hexToRGBAlpha(
  116. warningColor,
  117. 0.2
  118. )}`
  119. };
  120. const dangerBoxShadow = {
  121. boxShadow: `0 12px 20px -10px ${hexToRGBAlpha(
  122. dangerColor,
  123. 0.28
  124. )}, 0 4px 20px 0px rgba(0, 0, 0, 0.12), 0 7px 8px -5px ${hexToRGBAlpha(
  125. dangerColor,
  126. 0.2
  127. )}`
  128. };
  129. const roseBoxShadow = {
  130. boxShadow: `0 4px 20px 0px ${hexToRGBAlpha(
  131. "#000",
  132. 0.14
  133. )}, 0 7px 10px -5px ${hexToRGBAlpha(roseColor, 0.4)}`
  134. };
  135. const warningCardHeader = {
  136. color: "#fff",
  137. background: "linear-gradient(60deg, #ffa726, #fb8c00)",
  138. ...warningBoxShadow
  139. };
  140. const successCardHeader = {
  141. color: "#fff",
  142. background: "linear-gradient(60deg, #66bb6a, #43a047)",
  143. ...successBoxShadow
  144. };
  145. const dangerCardHeader = {
  146. color: "#fff",
  147. background: "linear-gradient(60deg, #ef5350, #e53935)",
  148. ...dangerBoxShadow
  149. };
  150. const infoCardHeader = {
  151. color: "#fff",
  152. background: "linear-gradient(60deg, #26c6da, #00acc1)",
  153. ...infoBoxShadow
  154. };
  155. const primaryCardHeader = {
  156. color: "#fff",
  157. background: "linear-gradient(60deg, #ab47bc, #8e24aa)",
  158. ...primaryBoxShadow
  159. };
  160. const roseCardHeader = {
  161. color: "#fff",
  162. background: "linear-gradient(60deg, #ec407a, #d81b60)",
  163. ...roseBoxShadow
  164. };
  165. const cardActions = {
  166. margin: "0 20px 10px",
  167. paddingTop: "10px",
  168. borderTop: "1px solid #eeeeee",
  169. height: "auto",
  170. ...defaultFont
  171. };
  172. const cardHeader = {
  173. margin: "-30px 15px 0",
  174. borderRadius: "3px",
  175. padding: "15px"
  176. };
  177. const defaultBoxShadow = {
  178. border: "0",
  179. borderRadius: "3px",
  180. boxShadow:
  181. "0 10px 20px -12px rgba(0, 0, 0, 0.42), 0 3px 20px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2)",
  182. padding: "10px 0",
  183. transition: "all 150ms ease 0s"
  184. };
  185. const title = {
  186. color: "#3C4858",
  187. margin: "1.75rem 0 0.875rem",
  188. textDecoration: "none",
  189. fontWeight: "700",
  190. fontFamily: `"Roboto Slab", "Times New Roman", serif`
  191. };
  192. const cardTitle = {
  193. ...title,
  194. marginTop: ".625rem"
  195. };
  196. const cardLink = {
  197. "& + $cardLink": {
  198. marginLeft: "1.25rem"
  199. }
  200. };
  201. const cardSubtitle = {
  202. marginBottom: "0",
  203. marginTop: "-.375rem"
  204. };
  205. export {
  206. hexToRGBAlpha,
  207. //variables
  208. drawerWidth,
  209. transition,
  210. container,
  211. conatinerFluid,
  212. boxShadow,
  213. card,
  214. defaultFont,
  215. primaryColor,
  216. warningColor,
  217. dangerColor,
  218. successColor,
  219. infoColor,
  220. roseColor,
  221. grayColor,
  222. primaryBoxShadow,
  223. infoBoxShadow,
  224. successBoxShadow,
  225. warningBoxShadow,
  226. dangerBoxShadow,
  227. roseBoxShadow,
  228. warningCardHeader,
  229. successCardHeader,
  230. dangerCardHeader,
  231. infoCardHeader,
  232. primaryCardHeader,
  233. roseCardHeader,
  234. cardActions,
  235. cardHeader,
  236. defaultBoxShadow,
  237. title,
  238. cardTitle,
  239. cardLink,
  240. cardSubtitle
  241. };