Skip to content

Commit f61faf3

Browse files
committed
Use warning emoji and set font
1 parent 2d13bef commit f61faf3

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

ts/emoji-favicon-toolkit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function set_emoji_favicon(emoji: any, cacheWithServiceWorker?: a
8282

8383
// Canvas setup
8484
canvas.width = canvas.height = size;
85-
context.font = `normal normal normal ${size}px/${size}px sans-serif`;
85+
context.font = `normal normal normal ${size}px/${size}px apple color emoji, segoe ui emoji, notocoloremoji, segoe ui symbol, android emoji, emojisymbols, emojione mozilla, sans-serif`;
8686
context.textAlign = 'center';
8787
context.textBaseline = 'middle';
8888

ts/zerodrop.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ import set_emoji_favicon from './emoji-favicon-toolkit';
99

1010
function humanFileSize(bytes: number, si: boolean): string {
1111
const thresh = si ? 1000 : 1024;
12-
if(Math.abs(bytes) < thresh) {
12+
if (Math.abs(bytes) < thresh) {
1313
return bytes + ' B';
1414
}
1515
const units = si
16-
? ['KB','MB','GB','TB','PB','EB','ZB','YB']
17-
: ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
16+
? ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
17+
: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
1818
let u = -1;
1919
do {
2020
bytes /= thresh;
2121
++u;
22-
} while(Math.abs(bytes) >= thresh && u < units.length - 1);
23-
return bytes.toFixed(1)+' '+units[u];
22+
} while (Math.abs(bytes) >= thresh && u < units.length - 1);
23+
return bytes.toFixed(1) + ' ' + units[u];
2424
}
2525

2626
$(() => {
@@ -32,26 +32,28 @@ $(() => {
3232
return v.toString(16);
3333
}));
3434
});
35-
35+
3636
// Custom file upload input
3737
$('.zerodrop-file').change((event: JQuery.Event) => {
3838
const element = $(event.currentTarget);
3939
const file = (<FileList>element.prop('files'))[0];
4040
$(element.data('name')).text(`${file.name} (${humanFileSize(file.size, true)})`);
4141
$(element.data('mime')).val(file.type);
4242
});
43-
43+
4444
// New entry tabs
4545
$('.zerodrop-nav').click((event: JQuery.Event) => {
4646
const element = $(event.currentTarget);
4747
element.find('input').prop('checked', true);
4848
});
49-
})
49+
});
5050

51-
const emojis=['\uD83D\uDCA3', '\uD83D\uDD17']
51+
const emojis = ['\u26a0\ufe0f', '\uD83D\uDD17']
5252
let index = 0;
53-
setInterval(() => {
53+
function update_emoji() {
5454
const emoji = emojis[index];
5555
index = (index + 1) % emojis.length;
5656
set_emoji_favicon(emoji);
57-
}, 1333)
57+
}
58+
update_emoji();
59+
setInterval(update_emoji, 1337)

0 commit comments

Comments
 (0)