From 3a7e0987bd501b42b257f8b84ffa3ef8934c200c Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Thu, 2 Jan 2025 19:51:45 +0800 Subject: [PATCH] update --- src/components/right-nav.js | 4 ++-- src/components/setting/index.vue | 12 +++++++++++- src/hook/global.js | 10 ++++++++-- src/hook/render/wire.js | 2 +- src/hook/skin/{plusation.js => pulsation.js} | 11 ++++++----- src/i18n/ar.json | 3 ++- src/i18n/de.json | 3 ++- src/i18n/en.json | 3 ++- src/i18n/fr.json | 3 ++- src/i18n/ja.json | 3 ++- src/i18n/ko.json | 3 ++- src/i18n/ru.json | 3 ++- src/i18n/zh-cn.json | 3 ++- src/i18n/zh-tw.json | 3 ++- vue.config.js | 1 + 15 files changed, 47 insertions(+), 20 deletions(-) rename src/hook/skin/{plusation.js => pulsation.js} (94%) diff --git a/src/components/right-nav.js b/src/components/right-nav.js index d800f2c..f54549d 100644 --- a/src/components/right-nav.js +++ b/src/components/right-nav.js @@ -18,7 +18,7 @@ export const controlPanel = reactive({ this.currentIndex = -1; } else { if (horizontalResizer.width < 5) { - horizontalResizer.width = 362; + horizontalResizer.width = 410; } this.currentIndex = index; } @@ -29,7 +29,7 @@ export const controlPanel = reactive({ export const horizontalResizer = reactive({ active: false, hover: false, - width: 362, + width: 400, mousedown() { this.active = true; document.addEventListener('mousemove', resize); diff --git a/src/components/setting/index.vue b/src/components/setting/index.vue index 726153f..2916ca6 100644 --- a/src/components/setting/index.vue +++ b/src/components/setting/index.vue @@ -131,6 +131,7 @@ v-model="colorManager.generals[colorManager.currentGerneralIndex].color" @change="onGeneralColorChange" :predefine="predefinedColors" + :teleported="false" /> @@ -157,10 +158,19 @@ v-model="colorManager.cells[colorManager.currentCellIndex].color" @change="onCellColorChange" :predefine="predefinedColors" + :teleported="false" /> +
+
+ + {{ t('setting.pulsation-speed') }} + + +
+
@@ -256,7 +266,7 @@ onMounted(() => { margin: 3px; padding: 8px 12px; height: 40px; - width: 280px !important; + width: 320px !important; border-radius: .5em; background-color: var(--background); display: flex; diff --git a/src/hook/global.js b/src/hook/global.js index eba7a39..328275a 100644 --- a/src/hook/global.js +++ b/src/hook/global.js @@ -33,9 +33,15 @@ export const globalSetting = reactive({ /** * @description 当前交叉点的样式 - * @type {'connect' | 'slice' | 'concat'} currentStyle + * @type {'connect' | 'slice' | 'concat'} */ - crossDotStyle: 'connect' + crossDotStyle: 'connect', + + /** + * @description 脉动动效的速度 + * @type {number} + */ + pulsationSpeed: 5 }); export const globalLookup = reactive({ diff --git a/src/hook/render/wire.js b/src/hook/render/wire.js index caba64d..c7db516 100644 --- a/src/hook/render/wire.js +++ b/src/hook/render/wire.js @@ -5,7 +5,7 @@ import { globalSetting } from '../global'; import { NetlistRender } from '.'; import { getMarginParamter, LAYOUT_CONSTANT, LINE_WIDTH } from './layout'; import { svgResource } from '../skin/draw'; -import { PulseLine } from '../skin/plusation'; +import { PulseLine } from '../skin/pulsation'; export class WireRender { /** diff --git a/src/hook/skin/plusation.js b/src/hook/skin/pulsation.js similarity index 94% rename from src/hook/skin/plusation.js rename to src/hook/skin/pulsation.js index cddc227..8d6d750 100644 --- a/src/hook/skin/plusation.js +++ b/src/hook/skin/pulsation.js @@ -1,4 +1,5 @@ import * as d3 from 'd3'; +import { globalSetting } from '../global'; let PluseIDCount = 0; @@ -15,10 +16,10 @@ export class PulseLine { loadToSelection(parentSelection, data) { this.pluseId = data.id; - const gId = 'pluse-g' + data.id; - const pId = 'pluse-p' + data.id; - const mId = 'pluse-m' + data.id; - const uId = 'pluse-u' + data.id; + const gId = 'pulse-g' + data.id; + const pId = 'pulse-p' + data.id; + const mId = 'pulse-m' + data.id; + const uId = 'pulse-u' + data.id; const g = parentSelection.append("g") .attr("mask", `url(#${mId})`); @@ -94,7 +95,7 @@ export class PulseLine { const pathLength = pathElement.getTotalLength(); // 600 配合 3000 比较合适 - const v = 0.5; + const v = globalSetting.pulsationSpeed / 10; const duration = pathLength / v; const keyframes = new KeyframeEffect( diff --git a/src/i18n/ar.json b/src/i18n/ar.json index 2c01611..01c311b 100644 --- a/src/i18n/ar.json +++ b/src/i18n/ar.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "إعداد لون المكون", "cross-dot-style.slice": "فاصل", "cross-dot-style.connect": "محول مباشر", - "cross-dot-style.concat": "رمز الدمج" + "cross-dot-style.concat": "رمز الدمج", + "setting.pulsation-speed": "سرعة تأثير النبض" } \ No newline at end of file diff --git a/src/i18n/de.json b/src/i18n/de.json index e542b7e..7b5abe2 100644 --- a/src/i18n/de.json +++ b/src/i18n/de.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "Gerätefarbe einstellen", "cross-dot-style.slice": "Trennzeichen", "cross-dot-style.connect": "Direktverbinder", - "cross-dot-style.concat": "Zusammenführungszeichen" + "cross-dot-style.concat": "Zusammenführungszeichen", + "setting.pulsation-speed": "Pulseffektgeschwindigkeit" } \ No newline at end of file diff --git a/src/i18n/en.json b/src/i18n/en.json index 628d14d..2e0cb42 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "Device color setting", "cross-dot-style.slice": "Separator", "cross-dot-style.connect": "Direct connector", - "cross-dot-style.concat": "Combining Character" + "cross-dot-style.concat": "Combining Character", + "setting.pulsation-speed": "Pulse Effect Speed" } \ No newline at end of file diff --git a/src/i18n/fr.json b/src/i18n/fr.json index f4145b1..f6ab995 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "Réglage de la couleur de l'appareil", "cross-dot-style.slice": "Séparateur", "cross-dot-style.connect": "Connecteur direct", - "cross-dot-style.concat": "Caractère de combinaison" + "cross-dot-style.concat": "Caractère de combinaison", + "setting.pulsation-speed": "Vitesse de l'effet de pulsation" } \ No newline at end of file diff --git a/src/i18n/ja.json b/src/i18n/ja.json index eb49fd6..c330a25 100644 --- a/src/i18n/ja.json +++ b/src/i18n/ja.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "デバイスの色設定", "cross-dot-style.slice": "区切り文字", "cross-dot-style.connect": "ダイレクトコネクタ", - "cross-dot-style.concat": "結合文字" + "cross-dot-style.concat": "結合文字", + "setting.pulsation-speed": "パルスエフェクト速度" } \ No newline at end of file diff --git a/src/i18n/ko.json b/src/i18n/ko.json index 5ed125e..ffa52cb 100644 --- a/src/i18n/ko.json +++ b/src/i18n/ko.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "장치 색상 설정", "cross-dot-style.slice": "구분자", "cross-dot-style.connect": "직접 연결기", - "cross-dot-style.concat": "결합 문자" + "cross-dot-style.concat": "결합 문자", + "setting.pulsation-speed": "펄스 효과 속도" } \ No newline at end of file diff --git a/src/i18n/ru.json b/src/i18n/ru.json index 3acb492..3fc43cd 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "Настройка цвета устройства", "cross-dot-style.slice": "Разделитель", "cross-dot-style.connect": "Прямой соединитель", - "cross-dot-style.concat": "Комбинирующий символ" + "cross-dot-style.concat": "Комбинирующий символ", + "setting.pulsation-speed": "Скорость импульсного эффекта" } \ No newline at end of file diff --git a/src/i18n/zh-cn.json b/src/i18n/zh-cn.json index 31284fe..c314711 100644 --- a/src/i18n/zh-cn.json +++ b/src/i18n/zh-cn.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "器件颜色设置", "cross-dot-style.slice": "拆分符", "cross-dot-style.connect": "直连符", - "cross-dot-style.concat": "合并符" + "cross-dot-style.concat": "合并符", + "setting.pulsation-speed": "脉冲特效速度" } \ No newline at end of file diff --git a/src/i18n/zh-tw.json b/src/i18n/zh-tw.json index 2e663c8..6e846f5 100644 --- a/src/i18n/zh-tw.json +++ b/src/i18n/zh-tw.json @@ -40,5 +40,6 @@ "setting.cell-color-setting": "器件顏色設置", "cross-dot-style.slice": "分隔符", "cross-dot-style.connect": "直連符", - "cross-dot-style.concat": "合併符" + "cross-dot-style.concat": "合併符", + "setting.pulsation-speed": "脈衝特效速度" } \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 5130490..bc8069e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -17,6 +17,7 @@ module.exports = defineConfig({ }, devServer: { hot: false, + host: 'localhost', liveReload: false } })