mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
1522 lines
78 KiB
HTML
1522 lines
78 KiB
HTML
<!-- components/upload-modal.html -->
|
|
<div
|
|
id="uploadModal"
|
|
class="fixed inset-0 z-50 hidden"
|
|
style="background: transparent"
|
|
>
|
|
<!-- Overlay Layer with dark background and blur -->
|
|
<div
|
|
class="absolute inset-0 z-10"
|
|
style="
|
|
background-color: rgba(0, 0, 0, 0.9);
|
|
backdrop-filter: blur(10px);
|
|
-webkit-backdrop-filter: blur(10px);
|
|
"
|
|
></div>
|
|
|
|
<!-- Modal Container -->
|
|
<div
|
|
class="relative modal-container h-full w-full flex items-start md:items-center justify-center overflow-y-auto z-20"
|
|
>
|
|
<div
|
|
class="modal-content bg-gray-900 w-full max-w-[90%] lg:max-w-6xl my-0 rounded-lg overflow-y-auto relative"
|
|
style="max-height: 90vh"
|
|
>
|
|
<!-- Top Bar (similar to video-modal) -->
|
|
<div
|
|
class="sticky top-0 bg-gradient-to-b from-black/80 to-transparent transition-transform duration-150 p-4 flex items-center justify-between"
|
|
>
|
|
<h2 class="text-xl font-bold text-white">Share a Video</h2>
|
|
<button
|
|
id="closeUploadModal"
|
|
class="flex items-center justify-center w-10 h-10 rounded-full bg-black/50 hover:bg-black/70 transition-all duration-200 backdrop-blur focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-black focus:ring-blue-500"
|
|
>
|
|
<!-- X or arrow icon -->
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
class="w-6 h-6 text-gray-300"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke="currentColor"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
stroke-width="2"
|
|
d="M6 18L18 6M6 6l12 12"
|
|
/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Form Content -->
|
|
<div class="p-6 space-y-6">
|
|
<div class="flex justify-center">
|
|
<div
|
|
class="inline-flex items-center rounded-full bg-gray-800/80 p-1 text-sm"
|
|
role="group"
|
|
aria-label="Upload mode selector"
|
|
>
|
|
<button
|
|
type="button"
|
|
class="upload-mode-toggle flex-1 rounded-full px-4 py-2 font-medium text-gray-300 transition-colors hover:bg-gray-700/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-gray-900"
|
|
data-upload-mode="custom"
|
|
aria-pressed="true"
|
|
>
|
|
Custom
|
|
</button>
|
|
<button
|
|
type="button"
|
|
class="upload-mode-toggle flex-1 rounded-full px-4 py-2 font-medium text-gray-300 transition-colors hover:bg-gray-700/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-gray-900"
|
|
data-upload-mode="cloudflare"
|
|
aria-pressed="false"
|
|
>
|
|
Cloudflare
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="customUploadSection">
|
|
<form id="uploadForm" class="space-y-6">
|
|
<p class="text-sm text-gray-400">
|
|
Share a title plus either a hosted video URL or a magnet link. Providing both helps bitvid fall back gracefully.
|
|
</p>
|
|
<div>
|
|
<label
|
|
for="uploadTitle"
|
|
class="block text-sm font-medium text-gray-200"
|
|
>Title</label
|
|
>
|
|
<input
|
|
type="text"
|
|
id="uploadTitle"
|
|
required
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
</div>
|
|
|
|
<div class="space-y-4 rounded-lg border border-gray-800 bg-black/30 p-4" id="nip71EventDetails" data-nip71-section="event-details">
|
|
<fieldset id="nip71KindFieldset" class="space-y-2" data-nip71-fieldset="kind">
|
|
<legend class="text-sm font-semibold text-gray-200">NIP-71 event type</legend>
|
|
<p class="text-xs text-gray-400">
|
|
Choose the video format. <span class="font-medium text-gray-300">Kind 21</span> is a full video, while
|
|
<span class="font-medium text-gray-300">Kind 22</span> is a short.
|
|
</p>
|
|
<div class="flex flex-wrap gap-4" role="radiogroup" aria-labelledby="nip71KindFieldset">
|
|
<label class="flex items-center gap-2 text-sm text-gray-200">
|
|
<input
|
|
type="radio"
|
|
name="nip71Kind"
|
|
id="nip71KindLong"
|
|
value="21"
|
|
checked
|
|
data-nip71-input="kind"
|
|
class="h-4 w-4 border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
/>
|
|
Normal video (kind 21)
|
|
</label>
|
|
<label class="flex items-center gap-2 text-sm text-gray-200">
|
|
<input
|
|
type="radio"
|
|
name="nip71Kind"
|
|
id="nip71KindShort"
|
|
value="22"
|
|
data-nip71-input="kind"
|
|
class="h-4 w-4 border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
/>
|
|
Short video (kind 22)
|
|
</label>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<div class="grid gap-4 md:grid-cols-2" data-nip71-grid="metadata">
|
|
<div>
|
|
<label for="nip71PublishedAt" class="block text-sm font-medium text-gray-200">Published at</label>
|
|
<input
|
|
type="datetime-local"
|
|
id="nip71PublishedAt"
|
|
data-nip71-input="published_at"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Set the canonical publish time for cross-client ordering.</p>
|
|
</div>
|
|
<div>
|
|
<label for="nip71AltText" class="block text-sm font-medium text-gray-200">Alt text</label>
|
|
<input
|
|
type="text"
|
|
id="nip71AltText"
|
|
data-nip71-input="alt"
|
|
placeholder="Describe the visuals for screen readers"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Plain-language fallback shown when the media cannot load.</p>
|
|
</div>
|
|
<div>
|
|
<label for="nip71Duration" class="block text-sm font-medium text-gray-200">Duration (seconds)</label>
|
|
<input
|
|
type="number"
|
|
id="nip71Duration"
|
|
min="0"
|
|
step="1"
|
|
data-nip71-input="duration"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Provide the runtime in whole seconds for timeline scrubbing.</p>
|
|
</div>
|
|
<div>
|
|
<label for="nip71ContentWarning" class="block text-sm font-medium text-gray-200">Content warning</label>
|
|
<input
|
|
type="text"
|
|
id="nip71ContentWarning"
|
|
data-nip71-input="content-warning"
|
|
placeholder="e.g., Flashing lights"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Leave blank if the video is safe for all audiences.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="nip71Summary" class="block text-sm font-medium text-gray-200">Summary</label>
|
|
<textarea
|
|
id="nip71Summary"
|
|
rows="3"
|
|
data-nip71-input="summary"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
placeholder="Short synopsis used as the Nostr content field"
|
|
></textarea>
|
|
<p class="mt-1 text-xs text-gray-400">This becomes the event content. Keep it concise for Nostr readers.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Hosted video URL -->
|
|
<div class="form-group">
|
|
<label
|
|
for="uploadUrl"
|
|
class="block text-sm font-medium text-gray-200"
|
|
>Hosted video URL (https)</label
|
|
>
|
|
<input
|
|
id="uploadUrl"
|
|
type="url"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
placeholder="https://cdn.example.com/video.mp4"
|
|
/>
|
|
<small class="mt-1 block text-xs text-gray-400"
|
|
>Optional but preferred. We will play this first and fall back to
|
|
P2P.</small
|
|
>
|
|
</div>
|
|
|
|
<!-- Optional: seed bootstraps for magnet -->
|
|
<div class="grid grid-cols-1 gap-3 mb-2 text-xs">
|
|
<input
|
|
id="uploadWs"
|
|
type="url"
|
|
class="w-full p-2 rounded"
|
|
placeholder="Web seed (ws=) e.g., https://cdn.example.com/video.mp4"
|
|
>
|
|
<input
|
|
id="uploadXs"
|
|
type="url"
|
|
class="w-full p-2 rounded"
|
|
placeholder=".torrent URL (xs=) e.g., https://cdn.example.com/video.torrent"
|
|
>
|
|
</div>
|
|
|
|
<div>
|
|
<label
|
|
for="uploadMagnet"
|
|
class="block text-sm font-medium text-gray-200"
|
|
>Magnet link (optional if URL provided)</label
|
|
>
|
|
<input
|
|
type="text"
|
|
id="uploadMagnet"
|
|
placeholder="magnet:?xt=urn:btih:..."
|
|
class="mt-1 block w-full rounded-md border border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">
|
|
Provide a hosted URL for instant playback. Add a magnet for P2P
|
|
cost control.
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<label
|
|
for="uploadThumbnail"
|
|
class="block text-sm font-medium text-gray-200"
|
|
>Thumbnail URL (optional)</label
|
|
>
|
|
<input
|
|
type="url"
|
|
id="uploadThumbnail"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
</div>
|
|
|
|
<div>
|
|
<label
|
|
for="uploadDescription"
|
|
class="block text-sm font-medium text-gray-200"
|
|
>Legacy description (optional)</label
|
|
>
|
|
<textarea
|
|
id="uploadDescription"
|
|
rows="3"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
></textarea>
|
|
<p class="mt-1 text-xs text-gray-400">Kept for older clients that rely on the legacy description tag.</p>
|
|
</div>
|
|
|
|
<fieldset
|
|
id="nip71TagsFieldset"
|
|
class="space-y-6 rounded-lg border border-gray-800 bg-black/30 p-4"
|
|
data-nip71-section="tags"
|
|
>
|
|
<legend class="relative text-sm font-semibold text-gray-200">
|
|
<span class="inline-block -ml-2 rounded px-2 bg-black/30">NIP-71 tags</span>
|
|
</legend>
|
|
<p class="text-xs text-gray-400">
|
|
Use the controls below to describe media variants, captions, chapters, participants, and references.
|
|
</p>
|
|
|
|
<section class="space-y-4" aria-labelledby="nip71ImetaLabel" data-nip71-repeater="imeta">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="nip71ImetaLabel" class="text-sm font-medium text-gray-200">Image metadata (imeta)</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="imeta"
|
|
aria-describedby="nip71ImetaHelp"
|
|
>
|
|
Add variant
|
|
</button>
|
|
</div>
|
|
<p id="nip71ImetaHelp" class="text-xs text-gray-400">
|
|
Provide dimensions, MIME type, and resource links for each variant. Nested repeaters let you attach multiple
|
|
<code>image</code>, <code>fallback</code>, or <code>service</code> values.
|
|
</p>
|
|
<div id="nip71ImetaList" class="space-y-4" data-nip71-list="imeta"></div>
|
|
<template id="nip71ImetaTemplate" data-nip71-template="imeta">
|
|
<article class="space-y-3 rounded-md border border-gray-800 bg-gray-900/60 p-4" data-nip71-entry="imeta">
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
MIME type (<code>m</code>)
|
|
</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="m"
|
|
placeholder="video/mp4"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">RFC 2046 media type for this encoding.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
Pixel dimensions (<code>dim</code>)
|
|
</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="dim"
|
|
placeholder="1920x1080"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Formatted as widthxheight.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
Streaming URL (<code>url</code>)
|
|
</label>
|
|
<input
|
|
type="url"
|
|
data-nip71-field="url"
|
|
placeholder="https://cdn.example.com/variant.m3u8"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">HTTPS variant URL shared across clients.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
Magnet (<code>x</code>)
|
|
</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="x"
|
|
placeholder="magnet:?xt=urn:btih:..."
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Optional magnet pointer if the variant is seeded via P2P.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-3" data-nip71-nested="image">
|
|
<div class="flex items-center justify-between">
|
|
<h4 class="text-xs font-semibold uppercase tracking-wide text-gray-400">Image values</h4>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-nested-add="image"
|
|
>
|
|
Add image URL
|
|
</button>
|
|
</div>
|
|
<div class="space-y-2" data-nip71-nested-list="image"></div>
|
|
<template data-nip71-nested-template="image">
|
|
<div class="flex items-center gap-2" data-nip71-nested-entry="image">
|
|
<input
|
|
type="url"
|
|
placeholder="https://cdn.example.com/poster.jpg"
|
|
data-nip71-nested-field="image"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-300 hover:border-gray-500 hover:text-white"
|
|
data-nip71-remove="nested"
|
|
aria-label="Remove image URL"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<div class="space-y-3" data-nip71-nested="fallback">
|
|
<div class="flex items-center justify-between">
|
|
<h4 class="text-xs font-semibold uppercase tracking-wide text-gray-400">Fallback URLs</h4>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-nested-add="fallback"
|
|
>
|
|
Add fallback
|
|
</button>
|
|
</div>
|
|
<div class="space-y-2" data-nip71-nested-list="fallback"></div>
|
|
<template data-nip71-nested-template="fallback">
|
|
<div class="flex items-center gap-2" data-nip71-nested-entry="fallback">
|
|
<input
|
|
type="url"
|
|
placeholder="https://cdn.backup.net/video.mp4"
|
|
data-nip71-nested-field="fallback"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-300 hover:border-gray-500 hover:text-white"
|
|
data-nip71-remove="nested"
|
|
aria-label="Remove fallback URL"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<div class="space-y-3" data-nip71-nested="service">
|
|
<div class="flex items-center justify-between">
|
|
<h4 class="text-xs font-semibold uppercase tracking-wide text-gray-400">Services</h4>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-nested-add="service"
|
|
>
|
|
Add service hint
|
|
</button>
|
|
</div>
|
|
<div class="space-y-2" data-nip71-nested-list="service"></div>
|
|
<template data-nip71-nested-template="service">
|
|
<div class="flex items-center gap-2" data-nip71-nested-entry="service">
|
|
<input
|
|
type="text"
|
|
placeholder="streaming-provider-id"
|
|
data-nip71-nested-field="service"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-300 hover:border-gray-500 hover:text-white"
|
|
data-nip71-remove="nested"
|
|
aria-label="Remove service hint"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-red-500/50 px-3 py-1 text-xs font-semibold text-red-300 hover:border-red-400 hover:text-red-200"
|
|
data-nip71-remove="imeta"
|
|
>
|
|
Remove variant
|
|
</button>
|
|
</article>
|
|
</template>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="nip71TextTracksLabel" data-nip71-repeater="text-track">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="nip71TextTracksLabel" class="text-sm font-medium text-gray-200">Caption & subtitle tracks (text-track)</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="text-track"
|
|
aria-describedby="nip71TextTracksHelp"
|
|
>
|
|
Add track
|
|
</button>
|
|
</div>
|
|
<p id="nip71TextTracksHelp" class="text-xs text-gray-400">
|
|
Point to VTT/SRT caption files and optionally declare the language code (BCP-47).
|
|
</p>
|
|
<div id="nip71TextTrackList" class="space-y-4" data-nip71-list="text-track"></div>
|
|
<template id="nip71TextTrackTemplate" data-nip71-template="text-track">
|
|
<article class="space-y-3 rounded-md border border-gray-800 bg-gray-900/60 p-4" data-nip71-entry="text-track">
|
|
<div class="grid gap-3 md:grid-cols-3">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">Resource URL</label>
|
|
<input
|
|
type="url"
|
|
data-nip71-field="url"
|
|
placeholder="https://cdn.example.com/captions.en.vtt"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Direct link to the caption file.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">Track type</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="type"
|
|
placeholder="subtitles"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Use values like captions, subtitles, or descriptions.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">Language (optional)</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="language"
|
|
placeholder="en-US"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">BCP-47 locale code.</p>
|
|
</div>
|
|
</div>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-red-500/50 px-3 py-1 text-xs font-semibold text-red-300 hover:border-red-400 hover:text-red-200"
|
|
data-nip71-remove="text-track"
|
|
>
|
|
Remove track
|
|
</button>
|
|
</article>
|
|
</template>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="nip71SegmentsLabel" data-nip71-repeater="segment">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="nip71SegmentsLabel" class="text-sm font-medium text-gray-200">Chapters & segments (segment)</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="segment"
|
|
aria-describedby="nip71SegmentsHelp"
|
|
>
|
|
Add segment
|
|
</button>
|
|
</div>
|
|
<p id="nip71SegmentsHelp" class="text-xs text-gray-400">
|
|
Outline the timeline using HH:MM:SS timestamps. Thumbnail URLs are optional.
|
|
</p>
|
|
<div id="nip71SegmentList" class="space-y-4" data-nip71-list="segment"></div>
|
|
<template id="nip71SegmentTemplate" data-nip71-template="segment">
|
|
<article class="space-y-3 rounded-md border border-gray-800 bg-gray-900/60 p-4" data-nip71-entry="segment">
|
|
<div class="grid gap-3 md:grid-cols-4">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">Start</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="start"
|
|
placeholder="00:00:00"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">HH:MM:SS</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">End</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="end"
|
|
placeholder="00:03:30"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Leave blank for open-ended segments.</p>
|
|
</div>
|
|
<div class="md:col-span-2">
|
|
<label class="block text-xs font-medium text-gray-300">Chapter title</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="title"
|
|
placeholder="Introduction"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
</div>
|
|
<div class="md:col-span-2">
|
|
<label class="block text-xs font-medium text-gray-300">Thumbnail URL</label>
|
|
<input
|
|
type="url"
|
|
data-nip71-field="thumbnail"
|
|
placeholder="https://cdn.example.com/segment.jpg"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Optional still image for this moment.</p>
|
|
</div>
|
|
</div>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-red-500/50 px-3 py-1 text-xs font-semibold text-red-300 hover:border-red-400 hover:text-red-200"
|
|
data-nip71-remove="segment"
|
|
>
|
|
Remove segment
|
|
</button>
|
|
</article>
|
|
</template>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="nip71HashtagsLabel" data-nip71-repeater="t">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="nip71HashtagsLabel" class="text-sm font-medium text-gray-200">Hashtags (<code>t</code>)</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="t"
|
|
>
|
|
Add hashtag
|
|
</button>
|
|
</div>
|
|
<p class="text-xs text-gray-400">
|
|
Enter keywords; leading <code>#</code> characters are stripped automatically when saving.
|
|
</p>
|
|
<div id="nip71HashtagList" class="space-y-2" data-nip71-list="t"></div>
|
|
<template id="nip71HashtagTemplate" data-nip71-template="t">
|
|
<div class="flex items-center gap-2" data-nip71-entry="t">
|
|
<input
|
|
type="text"
|
|
data-nip71-field="value"
|
|
placeholder="#nostr"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-red-500/50 px-2 py-1 text-[11px] text-red-300 hover:border-red-400 hover:text-red-200"
|
|
data-nip71-remove="t"
|
|
aria-label="Remove hashtag"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="nip71ParticipantsLabel" data-nip71-repeater="p">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="nip71ParticipantsLabel" class="text-sm font-medium text-gray-200">Participants (<code>p</code>)</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="p"
|
|
>
|
|
Add participant
|
|
</button>
|
|
</div>
|
|
<p class="text-xs text-gray-400">Paste the participant npub or hex pubkey. Optionally provide a preferred relay URL.</p>
|
|
<div id="nip71ParticipantList" class="space-y-3" data-nip71-list="p"></div>
|
|
<template id="nip71ParticipantTemplate" data-nip71-template="p">
|
|
<article class="space-y-3 rounded-md border border-gray-800 bg-gray-900/60 p-4" data-nip71-entry="p">
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">Pubkey</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="pubkey"
|
|
placeholder="npub1..."
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Accepts npub or hex.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">Relay URL (optional)</label>
|
|
<input
|
|
type="url"
|
|
data-nip71-field="relay"
|
|
placeholder="wss://relay.example.com"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Relay hint for discovering the participant.</p>
|
|
</div>
|
|
</div>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-red-500/50 px-3 py-1 text-xs font-semibold text-red-300 hover:border-red-400 hover:text-red-200"
|
|
data-nip71-remove="p"
|
|
>
|
|
Remove participant
|
|
</button>
|
|
</article>
|
|
</template>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="nip71ReferencesLabel" data-nip71-repeater="r">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="nip71ReferencesLabel" class="text-sm font-medium text-gray-200">Reference links (<code>r</code>)</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="r"
|
|
>
|
|
Add reference
|
|
</button>
|
|
</div>
|
|
<p class="text-xs text-gray-400">Link to transcripts, source repositories, or related resources.</p>
|
|
<div id="nip71ReferenceList" class="space-y-2" data-nip71-list="r"></div>
|
|
<template id="nip71ReferenceTemplate" data-nip71-template="r">
|
|
<div class="flex items-center gap-2" data-nip71-entry="r">
|
|
<input
|
|
type="url"
|
|
data-nip71-field="url"
|
|
placeholder="https://example.com/article"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-red-500/50 px-2 py-1 text-[11px] text-red-300 hover:border-red-400 hover:text-red-200"
|
|
data-nip71-remove="r"
|
|
aria-label="Remove reference"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</section>
|
|
</fieldset>
|
|
|
|
<div class="flex items-start gap-3 rounded-md border border-gray-800 bg-black/30 p-3">
|
|
<input
|
|
type="checkbox"
|
|
id="uploadEnableComments"
|
|
class="mt-1 h-5 w-5 rounded border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
checked
|
|
data-default-checked="true"
|
|
/>
|
|
<div>
|
|
<label for="uploadEnableComments" class="text-sm font-medium text-gray-200"
|
|
>Enable comments</label
|
|
>
|
|
<p class="mt-1 text-xs text-gray-400">
|
|
Keep this on to let viewers discuss the video once comment threads launch.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div class="flex items-start gap-3 rounded-md border border-gray-800 bg-black/30 p-3">
|
|
<input
|
|
type="checkbox"
|
|
id="uploadIsNsfw"
|
|
class="mt-1 h-5 w-5 rounded border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
data-default-checked="false"
|
|
/>
|
|
<div>
|
|
<label for="uploadIsNsfw" class="text-sm font-medium text-gray-200"
|
|
>Is this content NSFW?</label
|
|
>
|
|
<p class="mt-1 text-xs text-gray-400">
|
|
Flag mature or explicit uploads so clients can warn viewers before playback.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-start gap-3 rounded-md border border-gray-800 bg-black/30 p-3">
|
|
<input
|
|
type="checkbox"
|
|
id="uploadIsForKids"
|
|
class="mt-1 h-5 w-5 rounded border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
data-default-checked="false"
|
|
/>
|
|
<div>
|
|
<label for="uploadIsForKids" class="text-sm font-medium text-gray-200"
|
|
>Is this content created for Kids?</label
|
|
>
|
|
<p class="mt-1 text-xs text-gray-400">
|
|
Mark clearly kid-friendly videos so parental controls and playlists stay accurate.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--
|
|
<div class="flex items-center space-x-2">
|
|
<input
|
|
type="checkbox"
|
|
id="uploadIsPrivate"
|
|
class="form-checkbox h-5 w-5 text-blue-500"
|
|
/>
|
|
<span class="text-sm font-medium text-gray-200"
|
|
>Private Listing (Hide from shared grids)</span
|
|
>
|
|
</div>
|
|
-->
|
|
<button
|
|
type="submit"
|
|
class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
|
|
>
|
|
Publish
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div id="cloudflareUploadSection" class="hidden">
|
|
<div class="space-y-8">
|
|
<p class="rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-sm text-amber-300">
|
|
This feature is experimental and may not be working correctly.
|
|
</p>
|
|
<section class="rounded-lg border border-gray-800 bg-gray-900/60 p-5">
|
|
<div class="mb-4 flex items-center justify-between">
|
|
<h3 class="text-lg font-semibold text-gray-100">
|
|
Cloudflare R2 credentials
|
|
</h3>
|
|
<span class="text-xs uppercase tracking-wide text-gray-500">
|
|
stored locally
|
|
</span>
|
|
</div>
|
|
<p class="mb-4 text-sm text-gray-400">
|
|
Paste your Cloudflare R2 API credentials. We keep them in your
|
|
browser so uploads happen client-side.
|
|
</p>
|
|
<form id="cloudflareSettingsForm" class="space-y-4">
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div>
|
|
<label for="r2AccountId" class="block text-sm font-medium text-gray-200"
|
|
>Account ID</label
|
|
>
|
|
<input
|
|
id="r2AccountId"
|
|
type="text"
|
|
autocomplete="off"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
placeholder="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
required
|
|
/>
|
|
</div>
|
|
<div>
|
|
<label for="r2AccessKeyId" class="block text-sm font-medium text-gray-200"
|
|
>S3 Access Key ID</label
|
|
>
|
|
<input
|
|
id="r2AccessKeyId"
|
|
type="text"
|
|
autocomplete="off"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
placeholder="AKIA..."
|
|
required
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label for="r2SecretAccessKey" class="block text-sm font-medium text-gray-200"
|
|
>S3 Secret Access Key</label
|
|
>
|
|
<input
|
|
id="r2SecretAccessKey"
|
|
type="password"
|
|
autocomplete="off"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
required
|
|
/>
|
|
</div>
|
|
<div class="border-t border-gray-800 pt-4">
|
|
<button
|
|
type="button"
|
|
id="cloudflareAdvancedToggle"
|
|
class="flex items-center gap-2 text-sm font-medium text-gray-300 transition-colors hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900"
|
|
aria-expanded="false"
|
|
aria-controls="cloudflareAdvancedFields"
|
|
>
|
|
<svg
|
|
id="cloudflareAdvancedToggleIcon"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
class="h-4 w-4 text-gray-300 transition-transform duration-150 transform"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke="currentColor"
|
|
stroke-width="2"
|
|
>
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
</svg>
|
|
<span id="cloudflareAdvancedToggleLabel">Show advanced options</span>
|
|
</button>
|
|
<div
|
|
id="cloudflareAdvancedFields"
|
|
class="mt-3 space-y-4 hidden"
|
|
>
|
|
<div>
|
|
<label for="r2ApiToken" class="block text-sm font-medium text-gray-200"
|
|
>Cloudflare API Token (optional)</label
|
|
>
|
|
<input
|
|
id="r2ApiToken"
|
|
type="password"
|
|
autocomplete="off"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
placeholder="Token with Workers R2 Storage Write"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-500">
|
|
Used to create buckets, configure CORS, and attach domains automatically.
|
|
</p>
|
|
</div>
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div>
|
|
<label for="r2ZoneId" class="block text-sm font-medium text-gray-200"
|
|
>Zone ID (optional)</label
|
|
>
|
|
<input
|
|
id="r2ZoneId"
|
|
type="text"
|
|
autocomplete="off"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
placeholder="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-500">
|
|
Required when you want us to attach a custom domain on your behalf.
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<label for="r2BaseDomain" class="block text-sm font-medium text-gray-200"
|
|
>Base domain (optional)</label
|
|
>
|
|
<input
|
|
id="r2BaseDomain"
|
|
type="text"
|
|
autocomplete="off"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
placeholder="cdn.example.com"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-500">
|
|
We'll attach <code class="rounded bg-gray-800 px-1 py-0.5">npub.<baseDomain></code>.
|
|
Leave blank to use the managed <code class="rounded bg-gray-800 px-1 py-0.5">*.r2.dev</code> domain.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-wrap items-center gap-3">
|
|
<button
|
|
type="submit"
|
|
class="rounded-md bg-blue-500 px-4 py-2 text-sm font-semibold text-white transition hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
>
|
|
Save settings
|
|
</button>
|
|
<button
|
|
type="button"
|
|
id="cloudflareClearSettings"
|
|
class="rounded-md border border-gray-600 px-4 py-2 text-sm font-semibold text-gray-200 transition hover:border-gray-500 hover:text-white focus:outline-none focus:ring-2 focus:ring-gray-500"
|
|
>
|
|
Clear
|
|
</button>
|
|
<span
|
|
id="cloudflareSettingsStatus"
|
|
class="text-xs text-gray-400"
|
|
role="status"
|
|
></span>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="rounded-lg border border-gray-800 bg-gray-900/60 p-5">
|
|
<div class="mb-4">
|
|
<h3 class="text-lg font-semibold text-gray-100">
|
|
Upload & publish
|
|
</h3>
|
|
<p class="mt-1 text-sm text-gray-400">
|
|
Choose a file, we will upload it to R2, fill the hosted URL,
|
|
and publish your note automatically.
|
|
</p>
|
|
</div>
|
|
<form id="cloudflareUploadForm" class="space-y-4">
|
|
<div>
|
|
<label for="cloudflareTitle" class="block text-sm font-medium text-gray-200"
|
|
>Title</label
|
|
>
|
|
<input
|
|
id="cloudflareTitle"
|
|
type="text"
|
|
required
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
/>
|
|
</div>
|
|
<div
|
|
class="space-y-4 rounded-lg border border-gray-800 bg-black/30 p-4"
|
|
id="cloudflareNip71EventDetails"
|
|
data-nip71-section="event-details"
|
|
>
|
|
<fieldset
|
|
id="cloudflareNip71KindFieldset"
|
|
class="space-y-2"
|
|
data-nip71-fieldset="kind"
|
|
>
|
|
<legend class="text-sm font-semibold text-gray-200">
|
|
NIP-71 event type
|
|
</legend>
|
|
<p class="text-xs text-gray-400">
|
|
Choose the video format. <span class="font-medium text-gray-300">Kind 21</span> is a full video, while
|
|
<span class="font-medium text-gray-300">Kind 22</span> is a short.
|
|
</p>
|
|
<div
|
|
class="flex flex-wrap gap-4"
|
|
role="radiogroup"
|
|
aria-labelledby="cloudflareNip71KindFieldset"
|
|
>
|
|
<label class="flex items-center gap-2 text-sm text-gray-200">
|
|
<input
|
|
type="radio"
|
|
name="cloudflareNip71Kind"
|
|
id="cloudflareNip71KindLong"
|
|
value="21"
|
|
checked
|
|
data-nip71-input="kind"
|
|
class="h-4 w-4 border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
/>
|
|
Normal video (kind 21)
|
|
</label>
|
|
<label class="flex items-center gap-2 text-sm text-gray-200">
|
|
<input
|
|
type="radio"
|
|
name="cloudflareNip71Kind"
|
|
id="cloudflareNip71KindShort"
|
|
value="22"
|
|
data-nip71-input="kind"
|
|
class="h-4 w-4 border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
/>
|
|
Short video (kind 22)
|
|
</label>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<div class="grid gap-4 md:grid-cols-2" data-nip71-grid="metadata">
|
|
<div>
|
|
<label for="cloudflareNip71PublishedAt" class="block text-sm font-medium text-gray-200">
|
|
Published at
|
|
</label>
|
|
<input
|
|
type="datetime-local"
|
|
id="cloudflareNip71PublishedAt"
|
|
data-nip71-input="published_at"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Set the canonical publish time for cross-client ordering.</p>
|
|
</div>
|
|
<div>
|
|
<label for="cloudflareNip71AltText" class="block text-sm font-medium text-gray-200">Alt text</label>
|
|
<input
|
|
type="text"
|
|
id="cloudflareNip71AltText"
|
|
data-nip71-input="alt"
|
|
placeholder="Describe the visuals for screen readers"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Plain-language fallback shown when the media cannot load.</p>
|
|
</div>
|
|
<div>
|
|
<label for="cloudflareNip71Duration" class="block text-sm font-medium text-gray-200">
|
|
Duration (seconds)
|
|
</label>
|
|
<input
|
|
type="number"
|
|
id="cloudflareNip71Duration"
|
|
min="0"
|
|
step="1"
|
|
data-nip71-input="duration"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Provide the runtime in whole seconds for timeline scrubbing.</p>
|
|
</div>
|
|
<div>
|
|
<label for="cloudflareNip71ContentWarning" class="block text-sm font-medium text-gray-200">
|
|
Content warning
|
|
</label>
|
|
<input
|
|
type="text"
|
|
id="cloudflareNip71ContentWarning"
|
|
data-nip71-input="content-warning"
|
|
placeholder="e.g., Flashing lights"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-400">Leave blank if the video is safe for all audiences.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="cloudflareNip71Summary" class="block text-sm font-medium text-gray-200">Summary</label>
|
|
<textarea
|
|
id="cloudflareNip71Summary"
|
|
rows="3"
|
|
data-nip71-input="summary"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
placeholder="Short synopsis used as the Nostr content field"
|
|
></textarea>
|
|
<p class="mt-1 text-xs text-gray-400">This becomes the event content. Keep it concise for Nostr readers.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label for="cloudflareDescription" class="block text-sm font-medium text-gray-200"
|
|
>Description (optional)</label
|
|
>
|
|
<textarea
|
|
id="cloudflareDescription"
|
|
rows="3"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
></textarea>
|
|
</div>
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div>
|
|
<label for="cloudflareThumbnail" class="block text-sm font-medium text-gray-200"
|
|
>Thumbnail URL (optional)</label
|
|
>
|
|
<input
|
|
id="cloudflareThumbnail"
|
|
type="url"
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
/>
|
|
</div>
|
|
<div>
|
|
<label for="cloudflareMagnet" class="block text-sm font-medium text-gray-200"
|
|
>Magnet link (optional)</label
|
|
>
|
|
<input
|
|
id="cloudflareMagnet"
|
|
type="text"
|
|
placeholder="magnet:?xt=urn:btih:..."
|
|
class="mt-1 w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<input
|
|
id="cloudflareWs"
|
|
type="url"
|
|
placeholder="Web seed (ws=)"
|
|
class="w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
/>
|
|
<input
|
|
id="cloudflareXs"
|
|
type="url"
|
|
placeholder=".torrent URL (xs=)"
|
|
class="w-full rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
/>
|
|
</div>
|
|
<fieldset
|
|
id="cloudflareNip71TagsFieldset"
|
|
class="space-y-6 rounded-lg border border-gray-800 bg-black/30 p-4"
|
|
data-nip71-section="tags"
|
|
>
|
|
<legend class="text-sm font-semibold text-gray-200">NIP-71 tags</legend>
|
|
<p class="text-xs text-gray-400">
|
|
Use the controls below to describe media variants, captions, chapters, participants, and references.
|
|
</p>
|
|
|
|
<section class="space-y-4" aria-labelledby="cloudflareNip71ImetaLabel" data-nip71-repeater="imeta">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="cloudflareNip71ImetaLabel" class="text-sm font-medium text-gray-200">
|
|
Image metadata (imeta)
|
|
</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="imeta"
|
|
aria-describedby="cloudflareNip71ImetaHelp"
|
|
>
|
|
Add variant
|
|
</button>
|
|
</div>
|
|
<p id="cloudflareNip71ImetaHelp" class="text-xs text-gray-400">
|
|
Provide dimensions, MIME type, and resource links for each variant. Nested repeaters let you attach multiple
|
|
<code>image</code>, <code>fallback</code>, or <code>service</code> values.
|
|
</p>
|
|
<div
|
|
id="cloudflareNip71ImetaList"
|
|
class="space-y-4"
|
|
data-nip71-list="imeta"
|
|
>
|
|
<article
|
|
class="space-y-3 rounded-md border border-gray-800 bg-gray-900/60 p-4"
|
|
data-nip71-entry="imeta"
|
|
data-nip71-primary="true"
|
|
>
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
MIME type (<code>m</code>)
|
|
</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="m"
|
|
placeholder="Auto-filled after upload (e.g., video/mp4)"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">RFC 2046 media type for this encoding.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
Pixel dimensions (<code>dim</code>)
|
|
</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="dim"
|
|
placeholder="Auto-filled if detected (e.g., 1920x1080)"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Formatted as widthxheight.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
Streaming URL (<code>url</code>)
|
|
</label>
|
|
<input
|
|
type="url"
|
|
data-nip71-field="url"
|
|
placeholder="Auto-filled after upload with the public HTTPS URL"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">HTTPS variant URL shared across clients.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-300">
|
|
Magnet (<code>x</code>)
|
|
</label>
|
|
<input
|
|
type="text"
|
|
data-nip71-field="x"
|
|
placeholder="Optional magnet pointer if seeding via P2P"
|
|
class="mt-1 block w-full rounded-md border-gray-700 bg-gray-800 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<p class="mt-1 text-[11px] text-gray-500">Optional magnet pointer if the variant is seeded via P2P.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-3" data-nip71-nested="image">
|
|
<div class="flex items-center justify-between">
|
|
<h4 class="text-xs font-semibold uppercase tracking-wide text-gray-400">Image values</h4>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-nested-add="image"
|
|
>
|
|
Add image URL
|
|
</button>
|
|
</div>
|
|
<div class="space-y-2" data-nip71-nested-list="image"></div>
|
|
<template data-nip71-nested-template="image">
|
|
<div class="flex items-center gap-2" data-nip71-nested-entry="image">
|
|
<input
|
|
type="url"
|
|
placeholder="https://cdn.example.com/poster.jpg"
|
|
data-nip71-nested-field="image"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-300 hover:border-gray-500 hover:text-white"
|
|
data-nip71-remove="nested"
|
|
aria-label="Remove image URL"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<div class="space-y-3" data-nip71-nested="fallback">
|
|
<div class="flex items-center justify-between">
|
|
<h4 class="text-xs font-semibold uppercase tracking-wide text-gray-400">Fallback URLs</h4>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-nested-add="fallback"
|
|
>
|
|
Add fallback
|
|
</button>
|
|
</div>
|
|
<div class="space-y-2" data-nip71-nested-list="fallback"></div>
|
|
<template data-nip71-nested-template="fallback">
|
|
<div class="flex items-center gap-2" data-nip71-nested-entry="fallback">
|
|
<input
|
|
type="url"
|
|
placeholder="https://cdn.backup.net/video.mp4"
|
|
data-nip71-nested-field="fallback"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-300 hover:border-gray-500 hover:text-white"
|
|
data-nip71-remove="nested"
|
|
aria-label="Remove fallback URL"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<div class="space-y-3" data-nip71-nested="service">
|
|
<div class="flex items-center justify-between">
|
|
<h4 class="text-xs font-semibold uppercase tracking-wide text-gray-400">Services</h4>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-nested-add="service"
|
|
>
|
|
Add service hint
|
|
</button>
|
|
</div>
|
|
<div class="space-y-2" data-nip71-nested-list="service"></div>
|
|
<template data-nip71-nested-template="service">
|
|
<div class="flex items-center gap-2" data-nip71-nested-entry="service">
|
|
<input
|
|
type="text"
|
|
placeholder="streaming-provider-id"
|
|
data-nip71-nested-field="service"
|
|
class="flex-1 rounded-md border border-gray-700 bg-gray-800 px-3 py-2 text-gray-100 focus:border-blue-500 focus:ring-blue-500"
|
|
/>
|
|
<button
|
|
type="button"
|
|
class="rounded border border-gray-700 px-2 py-1 text-[11px] text-gray-300 hover:border-gray-500 hover:text-white"
|
|
data-nip71-remove="nested"
|
|
aria-label="Remove service hint"
|
|
>
|
|
Remove
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-red-500/50 px-3 py-1 text-xs font-semibold text-red-300 hover:border-red-400 hover:text-red-200"
|
|
data-nip71-remove="imeta"
|
|
>
|
|
Remove variant
|
|
</button>
|
|
</article>
|
|
</div>
|
|
</section>
|
|
|
|
<section
|
|
class="space-y-4"
|
|
aria-labelledby="cloudflareNip71TextTracksLabel"
|
|
data-nip71-repeater="text-track"
|
|
>
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="cloudflareNip71TextTracksLabel" class="text-sm font-medium text-gray-200">
|
|
Caption & subtitle tracks (text-track)
|
|
</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="text-track"
|
|
aria-describedby="cloudflareNip71TextTracksHelp"
|
|
>
|
|
Add track
|
|
</button>
|
|
</div>
|
|
<p id="cloudflareNip71TextTracksHelp" class="text-xs text-gray-400">
|
|
Point to VTT/SRT caption files and optionally declare the language code (BCP-47).
|
|
</p>
|
|
<div id="cloudflareNip71TextTrackList" class="space-y-4" data-nip71-list="text-track"></div>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="cloudflareNip71SegmentsLabel" data-nip71-repeater="segment">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="cloudflareNip71SegmentsLabel" class="text-sm font-medium text-gray-200">
|
|
Timeline segments (segment)
|
|
</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="segment"
|
|
aria-describedby="cloudflareNip71SegmentsHelp"
|
|
>
|
|
Add chapter
|
|
</button>
|
|
</div>
|
|
<p id="cloudflareNip71SegmentsHelp" class="text-xs text-gray-400">
|
|
Define chapters by timestamp so clients can build jump lists.
|
|
</p>
|
|
<div id="cloudflareNip71SegmentList" class="space-y-4" data-nip71-list="segment"></div>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="cloudflareNip71HashtagsLabel" data-nip71-repeater="t">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="cloudflareNip71HashtagsLabel" class="text-sm font-medium text-gray-200">Hashtags (t)</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="t"
|
|
aria-describedby="cloudflareNip71HashtagsHelp"
|
|
>
|
|
Add hashtag
|
|
</button>
|
|
</div>
|
|
<p id="cloudflareNip71HashtagsHelp" class="text-xs text-gray-400">
|
|
Label the video with keywords to boost discovery across clients.
|
|
</p>
|
|
<div id="cloudflareNip71HashtagList" class="space-y-2" data-nip71-list="t"></div>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="cloudflareNip71ParticipantsLabel" data-nip71-repeater="p">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="cloudflareNip71ParticipantsLabel" class="text-sm font-medium text-gray-200">
|
|
Participants (p)
|
|
</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="p"
|
|
aria-describedby="cloudflareNip71ParticipantsHelp"
|
|
>
|
|
Add participant
|
|
</button>
|
|
</div>
|
|
<p id="cloudflareNip71ParticipantsHelp" class="text-xs text-gray-400">
|
|
Credit guests, hosts, or collaborators with their npubs and preferred relay hints.
|
|
</p>
|
|
<div id="cloudflareNip71ParticipantList" class="space-y-3" data-nip71-list="p"></div>
|
|
</section>
|
|
|
|
<section class="space-y-4" aria-labelledby="cloudflareNip71ReferencesLabel" data-nip71-repeater="r">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="cloudflareNip71ReferencesLabel" class="text-sm font-medium text-gray-200">
|
|
References (r)
|
|
</h3>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border border-gray-700 px-3 py-1 text-xs font-semibold text-gray-200 hover:border-gray-500 hover:text-white"
|
|
data-nip71-add="r"
|
|
aria-describedby="cloudflareNip71ReferencesHelp"
|
|
>
|
|
Add reference
|
|
</button>
|
|
</div>
|
|
<p id="cloudflareNip71ReferencesHelp" class="text-xs text-gray-400">
|
|
Link to companion articles, source material, or announcements that contextualize the upload.
|
|
</p>
|
|
<div id="cloudflareNip71ReferenceList" class="space-y-2" data-nip71-list="r"></div>
|
|
</section>
|
|
</fieldset>
|
|
<div class="flex items-start gap-3 rounded-md border border-gray-800 bg-black/30 p-3">
|
|
<input
|
|
type="checkbox"
|
|
id="cloudflareEnableComments"
|
|
class="mt-1 h-5 w-5 rounded border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
checked
|
|
data-default-checked="true"
|
|
/>
|
|
<div>
|
|
<label for="cloudflareEnableComments" class="text-sm font-medium text-gray-200"
|
|
>Enable comments</label
|
|
>
|
|
<p class="mt-1 text-xs text-gray-400">
|
|
Publish with comments switched on. Toggle off to quietly disable replies on this video.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="grid gap-3 md:grid-cols-2">
|
|
<div class="flex items-start gap-3 rounded-md border border-gray-800 bg-black/30 p-3">
|
|
<input
|
|
type="checkbox"
|
|
id="cloudflareIsNsfw"
|
|
class="mt-1 h-5 w-5 rounded border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
data-default-checked="false"
|
|
/>
|
|
<div>
|
|
<label for="cloudflareIsNsfw" class="text-sm font-medium text-gray-200"
|
|
>Is this content NSFW?</label
|
|
>
|
|
<p class="mt-1 text-xs text-gray-400">
|
|
Turn this on to signal mature or explicit material to downstream clients.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-start gap-3 rounded-md border border-gray-800 bg-black/30 p-3">
|
|
<input
|
|
type="checkbox"
|
|
id="cloudflareIsForKids"
|
|
class="mt-1 h-5 w-5 rounded border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500"
|
|
data-default-checked="false"
|
|
/>
|
|
<div>
|
|
<label for="cloudflareIsForKids" class="text-sm font-medium text-gray-200"
|
|
>Is this content created for Kids?</label
|
|
>
|
|
<p class="mt-1 text-xs text-gray-400">
|
|
Highlight family-safe uploads so moderation tooling and filters stay accurate.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label for="cloudflareFile" class="block text-sm font-medium text-gray-200"
|
|
>Video or HLS file</label
|
|
>
|
|
<input
|
|
id="cloudflareFile"
|
|
type="file"
|
|
accept="video/*,.m3u8,.ts,.mp4,.webm,.mov,.mkv,.mpg,.mpeg"
|
|
class="mt-1 w-full rounded-md border border-dashed border-gray-600 bg-gray-900 px-3 py-4 text-sm text-gray-300 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
required
|
|
/>
|
|
<p class="mt-1 text-xs text-gray-500">
|
|
We use multipart uploads with automatic bucket creation.
|
|
Large files are supported.
|
|
</p>
|
|
</div>
|
|
<div class="rounded-md border border-gray-800 bg-black/40 p-3 text-xs text-gray-400">
|
|
<p>
|
|
<strong class="text-gray-200">Bucket preview:</strong>
|
|
<span id="cloudflareBucketPreview" class="ml-1">We'll show your
|
|
bucket and public domain after setup.</span>
|
|
</p>
|
|
</div>
|
|
<div class="space-y-2">
|
|
<div
|
|
id="cloudflareProgressBar"
|
|
class="hidden h-2 w-full overflow-hidden rounded-full bg-gray-800"
|
|
>
|
|
<div
|
|
id="cloudflareProgressFill"
|
|
class="h-full w-0 bg-blue-500 transition-all duration-150"
|
|
></div>
|
|
</div>
|
|
<p
|
|
id="cloudflareUploadStatus"
|
|
class="text-xs text-gray-400"
|
|
role="status"
|
|
></p>
|
|
</div>
|
|
<button
|
|
type="submit"
|
|
id="cloudflareUploadButton"
|
|
class="w-full rounded-md bg-blue-500 px-4 py-2 text-sm font-semibold text-white transition hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:cursor-not-allowed disabled:bg-blue-900"
|
|
>
|
|
Upload to R2 & publish
|
|
</button>
|
|
</form>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|