mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 00:22:17 +00:00
Fix lint issues
This commit is contained in:
parent
30578016b0
commit
ba3f6f87f5
3 changed files with 46 additions and 100 deletions
|
|
@ -1,113 +1,59 @@
|
||||||
<script>
|
<script>
|
||||||
import { persisted } from "svelte-persisted-store";
|
import { persisted } from 'svelte-persisted-store'
|
||||||
import { getContext } from "svelte";
|
import { getContext } from 'svelte'
|
||||||
import { click } from "@/modules/click.js";
|
import { click } from '@/modules/click.js'
|
||||||
import IPC from "@/modules/ipc.js";
|
import IPC from '@/modules/ipc.js'
|
||||||
|
|
||||||
export let page;
|
export let page
|
||||||
const view = getContext("view");
|
const view = getContext('view')
|
||||||
function close() {
|
function close () {
|
||||||
$view = null;
|
$view = null
|
||||||
page = "home";
|
page = 'home'
|
||||||
}
|
}
|
||||||
|
|
||||||
const debug = persisted("debug", "", {
|
const debug = persisted('debug', '', {
|
||||||
serializer: {
|
serializer: {
|
||||||
parse: (e) => e,
|
parse: (e) => e,
|
||||||
stringify: (e) => e,
|
stringify: (e) => e
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
function minimize() {
|
function minimize () {
|
||||||
window.ipcRenderer.send("minimize");
|
window.ipcRenderer.send('minimize')
|
||||||
}
|
}
|
||||||
|
|
||||||
function maximize() {
|
function maximize () {
|
||||||
window.ipcRenderer.send("maximize");
|
window.ipcRenderer.send('maximize')
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeapp() {
|
function closeapp () {
|
||||||
window.ipcRenderer.send("closeapp");
|
window.ipcRenderer.send('closeapp')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="w-full z-101 navbar bg-transparent border-0 p-0 d-flex">
|
<div class='w-full z-101 navbar bg-transparent border-0 p-0 d-flex'>
|
||||||
<div class="d-flex h-full draggable align-items-center text-center">
|
<div class='d-flex h-full draggable align-items-center text-center'>
|
||||||
{#if window.version?.platform !== "darwin"}
|
{#if window.version?.platform !== 'darwin'}
|
||||||
<img
|
<img src='./logo_filled.png' class='position-absolute w-50 h-50 m-10 pointer d-md-block d-none p-5' alt='ico' use:click={close} />
|
||||||
src="./logo_filled.png"
|
|
||||||
class="position-absolute w-50 h-50 m-10 pointer d-md-block d-none p-5"
|
|
||||||
alt="ico"
|
|
||||||
use:click={close}
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div id="window-controls">
|
<div id='window-controls'>
|
||||||
<button class="button" id="max-button" on:click={minimize}>
|
<button class='button' id='max-button' on:click={minimize}><svg class='svg-controls' height='12' role='img' viewBox='0 0 12 12'width='12'><rect fill='currentColor' height='1' width='10' x='1' y='6' /></svg></button>
|
||||||
<svg
|
<button class='button' id='restore-button' on:click={maximize}><svg class='svg-controls' height='12' role='img' viewBox='0 0 12 12'width='12'><rect fill='none' height='9' stroke='currentColor' width='9' x='1.5' y='1.5' /></svg></button>
|
||||||
class="svg-controls"
|
<button class='button' id='close-button' on:click={closeapp}><svg class='svg-controls' height='12' role='img' viewBox='0 0 12 12'width='12'><polygon fill='currentColor' fill-rule='evenodd' points='11 1.576 6.583 6 11 10.424 10.424 11 6 6.583 1.576 11 1 10.424 5.417 6 1 1.576 1.576 1 6 5.417 10.424 1' /></svg></button>
|
||||||
role="img"
|
|
||||||
width="12"
|
|
||||||
height="12"
|
|
||||||
viewBox="0 0 12 12"
|
|
||||||
><rect fill="currentColor" width="10" height="1" x="1" y="6"
|
|
||||||
></rect></svg
|
|
||||||
></button
|
|
||||||
>
|
|
||||||
<button class="button" id="restore-button" on:click={maximize}
|
|
||||||
><svg
|
|
||||||
class="svg-controls"
|
|
||||||
role="img"
|
|
||||||
width="12"
|
|
||||||
height="12"
|
|
||||||
viewBox="0 0 12 12"
|
|
||||||
><rect
|
|
||||||
width="9"
|
|
||||||
height="9"
|
|
||||||
x="1.5"
|
|
||||||
y="1.5"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
></rect></svg
|
|
||||||
></button
|
|
||||||
>
|
|
||||||
<button class="button" id="close-button" on:click={closeapp}>
|
|
||||||
<svg
|
|
||||||
class="svg-controls"
|
|
||||||
role="img"
|
|
||||||
width="12"
|
|
||||||
height="12"
|
|
||||||
viewBox="0 0 12 12"
|
|
||||||
>
|
|
||||||
<polygon
|
|
||||||
fill="currentColor"
|
|
||||||
fill-rule="evenodd"
|
|
||||||
points="11 1.576 6.583 6 11 10.424 10.424 11 6 6.583 1.576 11 1 10.424 5.417 6 1 1.576 1.576 1 6 5.417 10.424 1"
|
|
||||||
></polygon></svg
|
|
||||||
></button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="h-full bg-dark flex-grow-1">
|
<div class='h-full bg-dark flex-grow-1'>
|
||||||
{#if window.version?.platform === "linux"}
|
{#if window.version?.platform === 'linux'}
|
||||||
<div
|
<div class='d-flex align-items-center close h-full' use:click={() => IPC.emit('close')}>
|
||||||
class="d-flex align-items-center close h-full"
|
<svg viewBox='0 0 24 24'>
|
||||||
use:click={() => IPC.emit("close")}
|
<path d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z' />
|
||||||
>
|
|
||||||
<svg viewBox="0 0 24 24">
|
|
||||||
<path
|
|
||||||
d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
||||||
/>
|
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#if $debug}
|
{#if $debug}
|
||||||
<div
|
<div class='ribbon right z-101 text-center position-fixed font-size-16 font-weight-bold'>Debug Mode!</div>
|
||||||
class="ribbon right z-101 text-center position-fixed font-size-16 font-weight-bold"
|
|
||||||
>
|
|
||||||
Debug Mode!
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -158,26 +158,26 @@ export default class App {
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcMain.on('minimize', (event) => {
|
ipcMain.on('minimize', (event) => {
|
||||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
const focusedWindow = BrowserWindow.getFocusedWindow()
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
focusedWindow.minimize();
|
focusedWindow.minimize()
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
ipcMain.on('maximize', (event) => {
|
ipcMain.on('maximize', (event) => {
|
||||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
const focusedWindow = BrowserWindow.getFocusedWindow()
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
if (focusedWindow.isMaximized()) {
|
if (focusedWindow.isMaximized()) {
|
||||||
focusedWindow.unmaximize();
|
focusedWindow.unmaximize()
|
||||||
} else {
|
} else {
|
||||||
focusedWindow.maximize();
|
focusedWindow.maximize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
ipcMain.on('closeapp', (event) => {
|
ipcMain.on('closeapp', (event) => {
|
||||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
const focusedWindow = BrowserWindow.getFocusedWindow()
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
focusedWindow.close();
|
focusedWindow.close()
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ ipcRenderer.once('port', ({ ports }) => {
|
||||||
ports[0].postMessage(a, b)
|
ports[0].postMessage(a, b)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld('ipcRenderer', {
|
contextBridge.exposeInMainWorld('ipcRenderer', {
|
||||||
send: (channel, data) => ipcRenderer.send(channel, data),
|
send: (channel, data) => ipcRenderer.send(channel, data),
|
||||||
on: (channel, callback) => ipcRenderer.on(channel, (event, ...args) => callback(...args)),
|
on: (channel, callback) => ipcRenderer.on(channel, (event, ...args) => callback(...args))
|
||||||
});
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue