土狗 2 months ago
parent a6824c4926
commit 87aa145d03

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>智能提词器</title>
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/theme.css">
<link rel="stylesheet" href="styles/sidebar.css">
@ -243,12 +244,5 @@
<input type="file" id="fileInput" accept=".txt" style="display: none;">
<script src="js/main.js" type="module"></script>
<script src="js/theme.js" type="module"></script>
<script src="js/scroll.js" type="module"></script>
<script src="js/text.js" type="module"></script>
<script src="js/audio.js" type="module"></script>
<script src="js/settings.js" type="module"></script>
<script src="js/watermark.js" type="module"></script>
<script src="js/flip.js" type="module"></script>
</body>
</html>

@ -1,5 +1,5 @@
// 音频控制器
class AudioController {
export class AudioController {
constructor() {
this.mediaRecorder = null;
this.audioChunks = [];

@ -0,0 +1,12 @@
// 默认文本内容模块
export const defaultText = `我是一个提词器的示例文本。
你可以直接编辑我或者粘贴内容
也可以点击左侧功能区的文件夹图标上传文件
需要是"*.txt"的文本文档格式
本项目支持翻转(水平垂直)
在开始使用之前请注意设置以下内容
字体字体大小滚动速度
项目已开源到Github地址为
https://github.com/Song2770/ez4prompt
如果你觉得好用不妨为我的项目点一颗Star
如果你遇到了问题欢迎留言`;

@ -1,5 +1,5 @@
// 翻转控制器
class FlipController {
export class FlipController {
constructor() {
this.init();
}

@ -1,3 +1,13 @@
// 导入所有控制器模块
import { ThemeController } from './theme.js';
import { ScrollController } from './scroll.js';
import { TextController } from './text.js';
import { AudioController } from './audio.js';
import { SettingsController } from './settings.js';
import { WatermarkController } from './watermark.js';
import { FlipController } from './flip.js';
import { defaultText } from './defaultText.js';
// 主应用程序入口
class TeleprompterApp {
constructor() {
@ -13,6 +23,15 @@ class TeleprompterApp {
}
init() {
// 先初始化各个模块
window.themeController = new ThemeController();
window.scrollController = new ScrollController();
window.textController = new TextController();
window.audioController = new AudioController();
window.settingsController = new SettingsController();
window.watermarkController = new WatermarkController();
window.flipController = new FlipController();
this.setupEventListeners();
this.loadDefaultText();
this.updateTimeDisplay();
@ -21,15 +40,6 @@ class TeleprompterApp {
// 每秒更新时间显示
setInterval(() => this.updateTimeDisplay(), 1000);
// 初始化各个模块
window.themeController = new ThemeController();
window.scrollController = new ScrollController();
window.textController = new TextController();
window.audioController = new AudioController();
window.settingsController = new SettingsController();
window.watermarkController = new WatermarkController();
window.flipController = new FlipController();
}
getDefaultSettings() {
@ -417,16 +427,12 @@ class TeleprompterApp {
}
loadDefaultText() {
fetch('example.txt')
.then(response => response.text())
.then(text => {
window.textController.setText(text);
this.updateScrollbar();
})
.catch(error => {
console.error('加载默认文本失败:', error);
window.textController.setText('请导入文本文件或直接编辑此处内容。');
});
try {
window.textController.setText('我是一个提词器的示例文本。\n你可以直接编辑我或者粘贴内容。\n可以点击左侧功能区的文件夹图标上传文件。需要是"*.txt"的文本文档格式。\n本项目支持翻转(水平、垂直)\n在开始使用之前请注意设置以下内容字体字体大小滚动速度\n项目已开源到Github地址为https://github.com/Song2770/ez4prompt\n如果你觉得好用不妨为我的项目点一颗Star。\n如果你遇到了问题欢迎留言。');
this.updateScrollbar();
} catch (error) {
console.error('加载默认文本失败:', error);
}
}
updateTimeDisplay() {

@ -1,5 +1,5 @@
// 滚动控制器
class ScrollController {
export class ScrollController {
constructor() {
this.isAutoScrolling = false;
this.scrollSpeed = 30;

@ -1,5 +1,5 @@
// 设置控制器
class SettingsController {
export class SettingsController {
constructor() {
this.init();
}

@ -1,5 +1,5 @@
// 文本控制器
class TextController {
export class TextController {
constructor() {
this.init();
}

@ -1,5 +1,5 @@
// 主题控制器
class ThemeController {
export class ThemeController {
constructor() {
this.currentTheme = 'dark';
this.init();

@ -1,5 +1,5 @@
// 水印控制器
class WatermarkController {
export class WatermarkController {
constructor() {
this.init();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 180 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 181 B

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"/></svg>

After

Width:  |  Height:  |  Size: 298 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 185 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 213 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 228 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 944 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM12 17c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 354 B

@ -0,0 +1,20 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="144.000000pt" height="144.000000pt" viewBox="0 0 144.000000 144.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,144.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M329 1287 c-91 -26 -160 -99 -179 -193 -8 -36 -10 -171 -8 -406 3
-307 6 -358 21 -390 25 -55 71 -103 125 -129 l47 -24 389 3 c387 3 390 4 436
27 52 26 92 68 118 124 15 32 17 78 17 421 0 424 1 419 -64 493 -18 19 -53 46
-79 59 -46 23 -53 23 -412 25 -268 2 -377 -1 -411 -10z m587 -221 l-36 -44 0
-346 0 -346 -275 0 -275 0 0 390 0 390 311 0 311 0 -36 -44z m152 -10 l42 -53
0 -237 0 -236 -90 0 -90 0 0 236 0 236 42 54 c24 30 45 54 48 54 3 -1 24 -25
48 -54z m40 -649 l3 -77 -91 0 -90 0 0 75 0 74 73 4 c39 2 79 3 87 2 12 0 16
-17 18 -78z"/>
<path d="M472 863 l3 -68 148 -3 147 -3 0 71 0 70 -150 0 -151 0 3 -67z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M10 2c-1.82 0-3.53.5-5 1.35C7.99 5.08 10 8.3 10 12s-2.01 6.92-5 8.65C6.47 21.5 8.18 22 10 22c5.52 0 10-4.48 10-10S15.52 2 10 2z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 262 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 166 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M8 5v14l11-7z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 148 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="8" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 154 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 179 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 476 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M20 15.31L23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69zM12 18V6c3.31 0 6 2.69 6 6s-2.69 6-6 6z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 280 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM12 17c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 343 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-13 5l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 363 B

@ -7,4 +7,19 @@ export default defineConfig({
optimizeDeps: {
exclude: ['lucide-react'],
},
build: {
assetsInlineLimit: 0, // 禁用资源内联确保SVG文件作为独立文件
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
// 保持SVG文件的原始路径结构
if (assetInfo.name && assetInfo.name.endsWith('.svg')) {
return 'images/[name][extname]';
}
return 'assets/[name]-[hash][extname]';
}
}
}
},
assetsInclude: ['**/*.svg']
});

Loading…
Cancel
Save