Skip to content

Commit be98145

Browse files
author
bajins
committed
优化冗余
1 parent 0024650 commit be98145

File tree

4 files changed

+15
-362
lines changed

4 files changed

+15
-362
lines changed

static/js/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ function getKey() {
125125
html = html + "<p><b>key:</b><pre style='background: black;color:#66FF66;padding:5%;'>" + result.data.key + "</pre></p><hr /></div>";
126126
if (result.code == 200) {
127127
let area_width = "30%";
128-
if (device.isMobile) {
128+
if (window.innerWidth <= 419) {
129129
area_width = "80%";
130+
} else if (window.innerWidth <= 768) {
131+
area_width = "50%";
130132
}
131133
//自定页
132134
layer.open({
@@ -186,8 +188,10 @@ function netSarangDownload() {
186188
"<p><a href='" + result.data.url + "' target='_blank'>" + result.data.url + "</a></p>" +
187189
"</div>";
188190
let area_width = "40%";
189-
if (device.isMobile) {
191+
if (window.innerWidth <= 419) {
190192
area_width = "80%";
193+
} else if (window.innerWidth <= 768) {
194+
area_width = "50%";
191195
}
192196
//自定页
193197
layer.open({
@@ -383,8 +387,10 @@ function activateBeautifierListener(contents, indentCode, indentation) {
383387
function beautifySuccess(contents) {
384388
let html = "<pre style='background: black;color:#66FF66;width: 100%;height: 100%;margin: 0px;padding: 10px;'>" + contents + "</pre>";
385389
let area_width = "60%";
386-
if (device.isMobile) {
390+
if (window.innerWidth <= 419) {
387391
area_width = "95%";
392+
} else if (window.innerWidth <= 768) {
393+
area_width = "80%";
388394
}
389395
//自定页
390396
layer.open({

static/js/utils/device.js

Lines changed: 0 additions & 355 deletions
This file was deleted.

0 commit comments

Comments
 (0)