代码拉取完成,页面将自动刷新
同步操作将从 rubickCenter/rubick-suspension 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const fs = require('fs');
const { ipcRenderer } = require('electron')
let imgKey = window.location.hash.substring(1);
console.log(333, imgKey, localStorage.getItem(imgKey));
const mineMap = {
"image/bmp" : "bmp",
"image/gif" : "gif",
"image/heic" : "heic",
"image/jpeg" : "jpeg",
"image/jpeg" : "jpg",
"image/jpeg" : "jpe",
"image/png" : "png",
"image/svg+xml" : "svg",
"image/webp" : "webp",
"image/x-icon" : "ico"
}
// window.isMac = rubick.isMacOs();
let winId;
ipcRenderer.on('init', (event, args) => {
if (args && args.img) {
let img = document.querySelector("img")
img.src = args.img;
}
winId = event.senderId;
});
window.toEdit = () => {
ipcRenderer.sendTo(winId, 'toEdit');
}
window.resize = (changed, proportion) => {
ipcRenderer.sendTo(winId, 'resize', changed, proportion);
}
window.moveBounds = (x, y, width, height) => {
ipcRenderer.sendTo(winId, 'moveBounds', x, y, width, height);
}
/**
* 拷贝当前图片,借助窗口截图实现
*/
window.copyNowImage = () => {
ipcRenderer.sendTo(winId, 'copyNowImage');
}
/*
* 保存当前图片,借助窗口截图实现
*/
window.saveNowImage = () => {
ipcRenderer.sendTo(winId, 'saveNowImage');
}
ipcRenderer.on('reduction', (event) => {
document.body.className = "body-hover"
})
window.modifyOpacity = (op) => {
ipcRenderer.sendTo(winId, 'modifyOpacity',op);
}
ipcRenderer.on('will-resize', (event, newBounds) => {
//只能按比例缩放图片
let img = window.document.querySelector("img");
img.style.width = '100%';
img.style.height = '100%';
let scale = img.width / (img.height * 1.0)
let height = newBounds.width / scale;
// console.log(window, newBounds.width, newBounds.height);
window.resizeTo(newBounds.width, Math.min(newBounds.height, height));
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。