diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..2185eee --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,72 @@ +import { useState } from 'react' +import electron from './assets/electron.png' +import react from './assets/react.svg' +import vite from './assets/vite.svg' +import styles from './styles/app.module.scss' + +const App = () => { + const [count, setCount] = useState(0) + + return ( +
+
+
+
+ electron +
+
+ vite +
+
+ logo +
+
+

Hello Electron + Vite + React!

+

+ +

+

+ Edit App.tsx and save to test HMR updates. +

+
+ + Learn React + + {' | '} + + Vite Docs + +
+ Place static files into the{' '} + src/renderer/public folder + +
+
+
+
+ ) +} + +export default App diff --git a/src/assets/electron.png b/src/assets/electron.png new file mode 100644 index 0000000..45c8adb Binary files /dev/null and b/src/assets/electron.png differ diff --git a/src/assets/favicon.svg b/src/assets/favicon.svg new file mode 100644 index 0000000..de4aedd --- /dev/null +++ b/src/assets/favicon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/assets/react.svg b/src/assets/react.svg new file mode 100644 index 0000000..6b60c10 --- /dev/null +++ b/src/assets/react.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/vite.svg b/src/assets/vite.svg new file mode 100644 index 0000000..6471ae0 --- /dev/null +++ b/src/assets/vite.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/vue.png b/src/assets/vue.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/src/assets/vue.png differ diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 0000000..8d1a260 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,11 @@ + +export { } + +declare global { + interface Window { + // Expose some Api through preload script + fs: typeof import('fs') + ipcRenderer: import('electron').IpcRenderer + removeLoading: () => void + } +} diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..5a66d35 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,12 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App' +import './styles/index.css' + +ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( + + + +) + +window.removeLoading() diff --git a/src/styles/app.module.scss b/src/styles/app.module.scss new file mode 100644 index 0000000..7edf79a --- /dev/null +++ b/src/styles/app.module.scss @@ -0,0 +1,65 @@ +.app { + text-align: center; + + .appHeader { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; + + .logos { + display: flex; + box-sizing: border-box; + align-items: center; + padding: 0 5vw; + width: 100%; + + .imgBox { + width: 33.33%; + + .appLogo { + pointer-events: none; + } + + @media (prefers-reduced-motion: no-preference) { + .appLogo { + animation: App-logo-spin infinite 20s linear; + } + @keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } + } + } + } + } + + button { + font-size: calc(10px + 2vmin); + } + + .appLink { + color: #61dafb; + } + + .staticPublic { + display: flex; + align-items: center; + + code { + padding: 4px 7px; + margin: 0 4px; + border-radius: 4px; + background-color: rgb(30, 30, 30, .7); + font-size: 13px; + } + } + } +} diff --git a/src/styles/index.css b/src/styles/index.css new file mode 100644 index 0000000..ec2585e --- /dev/null +++ b/src/styles/index.css @@ -0,0 +1,13 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + monospace; +} diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +///