Compare commits
3 Commits
v0.2.0
...
27c65820e6
Author | SHA1 | Date | |
---|---|---|---|
27c65820e6 | |||
2fea99a7e2 | |||
d3e9cf5240 |
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Kisechan
|
||||
Copyright (c) 2025 Kisechan <admin@kisechan.space>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -52,5 +52,5 @@ npm run start
|
||||
## TODO
|
||||
|
||||
- [x] 更美观的说的道理,优化 UI
|
||||
- [ ] 更多的哇袄
|
||||
- [x] 更多的哇袄
|
||||
- [ ] 自定义更换不同的道理
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
201
main/main.js
@ -1,76 +1,218 @@
|
||||
const { app, BrowserWindow, ipcMain } = require("electron");
|
||||
const { app, BrowserWindow, ipcMain, Menu } = require("electron");
|
||||
const path = require("path");
|
||||
const { spawn } = require('child_process')
|
||||
const { spawn } = require("child_process");
|
||||
const fs = require("fs");
|
||||
|
||||
app.disableHardwareAcceleration(); // 高 DPI 缩放修复
|
||||
|
||||
// 音效播放器
|
||||
function playAudioFile(filePath) {
|
||||
if (process.platform === 'win32') {
|
||||
spawn('cmd', ['/c', `start "" "${filePath}"`])
|
||||
} else if (process.platform === 'darwin') {
|
||||
spawn('afplay', [filePath])
|
||||
if (process.platform === "win32") {
|
||||
spawn("cmd", ["/c", `start "" "${filePath}"`]);
|
||||
} else if (process.platform === "darwin") {
|
||||
spawn("afplay", [filePath]);
|
||||
} else {
|
||||
spawn('aplay', [filePath])
|
||||
spawn("aplay", [filePath]);
|
||||
}
|
||||
}
|
||||
|
||||
ipcMain.on('play-sound', (_, soundFile) => {
|
||||
ipcMain.on("play-sound", (_, soundFile) => {
|
||||
let soundPath;
|
||||
|
||||
// 判断是开发环境还是生产环境
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
// 在开发模式下,直接指向 renderer/public 里的文件
|
||||
soundPath = path.join(__dirname, '../renderer/public/assets/sounds', soundFile);
|
||||
soundPath = path.join(
|
||||
__dirname,
|
||||
"../renderer/public/sounds",
|
||||
soundFile
|
||||
);
|
||||
} else {
|
||||
// 在生产模式下,Vite 会把 public 里的文件复制到 dist 文件夹
|
||||
soundPath = path.join(__dirname, '../renderer/dist/assets/sounds', soundFile);
|
||||
soundPath = path.join(
|
||||
__dirname,
|
||||
"../renderer/dist/sounds",
|
||||
soundFile
|
||||
);
|
||||
}
|
||||
|
||||
console.log('Main process trying to play sound at path:', soundPath);
|
||||
console.log("Main process trying to play sound at path:", soundPath);
|
||||
|
||||
if (require('fs').existsSync(soundPath)) {
|
||||
if (require("fs").existsSync(soundPath)) {
|
||||
playAudioFile(soundPath);
|
||||
} else {
|
||||
console.error('Sound file not found:', soundPath);
|
||||
console.error("Sound file not found:", soundPath);
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-sound-path', (_, soundFile) => {
|
||||
ipcMain.handle("get-sound-path", (_, soundFile) => {
|
||||
let soundPath;
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
soundPath = path.join(__dirname, '../renderer/public/assets/sounds', soundFile);
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
soundPath = path.join(
|
||||
__dirname,
|
||||
"../renderer/public/sounds",
|
||||
soundFile
|
||||
);
|
||||
} else {
|
||||
soundPath = path.join(__dirname, '../renderer/dist/assets/sounds', soundFile);
|
||||
soundPath = path.join(
|
||||
__dirname,
|
||||
"../renderer/dist/sounds",
|
||||
soundFile
|
||||
);
|
||||
}
|
||||
|
||||
if (require('fs').existsSync(soundPath)) {
|
||||
if (require("fs").existsSync(soundPath)) {
|
||||
// 返回一个可供 web 环境使用的 file 协议 URL
|
||||
return `file://${soundPath}`;
|
||||
} else {
|
||||
console.error('Sound file not found:', soundPath);
|
||||
console.error("Sound file not found:", soundPath);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-sound-files', async () => {
|
||||
const soundDir = process.env.NODE_ENV === 'development'
|
||||
? path.join(__dirname, '../renderer/public/assets/sounds')
|
||||
: path.join(__dirname, '../renderer/dist/assets/sounds');
|
||||
ipcMain.handle("get-sound-files", async () => {
|
||||
const soundDir =
|
||||
process.env.NODE_ENV === "development"
|
||||
? path.join(__dirname, "../renderer/public/sounds")
|
||||
: path.join(__dirname, "../renderer/dist/sounds");
|
||||
|
||||
try {
|
||||
// 读取目录下的所有文件名
|
||||
const files = await fs.promises.readdir(soundDir);
|
||||
// 筛选出 .mp3 文件并返回
|
||||
return files.filter(file => file.endsWith('.mp3'));
|
||||
return files.filter((file) => file.endsWith(".mp3"));
|
||||
} catch (error) {
|
||||
console.error('无法读取声音目录:', error);
|
||||
console.error("无法读取声音目录:", error);
|
||||
return []; // 如果出错则返回空数组
|
||||
}
|
||||
});
|
||||
|
||||
// 持久化用户设置 (用于保存所选宠物素材文件名)
|
||||
const settingsFile = path.join(app.getPath('userData') || __dirname, 'settings.json');
|
||||
|
||||
ipcMain.handle('get-pet-selection', async () => {
|
||||
try {
|
||||
if (fs.existsSync(settingsFile)) {
|
||||
const data = JSON.parse(await fs.promises.readFile(settingsFile, 'utf8'));
|
||||
return data.petAsset || null;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('读取设置失败:', err);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
ipcMain.handle('set-pet-selection', async (_, petAsset) => {
|
||||
try {
|
||||
let data = {};
|
||||
if (fs.existsSync(settingsFile)) {
|
||||
try {
|
||||
data = JSON.parse(await fs.promises.readFile(settingsFile, 'utf8')) || {};
|
||||
} catch (e) {
|
||||
data = {};
|
||||
}
|
||||
}
|
||||
data.petAsset = petAsset;
|
||||
await fs.promises.writeFile(settingsFile, JSON.stringify(data, null, 2), 'utf8');
|
||||
return true;
|
||||
} catch (err) {
|
||||
console.error('写入设置失败:', err);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on("show-context-menu", async () => {
|
||||
// 尝试动态读取 renderer 下的 assets 目录,开发/生产路径均尝试
|
||||
const devAssets = path.join(__dirname, "../renderer/src/assets");
|
||||
const prodAssets = path.join(__dirname, "../renderer/dist/assets");
|
||||
let assetsDir = null;
|
||||
if (fs.existsSync(devAssets)) assetsDir = devAssets;
|
||||
else if (fs.existsSync(prodAssets)) assetsDir = prodAssets;
|
||||
|
||||
// 读取当前保存的选择(文件名)
|
||||
let currentSelection = null;
|
||||
try {
|
||||
if (fs.existsSync(settingsFile)) {
|
||||
const data = JSON.parse(await fs.promises.readFile(settingsFile, 'utf8')) || {};
|
||||
currentSelection = data.petAsset || null;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('读取当前选择失败:', e);
|
||||
}
|
||||
|
||||
// 构建素材菜单项,如果无法读取目录,则提供一个默认值
|
||||
let assetItems = [];
|
||||
try {
|
||||
if (assetsDir) {
|
||||
const files = await fs.promises.readdir(assetsDir);
|
||||
const imgs = files.filter(f => /\.(png|jpg|jpeg|gif)$/i.test(f));
|
||||
assetItems = imgs.map((f) => {
|
||||
const nameWithoutExt = f.replace(/\.[^.]+$/, '');
|
||||
const displayLabel = nameWithoutExt + (/\.gif$/i.test(f) ? '(可动)' : '');
|
||||
return ({
|
||||
label: displayLabel,
|
||||
type: 'radio',
|
||||
checked: f === currentSelection,
|
||||
click: async () => {
|
||||
try {
|
||||
// 写入 settings.json
|
||||
let data = {};
|
||||
if (fs.existsSync(settingsFile)) {
|
||||
try { data = JSON.parse(await fs.promises.readFile(settingsFile, 'utf8')) || {}; } catch (e) { data = {}; }
|
||||
}
|
||||
data.petAsset = f;
|
||||
await fs.promises.writeFile(settingsFile, JSON.stringify(data, null, 2), 'utf8');
|
||||
// 通知渲染进程更新
|
||||
if (mainWindow && mainWindow.webContents) {
|
||||
mainWindow.webContents.send('pet-selection-changed', f);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('写入选择失败:', err);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('读取 assets 目录失败:', err);
|
||||
assetItems = [];
|
||||
}
|
||||
|
||||
// 如果没有任何可用素材,提供占位项
|
||||
if (assetItems.length === 0) {
|
||||
assetItems = [
|
||||
{ label: '(无可用素材)', enabled: false }
|
||||
];
|
||||
}
|
||||
|
||||
const template = [
|
||||
{
|
||||
label: "置顶显示",
|
||||
type: "checkbox",
|
||||
checked: isAlwaysOnTop,
|
||||
click: () => {
|
||||
isAlwaysOnTop = !isAlwaysOnTop;
|
||||
if (mainWindow) mainWindow.setAlwaysOnTop(isAlwaysOnTop);
|
||||
},
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: '选择素材',
|
||||
submenu: assetItems,
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: "退出",
|
||||
click: () => { app.quit(); },
|
||||
},
|
||||
];
|
||||
|
||||
const menu = Menu.buildFromTemplate(template);
|
||||
menu.popup({ window: mainWindow });
|
||||
});
|
||||
|
||||
let isAlwaysOnTop = true;
|
||||
let mainWindow;
|
||||
|
||||
function createWindow() {
|
||||
@ -81,7 +223,8 @@ function createWindow() {
|
||||
frame: false, // 无边框窗口
|
||||
resizable: false, // 禁止调整大小
|
||||
title: "说的道理桌宠",
|
||||
icon: path.join(__dirname, '../build/icon.png'),
|
||||
alwaysOnTop: isAlwaysOnTop, // 窗口始终在最上层
|
||||
icon: path.join(__dirname, "../build/icon.png"),
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
contextIsolation: true,
|
||||
@ -90,13 +233,13 @@ function createWindow() {
|
||||
});
|
||||
|
||||
// 当渲染进程传来这个事件时,就移动窗口
|
||||
ipcMain.on('move-window', (event, { x, y }) => {
|
||||
ipcMain.on("move-window", (event, { x, y }) => {
|
||||
// 使用 Math.round 避免非整数坐标可能带来的问题
|
||||
mainWindow.setPosition(Math.round(x), Math.round(y), false);
|
||||
});
|
||||
|
||||
// 添加一个 handle,用于响应前端获取窗口位置的请求
|
||||
ipcMain.handle('get-window-position', () => {
|
||||
ipcMain.handle("get-window-position", () => {
|
||||
if (mainWindow) {
|
||||
const [x, y] = mainWindow.getPosition();
|
||||
return { x, y };
|
||||
|
@ -10,11 +10,17 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
},
|
||||
getSoundPath: (soundFile) => ipcRenderer.invoke('get-sound-path', soundFile),
|
||||
getSoundFiles: () => ipcRenderer.invoke('get-sound-files'),
|
||||
getPetSelection: () => ipcRenderer.invoke('get-pet-selection'),
|
||||
setPetSelection: (petAsset) => ipcRenderer.invoke('set-pet-selection', petAsset),
|
||||
onPetSelectionChanged: (callback) => {
|
||||
ipcRenderer.on('pet-selection-changed', (_, fileName) => callback(fileName));
|
||||
},
|
||||
showTooltip: (text) => ipcRenderer.send('show-tooltip', text),
|
||||
onUpdatePosition: (callback) => {
|
||||
ipcRenderer.on('update-position', (_, position) => callback(position))
|
||||
},
|
||||
moveWindow: (position) => ipcRenderer.send('move-window', position),
|
||||
// 暴露获取窗口位置的函数
|
||||
getWindowPosition: () => ipcRenderer.invoke('get-window-position')
|
||||
getWindowPosition: () => ipcRenderer.invoke('get-window-position'),
|
||||
showContextMenu: () => ipcRenderer.send('show-context-menu')
|
||||
})
|
@ -2,9 +2,9 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="assets/icon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue + TS</title>
|
||||
<title>说的道理桌宠</title>
|
||||
</head>
|
||||
<body style="background-color: transparent;">
|
||||
<div id="app"></div>
|
||||
|
BIN
renderer/public/images/icon.png
Normal file
After Width: | Height: | Size: 90 KiB |
@ -1,113 +1,200 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import petGif from "./assets/pet.gif";
|
||||
import { ref, onMounted, reactive, computed } from "vue";
|
||||
import { Howl } from "howler";
|
||||
|
||||
// 状态管理
|
||||
const soundFiles = ref([]); // 存储从主进程获取的声音文件名列表
|
||||
// 默认图片(打包时位于 assets)
|
||||
import defaultPet from "./assets/普通型道理.gif";
|
||||
|
||||
// 列出 renderer/src/assets 下的图片资源(Vite 特性)
|
||||
// 只匹配常见的图片后缀
|
||||
const modules = import.meta.glob('./assets/*.{png,jpg,jpeg,gif}', { as: 'url' });
|
||||
const assetEntries = Object.entries(modules);
|
||||
|
||||
// 状态
|
||||
const soundFiles = ref([]);
|
||||
const showTooltip = ref(false);
|
||||
const currentTooltip = ref("");
|
||||
const isLoading = ref(true); // 跟踪文件列表是否已加载
|
||||
const isLoading = ref(true);
|
||||
const isPlaying = ref(false);
|
||||
|
||||
// 在组件挂载后,从主进程获取声音文件列表
|
||||
// 处理宠物素材选择
|
||||
const assetList = assetEntries.map(([path, resolver]) => ({ path, resolver }));
|
||||
const assetPreviews = ref([]); // { path, url }
|
||||
const selectedAsset = ref(null); // 将保存为 URL
|
||||
const showSettings = ref(false);
|
||||
|
||||
const selectedAssetName = computed(() => {
|
||||
if (!selectedAsset.value) return null;
|
||||
// 从路径中取文件名
|
||||
const parts = selectedAsset.value.split('/');
|
||||
return parts[parts.length - 1];
|
||||
});
|
||||
|
||||
async function loadSavedSelection() {
|
||||
// 优先从主进程读取持久化选择
|
||||
if (window.electronAPI && typeof window.electronAPI.getPetSelection === 'function') {
|
||||
try {
|
||||
const assetPath = await window.electronAPI.getPetSelection();
|
||||
if (assetPath) {
|
||||
// assetPath 存储为相对于 assets 的文件名,例如 "pet2.gif"
|
||||
const match = assetList.find(a => a.path.endsWith('/' + assetPath));
|
||||
if (match) {
|
||||
selectedAsset.value = await match.resolver();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('读取保存的宠物素材失败:', e);
|
||||
}
|
||||
}
|
||||
// fallback: localStorage
|
||||
const ls = localStorage.getItem('petAsset');
|
||||
if (ls) {
|
||||
const match = assetList.find(a => a.path.endsWith('/' + ls));
|
||||
if (match) selectedAsset.value = await match.resolver();
|
||||
}
|
||||
}
|
||||
|
||||
async function saveSelection(assetPath) {
|
||||
const fileName = assetPath.replace(/^.*\//, '');
|
||||
// 保存到主进程
|
||||
if (window.electronAPI && typeof window.electronAPI.setPetSelection === 'function') {
|
||||
try {
|
||||
await window.electronAPI.setPetSelection(fileName);
|
||||
} catch (e) {
|
||||
console.error('保存宠物素材失败:', e);
|
||||
}
|
||||
}
|
||||
// fallback: localStorage
|
||||
try { localStorage.setItem('petAsset', fileName); } catch (_) {}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(async () => {
|
||||
// 加载声音文件列表
|
||||
if (window.electronAPI && typeof window.electronAPI.getSoundFiles === 'function') {
|
||||
try {
|
||||
soundFiles.value = await window.electronAPI.getSoundFiles();
|
||||
} catch (error) {
|
||||
console.error("获取声音文件列表失败:", error);
|
||||
} catch (err) {
|
||||
console.error("获取声音文件列表失败:", err);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
await loadSavedSelection();
|
||||
// 预解析所有资源的 URL,用于设置面板的缩略图显示
|
||||
try {
|
||||
const previews = await Promise.all(assetList.map(async (a) => ({ path: a.path, url: await a.resolver() })));
|
||||
assetPreviews.value = previews;
|
||||
} catch (e) {
|
||||
console.error('解析素材预览失败:', e);
|
||||
}
|
||||
|
||||
// 监听主进程通过右键菜单发来的选择变更
|
||||
if (window.electronAPI && typeof window.electronAPI.onPetSelectionChanged === 'function') {
|
||||
window.electronAPI.onPetSelectionChanged(async (fileName) => {
|
||||
const match = assetPreviews.value.find(p => p.path.endsWith('/' + fileName));
|
||||
if (match) selectedAsset.value = match.url;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const petGifUrl = computed(() => selectedAsset.value || defaultPet);
|
||||
|
||||
const playRandomSound = async () => {
|
||||
if (isPlaying.value) return;
|
||||
if (isLoading.value || soundFiles.value.length === 0) return;
|
||||
const randomSoundFile = soundFiles.value[Math.floor(Math.random() * soundFiles.value.length)];
|
||||
isPlaying.value = true;
|
||||
try {
|
||||
const audioUrl = await window.electronAPI.getSoundPath(randomSoundFile);
|
||||
if (audioUrl) new Howl({ src: [audioUrl], format: ["mp3"] }).play();
|
||||
if (audioUrl) {
|
||||
new Howl({
|
||||
src: [audioUrl],
|
||||
format: ["mp3"],
|
||||
onend: function() {
|
||||
showTooltip.value = false;
|
||||
isPlaying.value = false;
|
||||
}
|
||||
}).play();
|
||||
} else {
|
||||
isPlaying.value = false;
|
||||
}
|
||||
} catch (err) {
|
||||
isPlaying.value = false;
|
||||
console.error("播放失败:", err);
|
||||
}
|
||||
currentTooltip.value = randomSoundFile.replace(/\.mp3$/, '');
|
||||
showTooltip.value = true;
|
||||
setTimeout(() => (showTooltip.value = false), 2000);
|
||||
};
|
||||
|
||||
const dragState = reactive({
|
||||
isDragging: false,
|
||||
hasMoved: false,
|
||||
// 分别记录鼠标和窗口的起始位置
|
||||
mouseStartX: 0,
|
||||
mouseStartY: 0,
|
||||
windowStartX: 0,
|
||||
windowStartY: 0,
|
||||
});
|
||||
|
||||
// 鼠标按下事件 (改为异步函数)
|
||||
async function handleMouseDown(event) {
|
||||
// 在拖动开始时,先获取窗口的当前位置
|
||||
if (event.button !== 0) return;
|
||||
const { x, y } = await window.electronAPI.getWindowPosition();
|
||||
dragState.windowStartX = x;
|
||||
dragState.windowStartY = y;
|
||||
|
||||
// 记录鼠标的初始位置
|
||||
dragState.mouseStartX = event.screenX;
|
||||
dragState.mouseStartY = event.screenY;
|
||||
|
||||
dragState.isDragging = true;
|
||||
dragState.hasMoved = false;
|
||||
|
||||
window.addEventListener('mousemove', handleMouseMove);
|
||||
window.addEventListener('mouseup', handleMouseUp);
|
||||
}
|
||||
|
||||
// 鼠标移动事件
|
||||
function handleMouseMove(event) {
|
||||
if (!dragState.isDragging) return;
|
||||
|
||||
// 计算鼠标从起点移动的距离(偏移量)
|
||||
const deltaX = event.screenX - dragState.mouseStartX;
|
||||
const deltaY = event.screenY - dragState.mouseStartY;
|
||||
|
||||
if (!dragState.hasMoved && (Math.abs(deltaX) > 5 || Math.abs(deltaY) > 5)) {
|
||||
dragState.hasMoved = true;
|
||||
}
|
||||
|
||||
// 计算窗口的新位置 = 窗口初始位置 + 鼠标偏移量
|
||||
if (!dragState.hasMoved && (Math.abs(deltaX) > 5 || Math.abs(deltaY) > 5)) dragState.hasMoved = true;
|
||||
const newWindowX = dragState.windowStartX + deltaX;
|
||||
const newWindowY = dragState.windowStartY + deltaY;
|
||||
|
||||
// 将计算出的正确位置发送给主进程
|
||||
window.electronAPI.moveWindow({ x: newWindowX, y: newWindowY });
|
||||
}
|
||||
|
||||
// 鼠标抬起事件
|
||||
function handleMouseUp() {
|
||||
// 如果鼠标按下后没有真正移动过,就认为这是一次点击
|
||||
if (dragState.isDragging && !dragState.hasMoved) {
|
||||
playRandomSound();
|
||||
}
|
||||
|
||||
// 状态重置
|
||||
if (dragState.isDragging && !dragState.hasMoved) playRandomSound();
|
||||
dragState.isDragging = false;
|
||||
|
||||
// 移除全局监听器(非常重要)
|
||||
window.removeEventListener('mousemove', handleMouseMove);
|
||||
window.removeEventListener('mouseup', handleMouseUp);
|
||||
}
|
||||
|
||||
function handleRightClick() { window.electronAPI.showContextMenu(); }
|
||||
|
||||
async function chooseAsset(entry) {
|
||||
// entry can be either {path, resolver} or a preview {path, url}
|
||||
if (entry.url) {
|
||||
selectedAsset.value = entry.url;
|
||||
await saveSelection(entry.path);
|
||||
} else {
|
||||
const url = await entry.resolver();
|
||||
selectedAsset.value = url;
|
||||
await saveSelection(entry.path);
|
||||
}
|
||||
showSettings.value = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="pet-container" @mousedown="handleMouseDown">
|
||||
<div
|
||||
class="pet-container"
|
||||
@mousedown="handleMouseDown"
|
||||
@contextmenu.prevent="handleRightClick"
|
||||
>
|
||||
<transition name="fade">
|
||||
<div v-if="showTooltip" class="tooltip">
|
||||
{{ currentTooltip }}
|
||||
</div>
|
||||
</transition>
|
||||
<img :src="petGif" class="pet-gif" />
|
||||
<img :src="petGifUrl" class="pet-gif" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
BIN
renderer/src/assets/互变异构道理.gif
Normal file
After Width: | Height: | Size: 677 KiB |
BIN
renderer/src/assets/好久没那个了.gif
Normal file
After Width: | Height: | Size: 10 MiB |
Before Width: | Height: | Size: 6.5 MiB After Width: | Height: | Size: 6.5 MiB |