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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. // @flow
  2. import color from "color";
  3. import { Platform, Dimensions, PixelRatio } 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: "#363636",
  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" ? "#e42612" : "#e42612",
  99. brandInfo: "#62B1F6",
  100. brandSuccess: "#5cb85c",
  101. brandDanger: "#d9534f",
  102. brandWarning: "#f0ad4e",
  103. brandDark: "#000",
  104. brandLight: "#f4f4f4",
  105. //Container
  106. containerBgColor: "#333333",
  107. //Date Picker
  108. datePickerTextColor: "#fff",
  109. datePickerBg: "transparent",
  110. // Font
  111. DefaultFontSize: 16,
  112. fontFamily: platform === "ios" ? "System" : "Roboto",
  113. fontSizeBase: 15,
  114. get fontSizeH1() {
  115. return this.fontSizeBase * 1.8;
  116. },
  117. get fontSizeH2() {
  118. return this.fontSizeBase * 1.6;
  119. },
  120. get fontSizeH3() {
  121. return this.fontSizeBase * 1.4;
  122. },
  123. // Footer
  124. footerHeight: 55,
  125. footerDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5",
  126. footerPaddingBottom: 0,
  127. // FooterTab
  128. tabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
  129. tabBarTextSize: platform === "ios" ? 14 : 11,
  130. activeTab: platform === "ios" ? "#007aff" : "#fff",
  131. sTabBarActiveTextColor: "#007aff",
  132. tabBarActiveTextColor: platform === "ios" ? "#007aff" : "#fff",
  133. tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5",
  134. // Header
  135. toolbarBtnColor: platform === "ios" ? "#e42612" : "#fff",
  136. toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#e42612",
  137. toolbarHeight: platform === "ios" ? 64 : 56,
  138. toolbarSearchIconSize: platform === "ios" ? 20 : 23,
  139. toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
  140. searchBarHeight: platform === "ios" ? 30 : 40,
  141. searchBarInputHeight: platform === "ios" ? 30 : 50,
  142. toolbarBtnTextColor: platform === "ios" ? "#e42612" : "#fff",
  143. toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f",
  144. iosStatusbar: platform === "ios" ? "dark-content" : "light-content",
  145. get statusBarColor() {
  146. return color(this.toolbarDefaultBg)
  147. .darken(0.2)
  148. .hex();
  149. },
  150. get darkenHeader() {
  151. return color(this.tabBgColor)
  152. .darken(0.03)
  153. .hex();
  154. },
  155. // Icon
  156. iconFamily: "Ionicons",
  157. iconFontSize: platform === "ios" ? 30 : 28,
  158. iconHeaderSize: platform === "ios" ? 33 : 24,
  159. // InputGroup
  160. inputFontSize: 17,
  161. inputBorderColor: "#D9D5DC",
  162. inputSuccessBorderColor: "#2b8339",
  163. inputErrorBorderColor: "#ed2f2f",
  164. inputHeightBase: 50,
  165. get inputColor() {
  166. return this.textColor;
  167. },
  168. get inputColorPlaceholder() {
  169. return "#575757";
  170. },
  171. // Line Height
  172. btnLineHeight: 19,
  173. lineHeightH1: 32,
  174. lineHeightH2: 27,
  175. lineHeightH3: 22,
  176. lineHeight: platform === "ios" ? 20 : 24,
  177. listItemSelected: platform === "ios" ? "#e42612" : "#e42612",
  178. // List
  179. listBg: "transparent",
  180. listBorderColor: "#727272",
  181. listDividerBg: "#f4f4f4",
  182. listBtnUnderlayColor: "#DDD",
  183. listItemPadding: platform === "ios" ? 10 : 12,
  184. listNoteColor: "#acacac",
  185. listNoteSize: 13,
  186. // Progress Bar
  187. defaultProgressColor: "#E4202D",
  188. inverseProgressColor: "#1A191B",
  189. // Radio Button
  190. radioBtnSize: platform === "ios" ? 25 : 23,
  191. radioSelectedColorAndroid: "#E4202D",
  192. radioBtnLineHeight: platform === "ios" ? 29 : 24,
  193. get radioColor() {
  194. return this.brandPrimary;
  195. },
  196. // Segment
  197. segmentBackgroundColor: platform === "ios" ? "#F8F8F8" : "#3F51B5",
  198. segmentActiveBackgroundColor: platform === "ios" ? "#007aff" : "#fff",
  199. segmentTextColor: platform === "ios" ? "#007aff" : "#fff",
  200. segmentActiveTextColor: platform === "ios" ? "#fff" : "#3F51B5",
  201. segmentBorderColor: platform === "ios" ? "#007aff" : "#fff",
  202. segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5",
  203. // Spinner
  204. defaultSpinnerColor: "#45D56E",
  205. inverseSpinnerColor: "#1A191B",
  206. // Tab
  207. tabDefaultBg: platform === "ios" ? "#2b2b2b" : "#e42612",
  208. topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
  209. topTabBarActiveTextColor: platform === "ios" ? "#e42612" : "#fff",
  210. topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff",
  211. topTabBarActiveBorderColor: platform === "ios" ? "#e42612" : "#fff",
  212. // Tabs
  213. tabBgColor: "#2b2b2b",
  214. tabFontSize: 15,
  215. // Text
  216. textColor: "#d6d6d6",
  217. inverseTextColor: "#000",
  218. noteFontSize: 14,
  219. get defaultTextColor() {
  220. return this.textColor;
  221. },
  222. // Title
  223. titleFontfamily: platform === "ios" ? "System" : "Roboto_medium",
  224. titleFontSize: platform === "ios" ? 17 : 19,
  225. subTitleFontSize: platform === "ios" ? 11 : 14,
  226. subtitleColor: platform === "ios" ? "#8e8e93" : "#FFF",
  227. titleFontColor: platform === "ios" ? "#000" : "#FFF",
  228. // CUSTOM
  229. customMaterialIconColor: "#b3b3b3",
  230. // PROXIWASH
  231. proxiwashFinishedColor: "rgba(12,157,13,0.72)",
  232. proxiwashReadyColor: "transparent",
  233. proxiwashRunningColor: "rgba(29,59,175,0.65)",
  234. proxiwashBrokenColor: "#000000",
  235. proxiwashErrorColor: "rgba(213,8,0,0.57)",
  236. // Other
  237. borderRadiusBase: platform === "ios" ? 5 : 2,
  238. borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
  239. contentPadding: 10,
  240. dropdownLinkColor: "#414142",
  241. inputLineHeight: 24,
  242. deviceWidth,
  243. deviceHeight,
  244. isIphoneX,
  245. inputGroupRoundedBorderRadius: 30,
  246. //iPhoneX SafeArea
  247. Inset: {
  248. portrait: {
  249. topInset: 24,
  250. leftInset: 0,
  251. rightInset: 0,
  252. bottomInset: 34
  253. },
  254. landscape: {
  255. topInset: 0,
  256. leftInset: 44,
  257. rightInset: 44,
  258. bottomInset: 21
  259. }
  260. }
  261. };