-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmobile.js
146 lines (119 loc) · 5.66 KB
/
mobile.js
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
var header;
var logo_img;
window.onload = function(){
DetectMobileMode();
//logo_img = document.getElementById("logo_img");
//header = document.getElementsByClassName("navbar")[0];
};
function DetectMobileMode(){
try{
var documentWidthProperty = document.documentElement.clientWidth;
//console.log(documentWidth.toString());
if(documentWidthProperty <= 1000){
$('#navbar-logo').css("position", "relative");
$('#navbar-logo').css("left", "0px");
document.getElementsByClassName("navbar")[0].style.textAlign = "center";
var tweets_list = document.getElementsByClassName("tweet");
if(tweets_list != null){
for(let i = 0; i < tweets_list.length; i++){
console.log(i.toString());
document.getElementsByClassName("tweet")[i].style.width = "320px";
}
}
document.getElementById("desktop_menu").style.visibility = "collapse";
document.getElementById("navbar_separator").style.visibility = "collapse";
document.getElementById("SearchBoxControl").style.visibility = "collapse";
document.getElementById("send_review_button").style.visibility = "collapse";
//Enable mobile shell
$('#mobile-menu-button').css("visibility", "visible");
$('#mobile-search-button').css("visibility", "visible");
$('#page-title').css("font-size", "40px");
$('#app-preview-image').css("top", "100px");
$('#app-preview-image').css("width", "85%");
$('#content').css("width", "100%");
$('#apps-grid').css("width", "320px");
$('#apps-grid').css("padding-left", "20px");
$('#apps-grid').css("padding-right", "20px");
$('#microsoft-edge-text').css("padding-left", "35px");
$('#microsoft-edge-text').css("padding-right", "35px");
$('#microsoft-edge-text').css("top", "45px");
$('#microsoft-edge-content').css("padding-bottom", "135px");
}
else if(documentWidthProperty >= 1000){
$('#navbar-logo').css("position", "relative");
$('#navbar-logo').css("left", "16px");
document.getElementsByClassName("navbar")[0].style.textAlign = "left";
document.getElementById("tweets-div").style.maxWidth = null;
var tweets_list = document.getElementsByClassName("tweet");
if(tweets_list != null){
for(let i = 0; i < tweets_list.length; i++){
console.log(i.toString());
document.getElementsByClassName("tweet")[i].style.width = "auto";
}
}
document.getElementById("desktop_menu").style.visibility = "visible";
document.getElementById("navbar_separator").style.visibility = "visible";
document.getElementById("SearchBoxControl").style.visibility = "visible";
document.getElementById("send_review_button").style.visibility = "visible";
//Disable mobile shell
$('#mobile-menu-button').css("visibility", "collapse");
$('#mobile-search-button').css("visibility", "collapse");
$('#page-title').css("font-size", "60px");
$('#app-preview-image').css("top", "50px");
$('#app-preview-image').css("width", "1000px");
$('#content').css("width", "100%");
$('#apps-grid').css("width", "360px");
$('#apps-grid').css("padding-left", "0px");
$('#apps-grid').css("padding-right", "0px");
$('#microsoft-edge-text').css("padding-left", "135px");
$('#microsoft-edge-text').css("padding-right", "0px");
$('#microsoft-edge-text').css("top", "-75px");
$('#microsoft-edge-content').css("padding-bottom", "30px");
}
if (documentWidthProperty <= 880) {
$('#apps-description').css("padding-left", "35px");
$('#apps-description').css("padding-right", "35px");
$('#apps-description').css("margin-top", "40px");
$('#personalize-text').css("padding-left", "35px");
$('#personalize-text').css("padding-right", "35px");
$('#fast-actions-text').css("padding-left", "35px");
$('#fast-actions-text').css("padding-right", "35px");
$('#fast-actions-text').css("padding-top", "40px");
$('#fast-actions-text').css("top", "35px");
$('#get-gifts-text').css("padding-left", "35px");
$('#get-gifts-text').css("padding-right", "35px");
$('#whats-new-text').css("margin-left", "32px");
$('#whats-new-text').css("margin-right", "32px");
$('#whats-new-text').css("padding-top", "0px");
$('#whats-new-img').css("top", "12px");
$('bing-wallpapers').css("width", "100%");
}
else if (documentWidthProperty >= 880) {
$('#apps-description').css("padding-left", "60px");
$('#apps-description').css("padding-right", "0px");
$('#apps-description').css("margin-top", "-50px");
$('#personalize-text').css("padding-left", "135px");
$('#personalize-text').css("padding-right", "0px");
$('#fast-actions-text').css("padding-left", "90px");
$('#fast-actions-text').css("padding-right", "0px");
$('#fast-actions-text').css("padding-top", "-35px");
$('#fast-actions-text').css("top", "-50px");
$('#get-gifts-text').css("padding-left", "100px");
$('#get-gifts-text').css("padding-right", "0px");
$('#whats-new-text').css("margin-left", "90px");
$('#whats-new-text').css("margin-right", "0px");
$('#whats-new-text').css("padding-top", "0px");
$('#whats-new-img').css("top", "-40px");
$('bing-wallpapers').css("width", "436px");
}
if(documentWidthProperty <= 450){
$('#menu-flyout').css("width", "100%");
}
else if(documentWidthProperty >= 450){
$('#menu-flyout').css("width", "400px");
}
}
catch(e){
console.log(e.toString());
}
}