frontend changes
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
||||
<title>CutScript</title>
|
||||
<title>TalkEdit</title>
|
||||
</head>
|
||||
<body class="bg-editor-bg text-editor-text antialiased">
|
||||
<div id="root"></div>
|
||||
|
||||
@ -114,19 +114,19 @@ export default function App() {
|
||||
<div className="h-screen flex flex-col items-center justify-center gap-8 bg-editor-bg px-6">
|
||||
<div className="flex flex-col items-center gap-3">
|
||||
<Film className="w-14 h-14 text-editor-accent opacity-80" />
|
||||
<h1 className="text-3xl font-semibold tracking-tight">CutScript</h1>
|
||||
<h1 className="text-3xl font-semibold tracking-tight">TalkEdit</h1>
|
||||
<p className="text-editor-text-muted text-sm max-w-sm text-center">
|
||||
Open-source text-based video editing powered by AI.
|
||||
Offline AI-powered video editor.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Whisper model selector */}
|
||||
<div className="flex items-center gap-3">
|
||||
<label className="text-xs text-editor-text-muted whitespace-nowrap">Whisper model:</label>
|
||||
<label className="text-xs text-editor-text-muted whitespace-nowrap">Model size:</label>
|
||||
<select
|
||||
value={whisperModel}
|
||||
onChange={(e) => setWhisperModel(e.target.value)}
|
||||
className="px-3 py-1.5 bg-editor-surface border border-editor-border rounded-lg text-xs text-editor-text focus:outline-none focus:border-editor-accent"
|
||||
className="px-3 py-1.5 bg-editor-surface border border-editor-border rounded-lg text-xs text-white focus:outline-none focus:border-editor-accent"
|
||||
>
|
||||
<option value="tiny">tiny (~75 MB, fastest)</option>
|
||||
<option value="base">base (~140 MB, fast)</option>
|
||||
|
||||
@ -90,7 +90,7 @@ export default function SettingsPanel() {
|
||||
<select
|
||||
value={providers.ollama.model}
|
||||
onChange={(e) => setProviderConfig('ollama', { model: e.target.value })}
|
||||
className="w-full px-3 py-2 bg-editor-surface border border-editor-border rounded-lg text-xs text-editor-text focus:outline-none focus:border-editor-accent"
|
||||
className="w-full px-3 py-2 bg-editor-surface border border-editor-border rounded-lg text-xs text-white focus:outline-none focus:border-editor-accent"
|
||||
>
|
||||
{ollamaModels.map((m) => (
|
||||
<option key={m} value={m}>{m}</option>
|
||||
|
||||
@ -164,7 +164,7 @@ async function saveProject() {
|
||||
|
||||
const outputPath = await window.electronAPI?.saveFile({
|
||||
defaultPath: state.videoPath.replace(/\.[^.]+$/, '.aive'),
|
||||
filters: [{ name: 'CutScript Project', extensions: ['aive'] }],
|
||||
filters: [{ name: 'TalkEdit Project', extensions: ['aive'] }],
|
||||
});
|
||||
|
||||
if (outputPath) {
|
||||
|
||||
@ -12,8 +12,7 @@ import { open, save } from '@tauri-apps/plugin-dialog';
|
||||
import { readTextFile, writeTextFile } from '@tauri-apps/plugin-fs';
|
||||
|
||||
const VIDEO_FILTERS = [
|
||||
{ name: 'Video Files', extensions: ['mp4', 'avi', 'mov', 'mkv', 'webm'] },
|
||||
{ name: 'Audio Files', extensions: ['m4a', 'wav', 'mp3', 'flac'] },
|
||||
{ name: 'Audio and Video Files', extensions: ['mp4', 'avi', 'mov', 'mkv', 'webm', 'm4a', 'wav', 'mp3', 'flac'] },
|
||||
{ name: 'All Files', extensions: ['*'] },
|
||||
];
|
||||
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
use tauri::Manager;
|
||||
|
||||
// --- Commands ---
|
||||
|
||||
/// Returns the backend URL. Stubbed for now; will be replaced once the
|
||||
@ -15,26 +13,23 @@ fn get_backend_url() -> String {
|
||||
/// OS keychain implementation is added (e.g. tauri-plugin-stronghold).
|
||||
#[tauri::command]
|
||||
fn encrypt_string(data: String) -> String {
|
||||
use std::io::Write;
|
||||
let encoded = data
|
||||
data
|
||||
.as_bytes()
|
||||
.iter()
|
||||
.fold(String::new(), |mut acc, b| {
|
||||
use std::fmt::Write as FmtWrite;
|
||||
let _ = write!(acc, "{:02x}", b);
|
||||
acc
|
||||
});
|
||||
encoded
|
||||
})
|
||||
}
|
||||
|
||||
/// Companion decode for encrypt_string.
|
||||
#[tauri::command]
|
||||
fn decrypt_string(encrypted: String) -> Result<String, String> {
|
||||
let bytes: Result<Vec<u8>, _> = (0..encrypted.len())
|
||||
(0..encrypted.len())
|
||||
.step_by(2)
|
||||
.map(|i| u8::from_str_radix(&encrypted[i..i + 2], 16))
|
||||
.collect();
|
||||
bytes
|
||||
.collect::<Result<Vec<u8>, _>>()
|
||||
.map_err(|e| format!("decrypt error: {e}"))
|
||||
.and_then(|b| String::from_utf8(b).map_err(|e| format!("utf8 error: {e}")))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user