f8 byter färg mellan protypes färgprofiler
This commit is contained in:
parent
b19f968da6
commit
7fbbf5c7e1
@ -98,10 +98,13 @@
|
|||||||
*/
|
*/
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="docContainer h-95 flex flex-col" role="application" id="docContainer">
|
<div class="docContainer h-full flex flex-col" role="application" id="docContainer">
|
||||||
<textarea style="
|
<textarea
|
||||||
|
style="
|
||||||
font-size:{textSettings.size}px;
|
font-size:{textSettings.size}px;
|
||||||
font-family:{textSettings.font};
|
font-family:{textSettings.font};
|
||||||
|
color:{textSettings.colors.fg};
|
||||||
|
background-color:{textSettings.colors.bg};
|
||||||
"
|
"
|
||||||
class="textarea flex-grow"
|
class="textarea flex-grow"
|
||||||
id="doc"
|
id="doc"
|
||||||
|
@ -1,8 +1,47 @@
|
|||||||
|
const colorSetting = {
|
||||||
|
bg: "black",
|
||||||
|
fg: "white",
|
||||||
|
}
|
||||||
|
|
||||||
|
const colorThemes = [
|
||||||
|
{
|
||||||
|
bg: "white",
|
||||||
|
fg: "black",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
bg: "black",
|
||||||
|
fg: "white",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
bg: "black",
|
||||||
|
fg: "yellow",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
bg: "yellow",
|
||||||
|
fg: "black",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
bg: "blue",
|
||||||
|
fg: "yellow",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
bg: "yellow",
|
||||||
|
fg: "blue",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
let selectedColor = 0;
|
||||||
|
|
||||||
export const shortforms = $state({ standardList: "", subjectLists: [], cache: new Map() })
|
export const shortforms = $state({ standardList: "", subjectLists: [], cache: new Map() })
|
||||||
export const importState = $state({ data: "", errors: [] })
|
export const importState = $state({ data: "", errors: [] })
|
||||||
export const textSettings = $state({ font: "Arial", size: 30, padding: 0, lineheight: 1 })
|
export const textSettings = $state({ font: "Arial", size: 30, colors: colorSetting, padding: 0, lineheight: 1 })
|
||||||
export const appState = $state({ text: "" })
|
export const appState = $state({ text: "" })
|
||||||
|
|
||||||
|
export const selectNextColor = () => {
|
||||||
|
selectedColor += 1
|
||||||
|
textSettings.colors = colorThemes[(selectedColor % 6)]
|
||||||
|
}
|
||||||
|
|
||||||
export const incTextSize = () => {
|
export const incTextSize = () => {
|
||||||
console.log(textSettings.size)
|
console.log(textSettings.size)
|
||||||
if (textSettings.size < 200) {
|
if (textSettings.size < 200) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import type { ExpanderType } from "./index.d.ts";
|
import type { ExpanderType } from "./index.d.ts";
|
||||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||||
import { incTextSize, decTextSize, appState } from "$lib/stores.svelte"
|
import { incTextSize, decTextSize, selectNextColor, appState } from "$lib/stores.svelte"
|
||||||
|
|
||||||
let fullscreen = true;
|
let fullscreen = true;
|
||||||
export const defaultExpanders: Map<string, ExpanderType> = new Map();
|
export const defaultExpanders: Map<string, ExpanderType> = new Map();
|
||||||
@ -109,6 +109,14 @@ hotkeys.set("F7", {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
hotkeys.set("F8", {
|
||||||
|
action: (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
console.log("Increase text size")
|
||||||
|
selectNextColor()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
hotkeys.set("F11", {
|
hotkeys.set("F11", {
|
||||||
action: (e) => {
|
action: (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
</svelte:head>
|
</svelte:head>
|
||||||
<svelte:window on:keydown={handleHotkeys} />
|
<svelte:window on:keydown={handleHotkeys} />
|
||||||
|
|
||||||
<div class="h-dvh w-full" role="application">
|
<div class="h-dvh w-full overflow-hidden" role="application">
|
||||||
<div class="h-full">
|
<div class="h-full">
|
||||||
<Textarea />
|
<Textarea />
|
||||||
<Dashboard open={showDashboard} />
|
<Dashboard open={showDashboard} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user