Skip to content

Commit e6b9fde

Browse files
[FIX] ios + firefox fix #5
1 parent c105809 commit e6b9fde

File tree

9 files changed

+130
-41
lines changed

9 files changed

+130
-41
lines changed

public/img/icon/apps/discord.png

1.08 KB
Loading

public/img/icon/apps/twitter.png

551 Bytes
Loading

public/img/icon/apps/unescape.png

9.21 KB
Loading

src/components/widgets/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const MinimalClock = () => {
6969
const time = useSelector((state) => state.global.time);
7070

7171
return (
72-
<div className="digital-time-container items-center">
72+
<div className="digital-time-container">
7373
<div className="flex items-baseline">
7474
<div className="text-4xl">{time.hours}:{time.minutes}</div>
7575
<div className="text-xs ml-1">{time.abb}</div>

src/components/widgets/widget.scss

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,16 @@
7575

7676
.digital-time-container,
7777
.vert-time-container {
78-
padding: 0 1em;
78+
width: 100%;
7979
display: flex;
8080
flex-direction: column;
81+
align-items: center;
8182
color: var(--med-txt);
8283
}
8384

84-
.vert-time-container {
85-
box-sizing: border-box;
86-
width: 96%;
85+
.vert-time-container > div {
86+
width: 100%;
87+
padding: 0 1em;
8788
}
8889

8990
.cell-container {
@@ -178,7 +179,7 @@
178179
border-radius: 1em;
179180
}
180181

181-
.weather-container{
182+
.weather-container {
182183
box-sizing: border-box;
183184
background: #fefefe;
184185
border-radius: 1em;
@@ -193,56 +194,56 @@
193194
overflow-x: hidden;
194195
overflow-y: scroll;
195196

196-
.city-container{
197+
.city-container {
197198
display: flex;
198199

199-
span{
200+
span {
200201
font-size: 1rem;
201202
}
202203
}
203204

204-
.weather-date{
205+
.weather-date {
205206
font-size: 0.9em;
206207
font-weight: 100;
207208
color: var(--gray-txt);
208209
}
209210

210-
.main-weather{
211+
.main-weather {
211212
display: flex;
212213
align-items: center;
213214
flex-grow: 1;
214215
}
215216

216-
.today-temperature{
217+
.today-temperature {
217218
font-size: 3em;
218219
font-weight: 100;
219220
margin-left: 0.3em;
220221
}
221222

222-
.weather-pred-container{
223+
.weather-pred-container {
223224
display: flex;
224225
justify-content: space-between;
225226

226-
.weather-pred{
227+
.weather-pred {
227228
margin: 0 0.8em;
228229
display: flex;
229230
flex-direction: column;
230231
align-items: center;
231232
}
232233

233-
.pred-day{
234+
.pred-day {
234235
font-size: 0.8em;
235236
}
236237
}
237238
}
238239

239-
.short-weather-container{
240-
.today-temperature{
240+
.short-weather-container {
241+
.today-temperature {
241242
font-size: 2.5em;
242243
margin-left: 0.1em;
243244
}
244245

245-
.main-weather .uicon{
246+
.main-weather .uicon {
246247
height: 100%;
247248
}
248249
}

src/containers/home/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function Home() {
3434
dispatchAct({type: "quickpanel/open"});
3535
}
3636

37-
if(true){
37+
if(process.env.REACT_APP_ENV!="development"){
3838
if (navigator.userAgentData){
3939
document.documentElement.requestFullscreen();
4040
}

src/store/actions/data/apps.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ var apps = [
3535
icon: 'contacts',
3636
type: 'app'
3737
},
38+
{
39+
name: 'Discord',
40+
icon: 'discord',
41+
type: 'app',
42+
action: 'home/openLink',
43+
payload: 'https://discord.gg/NcjaNdwtnR'
44+
},
3845
{
3946
name: 'Docs',
4047
icon: 'docs',
@@ -81,6 +88,8 @@ var apps = [
8188
name: 'Gmail',
8289
icon: 'gmail',
8390
type: 'app',
91+
action: 'home/openLink',
92+
payload: 'mailto:[email protected]',
8493
padd: true
8594
},
8695
{
@@ -280,19 +289,36 @@ var apps = [
280289
icon: 'sstranslate',
281290
type: 'app'
282291
},
292+
{
293+
name: 'Unescape',
294+
icon: 'unescape',
295+
type: 'app',
296+
action: 'home/openLink',
297+
payload: 'https://blueedge.me/unescape'
298+
},
283299
{
284300
name: 'Videos',
285301
icon: 'ssvideo',
286302
type: 'app'
287-
},{
303+
},
304+
{
288305
name: 'Translate',
289306
icon: 'translate',
290307
type: 'app'
291-
},{
308+
},
309+
{
310+
name: 'Twitter',
311+
icon: 'twitter',
312+
type: 'app',
313+
action: 'home/openLink',
314+
payload: 'https://twitter.com/blueedgetechno'
315+
},
316+
{
292317
name: 'WhatsApp',
293318
icon: 'whatsapp',
294319
type: 'app'
295-
},{
320+
},
321+
{
296322
name: 'Youtube',
297323
icon: 'youtube',
298324
type: 'app',

src/store/actions/data/preset.js

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1-
import apps from './apps';
1+
import apps from './apps'
2+
3+
const srandom = (seed)=>{
4+
var x = Math.sin(seed++) * 10000
5+
return x - Math.floor(x)
6+
}
7+
8+
const shuffle = (arr, seed)=>{
9+
var m = arr.length, t, i
10+
while (m) {
11+
i = Math.floor(srandom(seed) * m--)
12+
t = arr[m]
13+
arr[m] = arr[i]
14+
arr[i] = t
15+
++seed
16+
}
17+
18+
return arr
19+
}
220

321
export const favbar = [
4-
"ssphone", "github","settings","whatsapp"
22+
"twitter", "github","settings","whatsapp"
523
]
624

725
export const page1wid = [
@@ -13,7 +31,7 @@ export const page1wid = [
1331
]
1432

1533
export const page2wid = [
16-
[5,7,1,3,"DayCountdown"]
34+
[4,6,1,3,"DayCountdown"]
1735
]
1836

1937
export const page3wid = [
@@ -25,15 +43,24 @@ export const page4wid = [
2543
]
2644

2745
const page1arr = [
28-
"playstore", "youtube", "google", "buyme"
46+
"playstore", "youtube", "google", "unescape"
47+
]
48+
49+
const page2arr = [
50+
"ssphone", "gmail", "discord", "buyme"
2951
]
3052

3153
export const page1apps = apps.filter(x => page1arr.includes(x.icon)).sort((a, b) => {
32-
return page1arr.indexOf(a.icon) > page1arr.indexOf(b.icon) ? 1 : -1;
33-
});
54+
return page1arr.indexOf(a.icon) > page1arr.indexOf(b.icon) ? 1 : -1
55+
})
56+
57+
export const page2bar = apps.filter(x => page2arr.includes(x.icon)).sort((a, b) => {
58+
return page2arr.indexOf(a.icon) > page2arr.indexOf(b.icon) ? 1 : -1
59+
})
3460

35-
var remapps = apps.filter(x => !page1arr.includes(x.icon) && !favbar.includes(x.icon))
36-
.sort((a,b)=> 2*Math.random() - 1).sort((a,b)=> 2*Math.random() - 1)
61+
var remapps = shuffle(apps.filter(x => {
62+
return !page1arr.includes(x.icon) && !page2arr.includes(x.icon) && !favbar.includes(x.icon)
63+
}), new Date().getFullYear())
3764

38-
export const page2apps = [...remapps.slice(0,16)];
39-
export const page3apps = [...remapps.slice(16,24)];
65+
export const page2apps = [...remapps.slice(0,12)]
66+
export const page3apps = [...remapps.slice(12,20)]

src/store/actions/index.js

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import apps from './data/apps';
33
import {
44
favbar,
55
page1apps,
6+
page2bar,
67
page2apps,
78
page3apps,
89
page1wid,
@@ -19,6 +20,24 @@ import youtube_data from './data/youtube.json';
1920
const {round, floor, random, min, max, abs} = Math;
2021

2122
export const gene_name = (x=10) => random().toString(36).substring(2, x).toLowerCase()
23+
export const srandom = (seed)=>{
24+
var x = Math.sin(seed++) * 10000
25+
return x - Math.floor(x)
26+
}
27+
28+
export const shuffle = (arr, seed)=>{
29+
var m = arr.length, t, i
30+
while (m) {
31+
i = Math.floor(srandom(seed) * m--)
32+
t = arr[m]
33+
arr[m] = arr[i]
34+
arr[i] = t
35+
++seed
36+
}
37+
38+
return arr
39+
}
40+
2241
export const dispatchAction = (e) => {
2342
var action = {
2443
type: e.target.dataset.action,
@@ -41,16 +60,22 @@ export const openAppPage = (id, page) => {
4160
}
4261

4362
export const fetchBatteryStatus = () => {
44-
var battery = navigator.getBattery();
45-
battery.then((battery) => {
46-
store.dispatch({
47-
type: "global/battery",
48-
payload: {
49-
charging: battery.charging,
50-
level: battery.level,
51-
},
52-
});
53-
});
63+
try{
64+
var battery = navigator.getBattery()
65+
if(battery){
66+
battery.then((battery) => {
67+
store.dispatch({
68+
type: "global/battery",
69+
payload: {
70+
charging: battery.charging,
71+
level: battery.level,
72+
},
73+
})
74+
})
75+
}
76+
}catch(e){
77+
78+
}
5479
}
5580

5681
export const fillZero = (x)=>{
@@ -192,6 +217,16 @@ export const loadApps = ()=>{
192217
}
193218
}
194219

220+
// page 2 bar
221+
for (var i = 0; i < page2bar.length; i++) {
222+
homelist[page2bar[i].icon] = {
223+
page: 2,
224+
type: 'app',
225+
row: [6, 7],
226+
col: [(i%4)+1,(i%4)+2]
227+
}
228+
}
229+
195230
// page 2 widgets
196231
for (var i = 0; i < page2wid.length; i++) {
197232
homelist[gene_name()] = {

0 commit comments

Comments
 (0)