🎨 优化代码

This commit is contained in:
Tw93
2023-01-14 00:14:41 +08:00
parent 17cc904761
commit f8ec4f8fb4
2 changed files with 4 additions and 6 deletions

View File

@@ -153,10 +153,7 @@ fn main() -> wry::Result<()> {
.to_path_buf();
*default_path = path.clone();
let submitted = proxy
.send_event(UserEvent::DownloadStarted(
uri,
path.display().to_string(),
))
.send_event(UserEvent::DownloadStarted(uri, path.display().to_string()))
.is_ok();
submitted
}

View File

@@ -375,11 +375,12 @@ function Toast(msg) {
m.style.cssText = "max-width:60%;min-width: 180px;padding:0 8px;height: 36px;color: rgb(255, 255, 255);line-height: 36px;text-align: center;border-radius: 4px;position: fixed;bottom:16px;right: 16px;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.9);font-size: 14px;";
document.body.appendChild(m);
setTimeout(function() {
const d = 0.5;
m.style.transition = 'transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
m.style.opacity = '0';
setTimeout(function() {
document.body.removeChild(m)
}, 500);
}, 3000);
}, d * 1000);
}, 2500);
}