Application Android et IOS pour l'amicale des élèves
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.

platformDark.js 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. // @flow
  2. import color from "color";
  3. import {Dimensions, PixelRatio, Platform} from "react-native";
  4. const deviceHeight = Dimensions.get("window").height;
  5. const deviceWidth = Dimensions.get("window").width;
  6. const platform = Platform.OS;
  7. const platformStyle = undefined;
  8. const isIphoneX =
  9. platform === "ios" && (deviceHeight === 812 || deviceWidth === 812 || deviceHeight === 896 || deviceWidth === 896);
  10. export default {
  11. platformStyle,
  12. platform,
  13. //Accordion
  14. headerStyle: "#edebed",
  15. iconStyle: "#000",
  16. contentStyle: "#f5f4f5",
  17. expandedIconStyle: "#000",
  18. accordionBorderColor: "#d3d3d3",
  19. // Android
  20. androidRipple: true,
  21. androidRippleColor: "rgba(256, 256, 256, 0.3)",
  22. androidRippleColorDark: "rgba(0, 0, 0, 0.15)",
  23. btnUppercaseAndroidText: true,
  24. // Badge
  25. badgeBg: "#ED1727",
  26. badgeColor: "#fff",
  27. badgePadding: platform === "ios" ? 3 : 0,
  28. // Button
  29. btnFontFamily: platform === "ios" ? "System" : "Roboto_medium",
  30. btnTextColor: '#fff',
  31. btnDisabledBg: "#b5b5b5",
  32. buttonPadding: 6,
  33. get btnPrimaryBg() {
  34. return this.brandPrimary;
  35. },
  36. get btnPrimaryColor() {
  37. return this.textColor;
  38. },
  39. get btnInfoBg() {
  40. return this.brandInfo;
  41. },
  42. get btnInfoColor() {
  43. return this.textColor;
  44. },
  45. get btnSuccessBg() {
  46. return this.brandSuccess;
  47. },
  48. get btnSuccessColor() {
  49. return this.textColor;
  50. },
  51. get btnDangerBg() {
  52. return this.brandDanger;
  53. },
  54. get btnDangerColor() {
  55. return this.textColor;
  56. },
  57. get btnWarningBg() {
  58. return this.brandWarning;
  59. },
  60. get btnWarningColor() {
  61. return this.textColor;
  62. },
  63. get btnTextSize() {
  64. return platform === "ios" ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1;
  65. },
  66. get btnTextSizeLarge() {
  67. return this.fontSizeBase * 1.5;
  68. },
  69. get btnTextSizeSmall() {
  70. return this.fontSizeBase * 0.8;
  71. },
  72. get borderRadiusLarge() {
  73. return this.fontSizeBase * 3.8;
  74. },
  75. get iconSizeLarge() {
  76. return this.iconFontSize * 1.5;
  77. },
  78. get iconSizeSmall() {
  79. return this.iconFontSize * 0.6;
  80. },
  81. // Card
  82. cardDefaultBg: "#2A2A2A",
  83. cardBorderColor: "#1a1a1a",
  84. cardBorderRadius: 2,
  85. cardItemPadding: platform === "ios" ? 10 : 12,
  86. // CheckBox
  87. CheckboxRadius: platform === "ios" ? 13 : 0,
  88. CheckboxBorderWidth: platform === "ios" ? 1 : 2,
  89. CheckboxPaddingLeft: platform === "ios" ? 4 : 2,
  90. CheckboxPaddingBottom: platform === "ios" ? 0 : 5,
  91. CheckboxIconSize: platform === "ios" ? 21 : 16,
  92. CheckboxIconMarginTop: platform === "ios" ? undefined : 1,
  93. CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17,
  94. checkboxBgColor: "#E4202D",
  95. checkboxSize: 20,
  96. checkboxTickColor: "#fff",
  97. // Color
  98. brandPrimary: "#be1522",
  99. brandInfo: "#62B1F6",
  100. brandSuccess: "#5cb85c",
  101. brandDanger: "#d9534f",
  102. brandWarning: "#f0ad4e",
  103. brandDark: "#000",
  104. brandLight: "#f4f4f4",
  105. //Container
  106. containerBgColor: "#222222",
  107. sideMenuBgColor: "#1c1c1c",
  108. //Date Picker
  109. datePickerTextColor: "#fff",
  110. datePickerBg: "transparent",
  111. // Font
  112. DefaultFontSize: 16,
  113. fontFamily: platform === "ios" ? "System" : "Roboto",
  114. fontSizeBase: 15,
  115. get fontSizeH1() {
  116. return this.fontSizeBase * 1.8;
  117. },
  118. get fontSizeH2() {
  119. return this.fontSizeBase * 1.6;
  120. },
  121. get fontSizeH3() {
  122. return this.fontSizeBase * 1.4;
  123. },
  124. // Footer
  125. footerHeight: 55,
  126. footerDefaultBg: platform === "ios" ? "#333333" : "#be1522",
  127. footerPaddingBottom: 0,
  128. // FooterTab
  129. tabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
  130. tabBarTextSize: platform === "ios" ? 14 : 11,
  131. activeTab: platform === "ios" ? "#007aff" : "#fff",
  132. sTabBarActiveTextColor: "#007aff",
  133. tabBarActiveTextColor: platform === "ios" ? "#007aff" : "#fff",
  134. tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5",
  135. // Header
  136. toolbarBtnColor: platform === "ios" ? "#be1522" : "#fff",
  137. toolbarDefaultBg: platform === "ios" ? "#333333" : "#be1522",
  138. toolbarHeight: platform === "ios" ? 64 : 56,
  139. toolbarSearchIconSize: platform === "ios" ? 20 : 23,
  140. toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
  141. toolbarPlaceholderColor: platform === "ios" ? "#CECDD2" : "#CECDD2",
  142. searchBarHeight: platform === "ios" ? 30 : 40,
  143. searchBarInputHeight: platform === "ios" ? 30 : 50,
  144. toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff",
  145. toolbarDefaultBorder: platform === "ios" ? "#3f3f3f" : "#ba1f0f",
  146. iosStatusbar: platform === "ios" ? "dark-content" : "light-content",
  147. get statusBarColor() {
  148. return color(this.toolbarDefaultBg)
  149. .darken(0.2)
  150. .hex();
  151. },
  152. get darkenHeader() {
  153. return color(this.tabBgColor)
  154. .darken(0.03)
  155. .hex();
  156. },
  157. // Icon
  158. iconFamily: "Ionicons",
  159. iconFontSize: platform === "ios" ? 30 : 28,
  160. iconHeaderSize: platform === "ios" ? 33 : 24,
  161. // InputGroup
  162. inputFontSize: 17,
  163. inputBorderColor: "#D9D5DC",
  164. inputSuccessBorderColor: "#2b8339",
  165. inputErrorBorderColor: "#ed2f2f",
  166. inputHeightBase: 50,
  167. get inputColor() {
  168. return this.textColor;
  169. },
  170. get inputColorPlaceholder() {
  171. return "#575757";
  172. },
  173. // Line Height
  174. btnLineHeight: 19,
  175. lineHeightH1: 32,
  176. lineHeightH2: 27,
  177. lineHeightH3: 22,
  178. lineHeight: platform === "ios" ? 20 : 24,
  179. listItemSelected: "#be1522",
  180. // List
  181. listBg: "transparent",
  182. listBorderColor: "#3e3e3e",
  183. listDividerBg: "#f4f4f4",
  184. listBtnUnderlayColor: "#3a3a3a",
  185. listItemPadding: platform === "ios" ? 10 : 12,
  186. listNoteColor: "#acacac",
  187. listNoteSize: 13,
  188. // Progress Bar
  189. defaultProgressColor: "#E4202D",
  190. inverseProgressColor: "#1A191B",
  191. // Radio Button
  192. radioBtnSize: platform === "ios" ? 25 : 23,
  193. radioSelectedColorAndroid: "#E4202D",
  194. radioBtnLineHeight: platform === "ios" ? 29 : 24,
  195. get radioColor() {
  196. return "#be1522";
  197. },
  198. // Segment
  199. segmentBackgroundColor: platform === "ios" ? "#F8F8F8" : "#3F51B5",
  200. segmentActiveBackgroundColor: platform === "ios" ? "#007aff" : "#fff",
  201. segmentTextColor: platform === "ios" ? "#007aff" : "#fff",
  202. segmentActiveTextColor: platform === "ios" ? "#fff" : "#3F51B5",
  203. segmentBorderColor: platform === "ios" ? "#007aff" : "#fff",
  204. segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5",
  205. // Spinner
  206. defaultSpinnerColor: "#be1522",
  207. inverseSpinnerColor: "#1A191B",
  208. // Tab
  209. tabDefaultBg: platform === "ios" ? "#333333" : "#be1522",
  210. topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
  211. topTabBarActiveTextColor: platform === "ios" ? "#be1522" : "#fff",
  212. topTabBarBorderColor: platform === "ios" ? "#3f3f3f" : "#fff",
  213. topTabBarActiveBorderColor: platform === "ios" ? "#be1522" : "#fff",
  214. // Tabs
  215. tabBgColor: "#2b2b2b",
  216. tabIconColor: "#fff",
  217. tabFontSize: 15,
  218. // Text
  219. textColor: "#ebebeb",
  220. textDisabledColor: "#5b5b5b",
  221. inverseTextColor: "#000",
  222. noteFontSize: 14,
  223. get defaultTextColor() {
  224. return this.textColor;
  225. },
  226. // Title
  227. titleFontfamily: platform === "ios" ? "System" : "Roboto_medium",
  228. titleFontSize: platform === "ios" ? 17 : 19,
  229. subTitleFontSize: platform === "ios" ? 11 : 14,
  230. subtitleColor: platform === "ios" ? "#8e8e93" : "#FFF",
  231. titleFontColor: platform === "ios" ? "#FFF" : "#FFF",
  232. // CUSTOM
  233. customMaterialIconColor: "#b3b3b3",
  234. fetchedDataSectionListErrorText: "#acacac",
  235. // Calendar/Agenda
  236. agendaBackgroundColor: '#373737',
  237. agendaEmptyLine: '#464646',
  238. // PROXIWASH
  239. proxiwashFinishedColor: "rgba(17,149,32,0.53)",
  240. proxiwashReadyColor: "transparent",
  241. proxiwashRunningColor: "rgba(29,59,175,0.65)",
  242. proxiwashBrokenColor: "#000000",
  243. proxiwashErrorColor: "rgba(213,8,0,0.57)",
  244. // Screens
  245. planningColor: '#d99e09',
  246. proximoColor: '#ec5904',
  247. proxiwashColor: '#1fa5ee',
  248. menuColor: '#b81213',
  249. tutorinsaColor: '#f93943',
  250. // Other
  251. borderRadiusBase: platform === "ios" ? 5 : 2,
  252. borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
  253. contentPadding: 10,
  254. dropdownLinkColor: "#414142",
  255. inputLineHeight: 24,
  256. deviceWidth,
  257. deviceHeight,
  258. isIphoneX,
  259. inputGroupRoundedBorderRadius: 30,
  260. //iPhoneX SafeArea
  261. Inset: {
  262. portrait: {
  263. topInset: 24,
  264. leftInset: 0,
  265. rightInset: 0,
  266. bottomInset: 34
  267. },
  268. landscape: {
  269. topInset: 0,
  270. leftInset: 44,
  271. rightInset: 44,
  272. bottomInset: 21
  273. }
  274. }
  275. };