Files
magnf-ext-poc/app.html
T
kiskaadee b734b8d414 feat(app): create pairing page with dynamic IMDb search and FastAPI send
- Render Section 1 containing captured magnet link with clear and edit controls
- Implement Section 2 with dynamic character-input IMDb search (250ms debounce)
- Display top 5 matches with posters, titles, years, IMDb IDs, and cast info
- Lock both sections upon selection and reveal prominent SEND button
- Dispatch download payload to FastAPI backend with live status feedback
2026-09-25 16:45:35 -05:00

133 lines
5.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Magnetflix - Pair Magnet & IMDb Movie</title>
<link rel="stylesheet" href="app.css">
</head>
<body>
<div class="app-container">
<!-- Header -->
<header class="app-header">
<div class="brand">
<span class="brand-icon">🧲</span>
<h1 class="brand-title">Magnetflix</h1>
</div>
<div class="header-badges">
<span class="badge badge-subtle">Proof of Concept</span>
<span class="badge badge-api">FastAPI :8000</span>
</div>
</header>
<main class="app-main">
<!-- Section 1: Magnet Link -->
<section class="card section-magnet" id="section-magnet">
<div class="section-header">
<div class="section-title-wrap">
<span class="section-number">1</span>
<h2>Captured Magnet Link</h2>
</div>
<span id="magnet-lock-badge" class="badge badge-locked hidden">🔒 Fixed</span>
</div>
<div class="form-group">
<div class="input-with-icon">
<input
type="text"
id="magnet-input"
name="magnet"
placeholder="Waiting for magnet link or paste here (e.g. magnet:?xt=urn:btih:...)"
spellcheck="false"
autocomplete="off"
/>
<button type="button" id="btn-clear-magnet" class="btn-icon" title="Clear input">✕</button>
</div>
<div class="field-hint" id="magnet-hint">
Ensure the magnet link starts with <code>magnet:?xt=urn:...</code>
</div>
</div>
</section>
<!-- Section 2: Movie Search -->
<section class="card section-movie" id="section-movie">
<div class="section-header">
<div class="section-title-wrap">
<span class="section-number">2</span>
<h2>Movie</h2>
</div>
<span id="movie-lock-badge" class="badge badge-locked hidden">🔒 Fixed</span>
</div>
<!-- Movie Input & Results Container (Visible when not fixed) -->
<div id="movie-search-container">
<div class="form-group">
<div class="search-input-wrapper">
<span class="search-icon">🔍</span>
<input
type="text"
name="movie"
id="movie-input"
placeholder="Search title, year, IMDb ID (e.g. 'perfect blue 1997', 'black swan', 'tt0156887')..."
autocomplete="off"
/>
<div id="search-spinner" class="spinner hidden"></div>
</div>
<div class="field-hint">
Dynamic search triggers on each character input, showing top 5 IMDb matches.
</div>
</div>
<!-- Dynamic Results List (Top 5 matches) -->
<div id="results-container" class="results-container hidden">
<div class="results-header">Top 5 IMDb Matches</div>
<ul id="results-list" class="results-list"></ul>
</div>
<div id="no-results" class="no-results hidden">
No matching titles found. Try adjusting title, year, or IMDb ID.
</div>
</div>
<!-- Fixed / Selected Movie Card (Visible when movie is selected) -->
<div id="selected-movie-container" class="selected-movie-container hidden">
<div class="selected-movie-card">
<img id="selected-poster" src="" alt="Movie Poster" class="selected-poster" />
<div class="selected-info">
<h3 id="selected-title" class="selected-title"></h3>
<div class="selected-meta">
<span id="selected-year" class="meta-tag year-tag"></span>
<span id="selected-imdbid" class="meta-tag imdb-tag"></span>
<span id="selected-type" class="meta-tag type-tag"></span>
</div>
<p id="selected-stars" class="selected-stars"></p>
</div>
<button type="button" id="btn-change-movie" class="btn btn-secondary btn-sm" title="Pick another movie">
Change
</button>
</div>
</div>
</section>
<!-- Action Section: Appears when both sections are fixed -->
<section id="section-action" class="section-action hidden">
<button type="button" id="btn-send" class="btn btn-send">
<span class="btn-send-icon">🚀</span>
<span class="btn-send-text">SEND</span>
</button>
<!-- Response Alert Box -->
<div id="response-box" class="response-box hidden">
<div class="response-header">
<span id="response-icon" class="response-icon"></span>
<span id="response-title" class="response-title"></span>
</div>
<pre id="response-body" class="response-body"></pre>
</div>
</section>
</main>
</div>
<script src="app.js"></script>
</body>
</html>