diff --git a/assets/@types/fonts.d.ts b/assets/@types/fonts.d.ts index e35fe85..c1b3d5c 100644 --- a/assets/@types/fonts.d.ts +++ b/assets/@types/fonts.d.ts @@ -1,2 +1,3 @@ declare module '*.woff'; -declare module '*.woff2'; \ No newline at end of file +declare module '*.woff2'; +declare module '*.otf'; \ No newline at end of file diff --git a/assets/fonts/Minecraft.woff b/assets/fonts/Minecraft.woff deleted file mode 100644 index 4579013..0000000 Binary files a/assets/fonts/Minecraft.woff and /dev/null differ diff --git a/assets/fonts/Minecraft.woff2 b/assets/fonts/Minecraft.woff2 deleted file mode 100644 index f3cfe1f..0000000 Binary files a/assets/fonts/Minecraft.woff2 and /dev/null differ diff --git a/assets/fonts/MinecraftBold.otf b/assets/fonts/MinecraftBold.otf new file mode 100644 index 0000000..87b124c Binary files /dev/null and b/assets/fonts/MinecraftBold.otf differ diff --git a/assets/fonts/MinecraftBoldItalic.otf b/assets/fonts/MinecraftBoldItalic.otf new file mode 100644 index 0000000..1f74f38 Binary files /dev/null and b/assets/fonts/MinecraftBoldItalic.otf differ diff --git a/assets/fonts/MinecraftItalic.otf b/assets/fonts/MinecraftItalic.otf new file mode 100644 index 0000000..6801bd8 Binary files /dev/null and b/assets/fonts/MinecraftItalic.otf differ diff --git a/assets/fonts/MinecraftRegular.otf b/assets/fonts/MinecraftRegular.otf new file mode 100644 index 0000000..54f08ad Binary files /dev/null and b/assets/fonts/MinecraftRegular.otf differ diff --git a/electron/bridge.ts b/electron/bridge.ts index 9bd80de..90317f5 100644 --- a/electron/bridge.ts +++ b/electron/bridge.ts @@ -72,6 +72,12 @@ export const api = { return response }, + // Appearance + + setTransparency: (transparency: number) => { + ipcRenderer.send('set-transparency', transparency) + }, + /** * Provide an easier way to listen to events */ diff --git a/electron/main.ts b/electron/main.ts index f6ed87d..f510c65 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -36,6 +36,12 @@ const schema = { type: 'string', default: '', }, + 'transparency': { + type: 'number', + maximum: 1, + minimum: 0, + default: 0.9 + } } /* @@ -93,7 +99,7 @@ function createWindow() { }) mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY) - mainWindow.setOpacity(0.9) + mainWindow.setOpacity(storage.get('transparency')) mainWindow.once('ready-to-show', () => { mainWindow?.show() @@ -251,7 +257,7 @@ async function registerListeners() { break case 'pvplounge': exists = await checkIfExists(path.join(logsPath, '../../.pvplounge/logs')) - event.reply('check-game-dir-reply', exists) + event.reply('check-game-dir-reply', exists) break } }) @@ -260,6 +266,12 @@ async function registerListeners() { event.reply('get-game-dir-reply', getGameDirectory(installation)) }) + // Appearance + + ipcMain.on('set-transparency', (event, transparency: number) => { + mainWindow?.setOpacity(transparency) + }) + // Logs API const client = storage.get('client') diff --git a/electron/settings.ts b/electron/settings.ts index 23ef925..db9ab5f 100644 --- a/electron/settings.ts +++ b/electron/settings.ts @@ -10,9 +10,10 @@ export const storageKeys = [ 'username', 'client', 'api-key', + 'transparency' ] export type StorageKey = { name: typeof storageKeys[number], - value: string + value: any } \ No newline at end of file diff --git a/package.json b/package.json index 383dc91..3b7f986 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "start": "electron-forge start", "package": "electron-forge package", + "make": "electron-forge make", "dist": "electron-builder --win=portable", "release": "electron-forge publish", diff --git a/src/components/Settings/index.tsx b/src/components/Settings/index.tsx index 872cc0a..3c151cf 100644 --- a/src/components/Settings/index.tsx +++ b/src/components/Settings/index.tsx @@ -115,8 +115,26 @@ const Settings: React.FC = () => { /> +

Appearance

+ + + { + const transparency = Number(e.target.value) / 100 + + console.log(transparency) + window.Main.setTransparency(transparency) + window.Main.setSetting({ name: 'transparency', value: transparency }) + } } + /> + +

Log File

-
diff --git a/src/components/Settings/styles.tsx b/src/components/Settings/styles.tsx index 0f3cfcb..e9299b6 100644 --- a/src/components/Settings/styles.tsx +++ b/src/components/Settings/styles.tsx @@ -32,6 +32,37 @@ export const SettingsStyles = styled.div` background-color: #666; } + input[type=range] { + width: 45vw; + margin: 7.3px 0; + background-color: transparent; + -webkit-appearance: none; + } + + input[type=range]:focus { + outline: none; + } + + input[type=range]::-webkit-slider-runnable-track { + background: #c3c3c3; + border: 0.2px solid #010101; + border-radius: 1.3px; + width: 100%; + height: 6px; + cursor: pointer; + } + + input[type=range]::-webkit-slider-thumb { + margin-top: -7.5px; + width: 12px; + height: 20px; + background: #ffffff; + border: 1.8px solid #00001e; + border-radius: 4px; + cursor: pointer; + -webkit-appearance: none; + } + input.blur:not(:focus) { filter: blur(4px); -webkit-filter: blur(4px); diff --git a/src/components/Sidebar/styles.ts b/src/components/Sidebar/styles.ts index 382111c..b4ad0cd 100644 --- a/src/components/Sidebar/styles.ts +++ b/src/components/Sidebar/styles.ts @@ -31,6 +31,7 @@ export const SidebarStyles = styled.nav` .selected { background-color: #3e424b; + border-radius: 6px; } ` @@ -67,5 +68,6 @@ export const SidebarRoute = styled.li` &:hover { cursor: pointer; background-color: #3e424b; + border-radius: 6px; } ` \ No newline at end of file diff --git a/src/styles/GlobalStyle.ts b/src/styles/GlobalStyle.ts index 780d1ee..86cfe08 100644 --- a/src/styles/GlobalStyle.ts +++ b/src/styles/GlobalStyle.ts @@ -1,17 +1,38 @@ import styled, { createGlobalStyle } from 'styled-components' -import MinecraftWoff from '../../assets/fonts/Minecraft.woff' -import MinecraftWoff2 from '../../assets/fonts/Minecraft.woff2' +import MinecraftRegular from '../../assets/fonts/MinecraftRegular.otf' +import MinecraftItalic from '../../assets/fonts/MinecraftItalic.otf' +import MinecraftBold from '../../assets/fonts/MinecraftBold.otf' +import MinecraftBoldItalic from '../../assets/fonts/MinecraftBoldItalic.otf' -// For future use -// #353535 -// #191621 export const GlobalStyle = createGlobalStyle` @font-face { - font-family: Minecraft; - src: url(${MinecraftWoff2}) format('woff2'), - url(${MinecraftWoff}) format('woff'); + font-family: 'Minecraft'; + font-weight: normal; + font-style: normal; + src: url(${ MinecraftRegular }) format("opentype"); + } + + @font-face { + font-family: 'Minecraft'; + font-weight: normal; + font-style: italic; + src: url(${ MinecraftItalic }) format("opentype"); + } + + @font-face { + font-family: 'Minecraft'; + font-weight: bold; + font-style: normal; + src: url(${ MinecraftBold }) format("opentype"); + } + + @font-face { + font-family: 'Minecraft'; + font-weight: bold; + font-style: italic; + src: url(${ MinecraftBoldItalic }) format("opentype"); } :root { diff --git a/webpack/rules.webpack.js b/webpack/rules.webpack.js index 7cfd72c..45cdded 100644 --- a/webpack/rules.webpack.js +++ b/webpack/rules.webpack.js @@ -28,7 +28,7 @@ module.exports = [ } }, { - test: /\.(png|woff|woff2|eot|ttf|svg)$/, + test: /\.(png|woff|woff2|eot|ttf|svg|otf)$/, use: ['url-loader'] } ] \ No newline at end of file