Files
lyroc/electron-app/unlock.html
2025-05-27 14:16:48 +08:00

99 lines
2.7 KiB
HTML

<!--
* @Date: 2025-05-06 18:27:32
* @LastEditors: 陈子健
* @LastEditTime: 2025-05-07 10:24:07
* @FilePath: /mac-lyric-vue/electron-app/unlock.html
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>解锁窗口</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
margin: 0;
padding: 0;
background-color: transparent;
overflow: hidden;
user-select: none;
}
.unlock-container {
width: 48px;
height: 48px;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.4);
border-radius: 50%;
cursor: pointer;
transition: background-color 0.3s ease;
}
.unlock-container:hover {
background-color: rgba(0, 0, 0, 0.6);
}
.lock-icon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
transition: opacity 0.3s ease;
}
.icon-locked {
opacity: 1;
}
.icon-unlocked {
opacity: 0;
}
.unlock-container:hover .icon-locked {
opacity: 0;
}
.unlock-container:hover .icon-unlocked {
opacity: 1;
}
svg {
width: 24px;
height: 24px;
}
</style>
</head>
<body>
<div class="unlock-container" id="unlockBtn">
<div class="lock-icon icon-locked">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="white" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>
</svg>
</div>
<div class="lock-icon icon-unlocked">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="white" d="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z"/>
</svg>
</div>
</div>
<script>
// 引入electron模块
const { ipcRenderer } = require('electron');
// 直接将点击事件添加到整个文档
document.addEventListener('click', () => {
console.log('解锁按钮被点击');
// 发送解锁事件到主进程
ipcRenderer.send('unlock-window');
});
</script>
</body>
</html>