mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-15 20:34:47 +08:00
feat(python-subprocess): 尝试字幕显示新解决方案
- 使用 python 子进程解析字幕 - 通过 websocket 通信将字幕传递给软件
This commit is contained in:
17
src/renderer/caption/index.html
Normal file
17
src/renderer/caption/index.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Auto Caption Player</title>
|
||||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
|
||||
/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
6
src/renderer/caption/src/App.vue
Normal file
6
src/renderer/caption/src/App.vue
Normal file
@@ -0,0 +1,6 @@
|
||||
<template>
|
||||
<h1>Caption</h1>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
11
src/renderer/caption/src/assets/Template.vue
Normal file
11
src/renderer/caption/src/assets/Template.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
5
src/renderer/caption/src/assets/styles/reset.css
Normal file
5
src/renderer/caption/src/assets/styles/reset.css
Normal file
@@ -0,0 +1,5 @@
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: black;
|
||||
}
|
||||
1
src/renderer/caption/src/env.d.ts
vendored
Normal file
1
src/renderer/caption/src/env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
8
src/renderer/caption/src/main.ts
Normal file
8
src/renderer/caption/src/main.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import './assets/styles/reset.css'
|
||||
import { createPinia } from 'pinia'
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(createPinia())
|
||||
app.mount('#app')
|
||||
9
src/renderer/caption/src/stores/caption.ts
Normal file
9
src/renderer/caption/src/stores/caption.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ref } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCaptionStore = defineStore('caption', () => {
|
||||
const captionFontFamily = ref<string>('sans-serif')
|
||||
const captionFontSize = ref<number>(24)
|
||||
const captionFontColor = ref<string>('#ffffff')
|
||||
return { captionFontFamily, captionFontSize, captionFontColor }
|
||||
})
|
||||
Reference in New Issue
Block a user