This commit is contained in:
muwoo 2023-07-31 17:45:22 +08:00
parent cc6098258c
commit 5946e06693
9 changed files with 61 additions and 26 deletions

View File

@ -79,10 +79,11 @@ html, body {
.detach { .detach {
width: 100%; width: 100%;
height: 56px; height: 60px;
display: flex; display: flex;
align-items: center; align-items: center;
background: #eee; background: var(--color-body-bg);
color: var(--color-text-primary);
} }
.detach { .detach {
@ -112,8 +113,8 @@ html, body {
} }
.detach input { .detach input {
background-color: #FFFFFF; background-color: var(--color-body-bg);
color: #333333; color: var(--color-text-primary);
width: 360px; width: 360px;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;

View File

@ -0,0 +1,25 @@
:root {
--color-text-primary: rgba(0, 0, 0, 0.85);
--color-text-content: #141414;
--color-text-desc: rgba(0, 0, 0, 0.45);
// 背景色
--color-body-bg: #fff;
--color-menu-bg: #f3efef;
--color-list-hover: #e2e2e2;
--color-input-hover: #fff;
// 边框
--color-border-light: #f0f0f0;
}
.dark {
--color-text-primary: #e8e8f0;
--color-text-content: #ccccd8;
--color-text-desc: #8f8fa6;
// 背景色
--color-body-bg: #1c1c28;
--color-menu-bg: #1c1c28;
--color-list-hover: #33333d;
--color-input-hover: #33333d;
// 边框
--color-border-light: #33333d;
}

View File

@ -1,4 +1,5 @@
import { createApp } from "vue"; import { createApp } from 'vue';
import App from "./App.vue"; import App from './App.vue';
import './assets/var.less';
createApp(App).mount("#app"); createApp(App).mount('#app');

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="main-container"> <div :class="{'main-container': true, dark: darkMode}">
<div class="slider-bar"> <div class="slider-bar">
<a-menu <a-menu
v-model:selectedKeys="active" v-model:selectedKeys="active"
@ -37,18 +37,24 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from 'vue';
import { useRouter } from "vue-router"; import { useRouter } from 'vue-router';
import { import {
HeartOutlined, HeartOutlined,
UserOutlined,
AppstoreOutlined, AppstoreOutlined,
SettingOutlined, SettingOutlined,
BugOutlined BugOutlined,
} from "@ant-design/icons-vue"; } from '@ant-design/icons-vue';
import { useStore } from "vuex"; import { useStore } from 'vuex';
const { remote } = window.require('electron');
const { perf } = remote.getGlobal('OP_CONFIG').get();
const darkMode = ref(perf.common.darkMode);
const router = useRouter(); const router = useRouter();
const active = ref(["market"]); const active = ref(['market']);
const changeMenu = (key: any) => { const changeMenu = (key: any) => {
router.push(key); router.push(key);
}; };
@ -59,7 +65,7 @@ window.rubick.onPluginEnter(({ code }: { code: string }) => {
}); });
const store = useStore(); const store = useStore();
const init = () => store.dispatch("init"); const init = () => store.dispatch('init');
init(); init();
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -1,8 +1,3 @@
@import "~ant-design-vue/dist/antd.less"; // 引入官方提供的 less 样式入口文件
@primary-color: #ff4ea4; // 全局主色
@error-color: #ff4ea4; // 错误色
:root { :root {
--color-text-primary: rgba(0, 0, 0, 0.85); --color-text-primary: rgba(0, 0, 0, 0.85);
--color-text-content: #141414; --color-text-content: #141414;

View File

@ -427,12 +427,13 @@ const {shortCut, common, local, global} = toRefs(state);
font-size: 14px; font-size: 14px;
height: 24px; height: 24px;
font-weight: lighter; font-weight: lighter;
background: var(--color-input-hover);
.ant-input { .ant-input {
text-align: center; text-align: center;
color: var(--ant-primary-color); color: var(--ant-primary-color);
font-size: 14px; font-size: 14px;
font-weight: lighter; font-weight: lighter;
background: var(--color-input-hover);
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "rubick", "name": "rubick",
"version": "2.3.0", "version": "2.3.1",
"author": "muwoo <2424880409@qq.com>", "author": "muwoo <2424880409@qq.com>",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -1,12 +1,12 @@
export default { export default {
version: 9, version: 11,
perf: { perf: {
custom: { custom: {
primaryColor: '#106898', primaryColor: '#ff4ea4',
errorColor: '#ed6d46', errorColor: '#ed6d46',
warningColor: '#e5a84b', warningColor: '#e5a84b',
successColor: '#c0d695', successColor: '#c0d695',
infoColor: '#007175', infoColor: '#aa8eeB',
logo: `file://${__static}/logo.png`, logo: `file://${__static}/logo.png`,
placeholder: '你好 rubick', placeholder: '你好 rubick',
}, },

View File

@ -13,6 +13,7 @@ export default () => {
width: viewInfo.width, width: viewInfo.width,
autoHideMenuBar: true, autoHideMenuBar: true,
titleBarStyle: 'hidden', titleBarStyle: 'hidden',
titleBarOverlay: true,
trafficLightPosition: { x: 12, y: 21 }, trafficLightPosition: { x: 12, y: 21 },
title: pluginInfo.pluginName, title: pluginInfo.pluginName,
resizable: true, resizable: true,
@ -44,6 +45,11 @@ export default () => {
}); });
win.once('ready-to-show', () => { win.once('ready-to-show', () => {
const darkMode = global.OP_CONFIG.get().perf.common.darkMode;
darkMode &&
win.webContents.executeJavaScript(
`document.body.classList.add("dark");window.rubick.theme="dark"`
);
win.setBrowserView(view); win.setBrowserView(view);
win.webContents.executeJavaScript( win.webContents.executeJavaScript(
`window.initDetach(${JSON.stringify(pluginInfo)})` `window.initDetach(${JSON.stringify(pluginInfo)})`