Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 79ce42bec6 | |||
| 72c956162c | |||
| 3080b59dc8 | |||
| d054e42cc0 | |||
| d299fc1d93 | |||
| 6447e95d7d | |||
| 7ec5a1eccc | |||
| 4cf70a3431 |
Binary file not shown.
|
After Width: | Height: | Size: 292 KiB |
+6
-2
@@ -36,6 +36,10 @@ code {
|
|||||||
min-height: 100svh;
|
min-height: 100svh;
|
||||||
padding: 24px 16px calc(48px + env(safe-area-inset-bottom, 0px));
|
padding: 24px 16px calc(48px + env(safe-area-inset-bottom, 0px));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
background-image: linear-gradient(rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.5)), url('/login-bg.jpg');
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Glassmorphism Auth Card */
|
/* Glassmorphism Auth Card */
|
||||||
@@ -5573,7 +5577,7 @@ html.theme-cupertino .events-scroll-container {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
|
padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
|
||||||
font-size: 11px;
|
font-size: 13px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
color: #64748b;
|
color: #64748b;
|
||||||
background: rgba(11, 12, 16, 0.72);
|
background: rgba(11, 12, 16, 0.72);
|
||||||
@@ -5615,7 +5619,7 @@ html.theme-cupertino .events-scroll-container {
|
|||||||
gap: 4px;
|
gap: 4px;
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
font-size: 11px;
|
font-size: 13px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #94a3b8;
|
color: #94a3b8;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export default function AppFooter() {
|
|||||||
aria-label={t('footer.kofi_title')}
|
aria-label={t('footer.kofi_title')}
|
||||||
onClick={() => trackPlausibleEvent(PlausibleEvents.KOFI_LINK_CLICKED)}
|
onClick={() => trackPlausibleEvent(PlausibleEvents.KOFI_LINK_CLICKED)}
|
||||||
>
|
>
|
||||||
<Coffee size={12} aria-hidden="true" />
|
<Coffee size={14} aria-hidden="true" />
|
||||||
<span>{t('footer.kofi_label')}</span>
|
<span>{t('footer.kofi_label')}</span>
|
||||||
</a>
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -44,6 +44,29 @@ export default function LiveVoiceCapture({
|
|||||||
const [previewDurationSec, setPreviewDurationSec] = useState(0)
|
const [previewDurationSec, setPreviewDurationSec] = useState(0)
|
||||||
const [saving, setSaving] = useState(false)
|
const [saving, setSaving] = useState(false)
|
||||||
|
|
||||||
|
const previewAudioRef = useRef<HTMLAudioElement | null>(null)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const el = previewAudioRef.current
|
||||||
|
if (!el) return
|
||||||
|
|
||||||
|
const handleLoadedMetadata = () => {
|
||||||
|
if (el.duration === Infinity || isNaN(el.duration) || el.duration === 0) {
|
||||||
|
el.currentTime = 1e10
|
||||||
|
const onTimeUpdate = () => {
|
||||||
|
el.currentTime = 0
|
||||||
|
el.removeEventListener('timeupdate', onTimeUpdate)
|
||||||
|
}
|
||||||
|
el.addEventListener('timeupdate', onTimeUpdate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
el.addEventListener('loadedmetadata', handleLoadedMetadata)
|
||||||
|
return () => {
|
||||||
|
el.removeEventListener('loadedmetadata', handleLoadedMetadata)
|
||||||
|
}
|
||||||
|
}, [previewUrl])
|
||||||
|
|
||||||
const stopStream = useCallback(() => {
|
const stopStream = useCallback(() => {
|
||||||
for (const track of streamRef.current?.getTracks() ?? []) {
|
for (const track of streamRef.current?.getTracks() ?? []) {
|
||||||
track.stop()
|
track.stop()
|
||||||
@@ -110,8 +133,7 @@ export default function LiveVoiceCapture({
|
|||||||
if (!recorder || recorder.state !== 'recording') return
|
if (!recorder || recorder.state !== 'recording') return
|
||||||
recorder.stop()
|
recorder.stop()
|
||||||
clearTimer()
|
clearTimer()
|
||||||
stopStream()
|
}, [clearTimer])
|
||||||
}, [clearTimer, stopStream])
|
|
||||||
|
|
||||||
const startRecording = async () => {
|
const startRecording = async () => {
|
||||||
setMicError(null)
|
setMicError(null)
|
||||||
@@ -141,6 +163,7 @@ export default function LiveVoiceCapture({
|
|||||||
)
|
)
|
||||||
const blob = new Blob(chunksRef.current, { type: resolvedMime })
|
const blob = new Blob(chunksRef.current, { type: resolvedMime })
|
||||||
chunksRef.current = []
|
chunksRef.current = []
|
||||||
|
stopStream()
|
||||||
try {
|
try {
|
||||||
assertVoiceMemoBlobSize(blob)
|
assertVoiceMemoBlobSize(blob)
|
||||||
finishRecording(blob, resolvedMime, durationSec)
|
finishRecording(blob, resolvedMime, durationSec)
|
||||||
@@ -241,7 +264,7 @@ export default function LiveVoiceCapture({
|
|||||||
|
|
||||||
{phase === 'preview' && previewUrl && (
|
{phase === 'preview' && previewUrl && (
|
||||||
<>
|
<>
|
||||||
<audio className="voice-memo-player" controls src={previewUrl} preload="auto" />
|
<audio ref={previewAudioRef} className="voice-memo-player" controls src={previewUrl} preload="auto" />
|
||||||
{onCaptionChange && (
|
{onCaptionChange && (
|
||||||
<label className="live-voice-caption-field">
|
<label className="live-voice-caption-field">
|
||||||
<span>{t('logs.live_voice_caption_label')}</span>
|
<span>{t('logs.live_voice_caption_label')}</span>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { db } from '../services/db.js'
|
import { db } from '../services/db.js'
|
||||||
import { getActiveMasterKey } from '../services/auth.js'
|
import { getActiveMasterKey } from '../services/auth.js'
|
||||||
@@ -30,6 +30,29 @@ export default function VoiceMemoPlayer({
|
|||||||
const [src, setSrc] = useState<string | null>(preloaded?.audio ?? null)
|
const [src, setSrc] = useState<string | null>(preloaded?.audio ?? null)
|
||||||
const [error, setError] = useState(false)
|
const [error, setError] = useState(false)
|
||||||
|
|
||||||
|
const audioRef = useRef<HTMLAudioElement | null>(null)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const el = audioRef.current
|
||||||
|
if (!el) return
|
||||||
|
|
||||||
|
const handleLoadedMetadata = () => {
|
||||||
|
if (el.duration === Infinity || isNaN(el.duration) || el.duration === 0) {
|
||||||
|
el.currentTime = 1e10
|
||||||
|
const onTimeUpdate = () => {
|
||||||
|
el.currentTime = 0
|
||||||
|
el.removeEventListener('timeupdate', onTimeUpdate)
|
||||||
|
}
|
||||||
|
el.addEventListener('timeupdate', onTimeUpdate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
el.addEventListener('loadedmetadata', handleLoadedMetadata)
|
||||||
|
return () => {
|
||||||
|
el.removeEventListener('loadedmetadata', handleLoadedMetadata)
|
||||||
|
}
|
||||||
|
}, [src])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (preloaded?.audio) {
|
if (preloaded?.audio) {
|
||||||
setSrc(preloaded.audio)
|
setSrc(preloaded.audio)
|
||||||
@@ -75,7 +98,7 @@ export default function VoiceMemoPlayer({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="voice-memo-player-shell">
|
<div className="voice-memo-player-shell">
|
||||||
<audio className={playerClass} controls preload="none" src={src} />
|
<audio ref={audioRef} className={playerClass} controls preload="none" src={src} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user