feat: add electron app.

This commit is contained in:
jaywcjlove
2022-09-04 22:09:04 +08:00
parent a66e906eef
commit 76a6f48d0a
62 changed files with 483 additions and 98 deletions

1
electron/preload/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
lib

View File

@@ -0,0 +1,16 @@
{
"name": "@wcj/wxmp-preload",
"version": "2.1.0",
"main": "./lib/index.js",
"private": true,
"scripts": {
"build": "tsbb build --disable-babel --file-names src/index.ts",
"watch": "tsbb watch --disable-babel --file-names src/index.ts"
},
"files": [
"lib"
],
"devDependencies": {
"electron": "19.0.5"
}
}

View File

@@ -0,0 +1,24 @@
const styleStr = `.siderbar {
-webkit-app-region: drag;
}
.siderbar header h1 a, github-corners {
display: none;
}
article.content:before {
-webkit-app-region: drag;
position: absolute;
content: ' ';
display: block;
height: 41px;
width: 100%;
z-index: -1;
}`;
document.addEventListener('DOMContentLoaded', () => {
const head = document.querySelector('head');
const style = document.createElement('style');
style.textContent = styleStr;
if (head) {
head.append(style);
}
});

View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"declaration": true,
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"sourceMap": false,
"noImplicitAny": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"outDir": "lib",
"baseUrl": "."
// "esModuleInterop": true,
// "allowSyntheticDefaultImports": true,
// "forceConsistentCasingInFileNames": true,
// "noFallthroughCasesInSwitch": true,
// "isolatedModules": false,
},
"include": ["src"]
}