-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f7d274
commit 220f0be
Showing
5 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh-hans"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>雀魂Plus</title> | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
body { | ||
overflow: hidden; | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
#mainWindow { | ||
overflow: hidden; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
#mainWindowBox { | ||
overflow: hidden; | ||
display: block; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="mainWindowBox"> | ||
<webview id="mainWindow" src="./loading,html"></webview> | ||
</div> | ||
<script src="./mainLoader.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh-hans"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>雀魂Plus</title> | ||
<style> | ||
body { | ||
height: 100vh; | ||
width: 100vw; | ||
overflow: hidden; | ||
background-color: #000; | ||
background-image: url('./logo.svg'); | ||
background-size: cover; | ||
background-repeat: no-repeat; | ||
} | ||
</style> | ||
</head> | ||
<body></body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*eslint no-console: ["error", { allow: ["warn", "error"] }] */ | ||
|
||
const electron = require('electron') | ||
const { ipcRenderer } = electron | ||
|
||
/** | ||
* @type {Electron.WebviewTag} | ||
*/ | ||
const mainWindow = document.getElementById('mainWindow') | ||
|
||
/** | ||
* @type {HTMLDivElement} | ||
*/ | ||
const mainWindowBox = document.getElementById('mainWindowBox') | ||
|
||
const scalePercent = 400 | ||
|
||
ipcRenderer.on('load-url', (event, ...args) => { | ||
const url = args[0] | ||
console.warn('LoadURL', url) | ||
mainWindow.loadURL(url) | ||
mainWindowBox.style.width = '100%' | ||
mainWindowBox.style.height = '100%' | ||
mainWindowBox.style.transform = 'none' | ||
}) | ||
|
||
let webContents | ||
mainWindow.addEventListener('dom-ready', () => { | ||
if (!webContents) { | ||
webContents = mainWindow.getWebContents() | ||
ipcRenderer.send('main-loader-message', 'main-loader-ready') | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
mainWindow.openDevTools({ mode: 'detach' }) | ||
} | ||
} | ||
mainWindowBox.style.width = `${scalePercent}vw` | ||
mainWindowBox.style.height = `${scalePercent}vh` | ||
mainWindowBox.style.transform = `scale(${100 / | ||
scalePercent}) translate(${(100 - scalePercent) / 2}%, ${(100 - | ||
scalePercent) / | ||
2}%)` | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters