🎨 微调

This commit is contained in:
BTMuli
2025-12-01 00:43:31 +08:00
parent 4c3648481e
commit 323b951c10
3 changed files with 19 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
<!-- 图片浮窗 -->
<template>
<TOverlay v-model="visible" blur-val="10px">
<div class="tpoi-box">
@@ -62,7 +63,13 @@ import { computed, nextTick, ref, shallowRef } from "vue";
import type { TpImage } from "./tp-image.vue";
type TpoImageProps = { image: TpImage };
/**
* 图片浮窗组件参数
*/
type TpoImageProps = {
/* 图片数据 */
image: TpImage;
};
const props = defineProps<TpoImageProps>();
const visible = defineModel<boolean>();
@@ -70,6 +77,7 @@ const localLink = defineModel<string>("link");
const showOri = defineModel<boolean>("ori");
const bgColor = defineModel<string>("bgColor", { default: "transparent" });
const format = defineModel<string>("format", { default: "png" });
const bgMode = ref<number>(0); // 0: transparent, 1: black, 2: white
const isOriSize = ref<boolean>(false);
const buffer = shallowRef<Uint8Array | null>(null);

View File

@@ -55,7 +55,7 @@ async function selectFile(): Promise<void> {
.tpr-debug-box {
position: relative;
display: flex;
width: 400px;
width: 800px;
flex-direction: column;
align-items: center;
justify-content: center;
@@ -70,7 +70,7 @@ async function selectFile(): Promise<void> {
overflow: hidden;
width: 100%;
align-items: center;
justify-content: space-between;
justify-content: flex-start;
padding: 5px;
border-bottom: 1px solid var(--box-bg-2);
font-family: var(--font-title);
@@ -79,7 +79,8 @@ async function selectFile(): Promise<void> {
:nth-child(2) {
overflow: hidden;
width: 300px;
max-width: 600px;
margin-right: auto;
color: var(--common-text-title);
text-overflow: ellipsis;
white-space: nowrap;
@@ -90,7 +91,7 @@ async function selectFile(): Promise<void> {
display: flex;
width: 100%;
min-height: 50px;
max-height: 300px;
max-height: 800px;
flex-direction: column;
align-items: center;
justify-content: flex-start;

View File

@@ -1,7 +1,6 @@
/**
* @file utils/TGShare.ts
* @description 生成分享截图并保存到本地
* @since Beta v0.8.3
* 生成分享截图并保存到本地
* @since Beta v0.8.7
*/
import showSnackbar from "@comp/func/snackbar.js";
@@ -85,8 +84,8 @@ function getShareImgBgColor(): string {
}
/**
* @description 生成分享截图
* @since Beta v0.8.3
* 生成分享截图
* @since Beta v0.8.7
* @param {string} fileName - 文件名
* @param {HTMLElement} element - 元素
* @param {number} scale - 缩放比例
@@ -96,7 +95,7 @@ function getShareImgBgColor(): string {
export async function generateShareImg(
fileName: string,
element: HTMLElement,
scale: number = 1.2,
scale: number = 1.5,
scrollable: boolean = false,
): Promise<void> {
const canvas = document.createElement("canvas");