forked from Swap76/Learn-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBOM_functions.js
More file actions
59 lines (56 loc) · 1.93 KB
/
Copy pathBOM_functions.js
File metadata and controls
59 lines (56 loc) · 1.93 KB
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
/* eslint-disable no-multi-spaces */
/* eslint-disable no-unused-vars */
// window is the global variable for Browser environment
// to achive it user just need to type window
/**
* sceen object contains main information about user device screen
* in modern world sites mostly relate to adaptive layout and rarery use such client information
* @return {availHeight} height of the screen in pixels without displayed user features (taskbar, etc.)
* @return {availWidth} amount of horizontal space in pixels available to the window
* @return {colorDepth} color depth of the screen.
* @return {height} height of the screen in pixels
* @return {width} width of the screen
* @return {orientation} ScreenOrientation instance with this screen
* @return {pixelDepth} bit depth of the screen
* Not standardized API
* @return {availLeft} the first available pixel available from the left side of the screen
* @return {availTop} the first available pixel available from the top side of the screen
*/
const {
availHeight,
availWidth,
colorDepth,
height,
width,
pixelDepth,
orientation,
availLeft,
availTop
} = window.screen;
/**
* window location is object provides interface and API to handle client url
* @return {assign} method to manual switch to another url location.assign(path_to_page)
* @return {reload} method to manual reload page(forse reload)
* @return {replace} method similar to assign
* @return {hash} field represent data in URL after #(hash) symbol
* @return {host} host value
* @return {hostname} host-name value
* @return {href} path to existed page
* @return {pathname} string from domen name to the existed page
* @return {port} port where page is places
* @return {protocol} network protocol http/s/2
* @return {search} get params of the page
*/
const {
assign,
reload,
replace,
hash,
host,
hostname,
href,
pathname,
port,
protocol,
search
} = window.location;