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 9.5KB

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