-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ts
165 lines (163 loc) · 7.39 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import getWindowHeight from "./lib/getWindowHeight";
import getWindowWidth from "./lib/getWindowWidth";
import { getWindowScrollPosX, getWindowScrollPosY } from "./lib/getWindowScrollPos";
import useScrollTo from "./lib/useScrollTo";
import useScrollBy from "./lib/useScrollBy";
const QUERIES = {
// Basic Devices
default: {
MOBILE: `and (min-device-width : 320px) and (max-device-width : 480px)`,
TABLET: `and (min-device-width : 481px) and (max-device-width : 768px)`,
LAPTOP: `and (min-device-width : 769px) and (max-device-width : 1024px)`,
DESKTOP: `and (min-device-width : 1025px) and (max-device-width : 1200px)`,
TV: `and (min-device-width : 1201px)`,
},
// Sized Based on Device models
iOS: {
FOUR: {
LANDSCAPE: `and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape)`,
PORTRAIT: `and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: portrait)`
},
FIVE: {
LANDSCAPE: `and (min-device-width: 320px)
and (max-device-width: 568px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape)`,
PORTRAIT: `and (min-device-width: 320px)
and (max-device-width: 568px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: portrait)`
},
EIGHT: {
PORTRAIT: `and (min-device-width: 375px)
and (max-device-width: 667px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: portrait)`,
LANDSCAPE: `and (min-device-width: 375px)
and (max-device-width: 667px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape)`
},
PLUS: {
PORTRAIT: `and (min-device-width: 414px)
and (max-device-width: 736px)
and (-webkit-min-device-pixel-ratio: 3)
and (orientation: portrait)`,
LANDSCAPE: `and (min-device-width: 414px)
and (max-device-width: 736px)
and (-webkit-min-device-pixel-ratio: 3)
and (orientation: landscape)`
},
X: {
PORTRAIT: `and (min-device-width: 375px)
and (max-device-width: 812px)
and (-webkit-min-device-pixel-ratio: 3)
and (orientation: portrait)`,
LANDSCAPE: `and (min-device-width: 375px)
and (max-device-width: 812px)
and (-webkit-min-device-pixel-ratio: 3)
and (orientation: portrait)`
}
},
SAMSUNG: {
S3: {
PORTRAIT: `and (device-width: 320px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 2)
and (orientation: portrait)`,
LANDSCAPE: `and (device-width: 320px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 2)
and (orientation: landscape)`
},
NOTE3: {
//NOTE: Note 3 Models also contains S4 and S5 Models too
PORTRAIT: `and (device-width: 320px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 3)
and (orientation: portrait)`,
LANDSCAPE: `and (device-width: 320px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 3)
and (orientation: landscape)`
},
S6: {
PORTRAIT: `and (device-width: 360px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 4)
and (orientation: portrait)`,
LANDSCAPE: `and (device-width: 360px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 4)
and (orientation: landscape)`
}
},
TABLETS: {
IPAD: {
MINI: {
// This contains ipad 1, 2, mini and air models too.
PORTRAIT: `and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 1)`,
LANDSCAPE: `and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 1)`
},
IPAD4: {
// This contains ipad 3, 4 and ipad pro 9.7" models too.
PORTRAIT: `and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 2)`,
LANDSCAPE: `and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)`
},
PRO10: {
// IPAD PRO 10.5"
PORTRAIT: `and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 2)`,
LANDSCAPE: `and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)`
},
PRO12: {
PORTRAIT: `and (min-device-width: 1024px)
and (max-device-width: 1024px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 2)`,
LANDSCAPE: `and (min-device-width: 1024px)
and (max-device-width: 1024px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)`
}
}
},
LAPTOP: {
NONRETINA: `and (min-device-width: 1024px)
and (max-device-width: 1024px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 2)`,
RETINA: `and (min-device-width: 1200px)
and (max-device-width: 1600px)
and (-webkit-min-device-pixel-ratio: 2)
and (min-resolution: 192dpi)`
},
};
export { useScrollBy, useScrollTo };
export { getWindowScrollPosX, getWindowScrollPosY };
export { getWindowHeight, getWindowWidth };
export { QUERIES };
export default QUERIES;