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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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: platform === "ios" ? "#be1522" : "#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" ? "#F8F8F8" : "#3F51B5",
  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. searchBarHeight: platform === "ios" ? 30 : 40,
  142. searchBarInputHeight: platform === "ios" ? 30 : 50,
  143. toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff",
  144. toolbarDefaultBorder: platform === "ios" ? "#3f3f3f" : "#ba1f0f",
  145. iosStatusbar: platform === "ios" ? "dark-content" : "light-content",
  146. get statusBarColor() {
  147. return color(this.toolbarDefaultBg)
  148. .darken(0.2)
  149. .hex();
  150. },
  151. get darkenHeader() {
  152. return color(this.tabBgColor)
  153. .darken(0.03)
  154. .hex();
  155. },
  156. // Icon
  157. iconFamily: "Ionicons",
  158. iconFontSize: platform === "ios" ? 30 : 28,
  159. iconHeaderSize: platform === "ios" ? 33 : 24,
  160. // InputGroup
  161. inputFontSize: 17,
  162. inputBorderColor: "#D9D5DC",
  163. inputSuccessBorderColor: "#2b8339",
  164. inputErrorBorderColor: "#ed2f2f",
  165. inputHeightBase: 50,
  166. get inputColor() {
  167. return this.textColor;
  168. },
  169. get inputColorPlaceholder() {
  170. return "#575757";
  171. },
  172. // Line Height
  173. btnLineHeight: 19,
  174. lineHeightH1: 32,
  175. lineHeightH2: 27,
  176. lineHeightH3: 22,
  177. lineHeight: platform === "ios" ? 20 : 24,
  178. listItemSelected: "#be1522",
  179. // List
  180. listBg: "transparent",
  181. listBorderColor: "#3e3e3e",
  182. listDividerBg: "#f4f4f4",
  183. listBtnUnderlayColor: "#DDD",
  184. listItemPadding: platform === "ios" ? 10 : 12,
  185. listNoteColor: "#acacac",
  186. listNoteSize: 13,
  187. // Progress Bar
  188. defaultProgressColor: "#E4202D",
  189. inverseProgressColor: "#1A191B",
  190. // Radio Button
  191. radioBtnSize: platform === "ios" ? 25 : 23,
  192. radioSelectedColorAndroid: "#E4202D",
  193. radioBtnLineHeight: platform === "ios" ? 29 : 24,
  194. get radioColor() {
  195. return "#be1522";
  196. },
  197. // Segment
  198. segmentBackgroundColor: platform === "ios" ? "#F8F8F8" : "#3F51B5",
  199. segmentActiveBackgroundColor: platform === "ios" ? "#007aff" : "#fff",
  200. segmentTextColor: platform === "ios" ? "#007aff" : "#fff",
  201. segmentActiveTextColor: platform === "ios" ? "#fff" : "#3F51B5",
  202. segmentBorderColor: platform === "ios" ? "#007aff" : "#fff",
  203. segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5",
  204. // Spinner
  205. defaultSpinnerColor: "#be1522",
  206. inverseSpinnerColor: "#1A191B",
  207. // Tab
  208. tabDefaultBg: platform === "ios" ? "#333333" : "#be1522",
  209. topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
  210. topTabBarActiveTextColor: platform === "ios" ? "#be1522" : "#fff",
  211. topTabBarBorderColor: platform === "ios" ? "#3f3f3f" : "#fff",
  212. topTabBarActiveBorderColor: platform === "ios" ? "#be1522" : "#fff",
  213. // Tabs
  214. tabBgColor: "#2b2b2b",
  215. tabIconColor: "#fff",
  216. tabFontSize: 15,
  217. // Text
  218. textColor: "#ebebeb",
  219. textDisabledColor: "#3b3f42",
  220. inverseTextColor: "#000",
  221. noteFontSize: 14,
  222. get defaultTextColor() {
  223. return this.textColor;
  224. },
  225. // Title
  226. titleFontfamily: platform === "ios" ? "System" : "Roboto_medium",
  227. titleFontSize: platform === "ios" ? 17 : 19,
  228. subTitleFontSize: platform === "ios" ? 11 : 14,
  229. subtitleColor: platform === "ios" ? "#8e8e93" : "#FFF",
  230. titleFontColor: platform === "ios" ? "#FFF" : "#FFF",
  231. // CUSTOM
  232. customMaterialIconColor: "#b3b3b3",
  233. fetchedDataSectionListErrorText: "#acacac",
  234. // Calendar/Agenda
  235. agendaBackgroundColor: '#373737',
  236. agendaEmptyLine: '#464646',
  237. // PROXIWASH
  238. proxiwashFinishedColor: "rgba(17,149,32,0.53)",
  239. proxiwashReadyColor: "transparent",
  240. proxiwashRunningColor: "rgba(29,59,175,0.65)",
  241. proxiwashBrokenColor: "#000000",
  242. proxiwashErrorColor: "rgba(213,8,0,0.57)",
  243. // Other
  244. borderRadiusBase: platform === "ios" ? 5 : 2,
  245. borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
  246. contentPadding: 10,
  247. dropdownLinkColor: "#414142",
  248. inputLineHeight: 24,
  249. deviceWidth,
  250. deviceHeight,
  251. isIphoneX,
  252. inputGroupRoundedBorderRadius: 30,
  253. //iPhoneX SafeArea
  254. Inset: {
  255. portrait: {
  256. topInset: 24,
  257. leftInset: 0,
  258. rightInset: 0,
  259. bottomInset: 34
  260. },
  261. landscape: {
  262. topInset: 0,
  263. leftInset: 44,
  264. rightInset: 44,
  265. bottomInset: 21
  266. }
  267. }
  268. };