5 changed files with 134 additions and 112 deletions
@ -1,31 +1,36 @@ |
|||||
export const material = { |
class AppColors { |
||||
dark: '#212121', |
material = { |
||||
light: '#ffffff', |
dark: '#212121', |
||||
|
light: '#ffffff', |
||||
|
|
||||
//200
|
//200
|
||||
blue200: '#90caf9', |
blue200: '#90caf9', |
||||
|
|
||||
//400
|
//400
|
||||
blue400: '#5c6bc0', |
blue400: '#5c6bc0', |
||||
grey400: '#bdbdbd', |
grey400: '#bdbdbd', |
||||
|
|
||||
//600
|
//600
|
||||
grey600: '#757575', |
grey600: '#757575', |
||||
|
|
||||
//700
|
//700
|
||||
grey700: '#616161', |
grey700: '#616161', |
||||
|
|
||||
//800
|
//800
|
||||
amber800: '#ff8f00', |
amber800: '#ff8f00', |
||||
blue800: '#1565c0', |
blue800: '#1565c0', |
||||
red800: '#c62828', |
red800: '#c62828', |
||||
red800dark: '#7f0000', |
red800dark: '#7f0000', |
||||
grey800: '#424242', |
grey800: '#424242', |
||||
grey800dark: '#1b1b1b', |
grey800dark: '#1b1b1b', |
||||
green800: '#2e7d32', |
green800: '#2e7d32', |
||||
|
} |
||||
|
|
||||
|
fonts = { |
||||
|
dark: '#000000', |
||||
|
light: '#ffffff' |
||||
|
}; |
||||
} |
} |
||||
|
|
||||
export const fonts = { |
const Colors = new AppColors(); |
||||
dark: '#000000', |
export default Colors; |
||||
light: '#ffffff' |
|
||||
}; |
|
@ -1,49 +1,55 @@ |
|||||
import {PixelRatio} from 'react-native'; |
import {PixelRatio} from 'react-native'; |
||||
|
|
||||
const scalar = PixelRatio.getFontScale(); |
class AppFonts { |
||||
|
constructor() { |
||||
function normalizeFont(size) { |
this.scalar = PixelRatio.getFontScale(); |
||||
return size * scalar |
|
||||
}; |
this.headerTitle = { |
||||
|
fam: 'arial', |
||||
export const fonts = { |
size: this.normalizeFont(30), |
||||
headerTitle: { |
} |
||||
fam: 'arial', |
|
||||
size: normalizeFont(30), |
this.sectionHeader = { |
||||
}, |
fam: 'arial', |
||||
|
size: this.normalizeFont(26), |
||||
sectionHeader: { |
} |
||||
fam: 'arial', |
|
||||
size: normalizeFont(26), |
this.large = { |
||||
}, |
fam: 'arial', |
||||
|
size: this.normalizeFont(22), |
||||
large: { |
} |
||||
fam: 'arial', |
|
||||
size: normalizeFont(22), |
this.medium = { |
||||
}, |
fam: 'arial', |
||||
|
size: this.normalizeFont(20), |
||||
medium: { |
} |
||||
fam: 'arial', |
|
||||
size: normalizeFont(20), |
this.small = { |
||||
}, |
fam: 'arial', |
||||
|
size: this.normalizeFont(16), |
||||
small: { |
} |
||||
fam: 'arial', |
|
||||
size: normalizeFont(16), |
this.tiny = { |
||||
}, |
fam: 'arial', |
||||
|
size: this.normalizeFont(14), |
||||
tiny: { |
} |
||||
fam: 'arial', |
|
||||
size: normalizeFont(14), |
this.mini = { |
||||
}, |
fam: 'arial', |
||||
|
size: this.normalizeFont(10), |
||||
mini: { |
} |
||||
fam: 'arial', |
|
||||
size: normalizeFont(10), |
this.subFont = { |
||||
}, |
fam: 'arial', |
||||
|
size: this.normalizeFont(8), |
||||
subFont: { |
} |
||||
fam: 'arial', |
} |
||||
size: normalizeFont(8), |
|
||||
}, |
normalizeFont(size) { |
||||
|
let newSize = size * this.scalar; |
||||
|
return newSize; |
||||
|
}; |
||||
} |
} |
||||
|
|
||||
|
const Fonts = new AppFonts(); |
||||
|
export default Fonts; |
@ -1,5 +1,10 @@ |
|||||
export const squareIcons = { |
class AppIcons { |
||||
settings: 'cog-outline', |
squareIcons = { |
||||
toggleOn: 'toggle-switch-on', |
settings: 'cog-outline', |
||||
toggleOfff: 'toggle-switch-off' |
toggleOn: 'toggle-switch-on', |
||||
}; |
toggleOfff: 'toggle-switch-off' |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
const Icons = new AppIcons(); |
||||
|
export default Icons; |
@ -1,25 +1,35 @@ |
|||||
import { PixelRatio, Dimensions } from "react-native"; |
import { PixelRatio, Dimensions } from "react-native"; |
||||
|
|
||||
let scalar = PixelRatio.get(); |
class AppMetrics { |
||||
|
constructor(dimensions = Dimensions.get('window')) { |
||||
|
this.scalar = PixelRatio.get(); |
||||
|
|
||||
function normalize(size){ |
let height = dimensions.height; |
||||
return (size * scalar); |
let width = dimensions.width; |
||||
} |
|
||||
|
|
||||
let dimensions = Dimensions.get('window'); |
|
||||
|
|
||||
let height = dimensions.height; |
if (width > height) { |
||||
let width = dimensions.width; |
this.screenHeight = width; |
||||
|
this.screenWidth = height; |
||||
|
} else { |
||||
|
this.screenWidth = width; |
||||
|
this.screenHeight = height; |
||||
|
} |
||||
|
} |
||||
|
|
||||
let screenWidth = width; |
normalize(size){ |
||||
let screenHeight = height; |
return (size * this.scalar); |
||||
|
} |
||||
|
|
||||
if (width > height) { |
screenSections = { |
||||
screenHeight = width; |
headerHeight: this.normalize(20), |
||||
screenWidth = height; |
sectionWidth: this.screenWidth |
||||
|
} |
||||
} |
} |
||||
|
|
||||
export const screenSections = { |
const Metrics = new AppMetrics(); |
||||
headerHeight: normalize(20), |
export default Metrics; |
||||
sectionWidth: screenWidth |
|
||||
|
export function buildTestMetrics(dimensions){ |
||||
|
const Metrics = new AppMetrics(dimensions); |
||||
|
return Metrics; |
||||
} |
} |
Loading…
Reference in new issue