it mostly works!

This commit is contained in:
Reid 2025-05-12 23:33:52 -07:00
parent 76543fd220
commit 44cd13f10c
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
52 changed files with 879 additions and 396 deletions

View file

@ -0,0 +1,9 @@
<form class="download-form" action="/api/download" method="get">
<select name="codec">
{{#each codecs as |codec|}}
<option value="{{codec}}">{{codec}}</option>
{{/each}}
</select>
<input type="hidden" name="id" value="{{id}}">
<input type="submit" value="download!">
</form>

3
views/error.handlebars Normal file
View file

@ -0,0 +1,3 @@
<h2 class="error">{{status}}</h2>
<p><samp class="wrap">{{message}}</samp></p>
<p>would you like to <a href="/">go back to the main page?</a></p>

View file

@ -1 +0,0 @@
{{> search}}

View file

@ -1,12 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/styles/normalize.css">
<link rel="stylesheet" href="/styles/main.css">
<link rel="icon" href="/favicon.png" type="image/png">
<title>amdl - {{title}}</title>
<meta name="description" content="world's first(?) public(?) apple music downloader">
<meta property="og:type" content="website">
<meta property="og:title" content="amdl - {{title}}">
<meta property="og:description" content="world's first(?) public(?) apple music downloader">
</head>
<body>
{{> header}}

View file

@ -0,0 +1,5 @@
{{#if id}}
<a href="/download?id={{id}}">dl</a>
{{else}}
<span class="light">dl</span>
{{/if}}

View file

@ -1,5 +1,5 @@
<footer>
<a href="https://git.reidlab.pink/reidlab/amdl" target="_blank">source [<code>{{hash}}{{#if dirty}}-dirty{{/if}}</code>]</a>
<a href="https://git.reidlab.pink/reidlab/amdl" target="_blank">source (<code>{{gitRev}}{{#if (gitDirty)}}-dirty{{/if}}</code>)</a>
&middot;
<a href="https://reidlab.pink/socials" target="_blank">need to contact me?</a>
</footer>

View file

@ -0,0 +1,13 @@
<div class="paginator">
{{#if (greaterThan page 1)}}
<a href="{{back}}">&laquo;</a>
{{else}}
<span class="light">&laquo;</span>
{{/if}}
<span>{{page}}</span>
{{#if next}}
<a href="{{next}}">&raquo;</a>
{{else}}
<span class="light">&raquo;</span>
{{/if}}
</div>

View file

@ -1,11 +1,15 @@
<div class="result">
<li class="result">
<div class="result-info">
<img src="{{cover}}" loading="lazy" decoding="async"/>
<div class="result-text">
<img width="256" height="256" src="{{cover}}" loading="lazy" decoding="async"/>
<div class="result-info-text">
<h2>{{name}}</h2>
<span class="light">{{#each artists as |artist|}}
{{artist}}{{#unless @last}},{{/unless}}
{{/each}}</span>
<span class="light">{{arrayJoin artists ", "}}</span>
</div>
</div>
</div>
<hr>
<ol class="result-tracklist">
{{#each tracks as |track|}}
{{> track num=(add @index 1)}}
{{/each}}
</ol>
</li>

View file

@ -1,3 +0,0 @@
<form action="/" method="get">
<input type="search" name="q" placeholder="search for something" value="{{query}}">
</form>

View file

@ -0,0 +1,13 @@
<li class="track">
<code class="track-number">
<span class="light">{{mapNumberToLetter discNumber}}{{trackNumber}}</span>
</code>
<div class="track-info">
<h3>{{name}}</h3>
<span class="light">{{arrayJoin artists ", "}}</span>
</div>
<div class="track-right">
<code class="track-time"><span class="light">{{formatDuration duration}}</span></code>
{{> download}}
</div>
</li>

View file

@ -1,4 +1,15 @@
{{> search query=query}}
{{#each results as |result|}}
{{> result name=result.name}}
{{/each}}
<form action="/" method="get">
<input type="search" name="q" placeholder="search for something" value="{{query}}">
</form>
{{#if query}}
{{#if results.length}}
<ul class="results">
{{#each results as |result|}}
{{> result}}
{{/each}}
</ul>
{{else}}
<p>no results found for <samp class="wrap">{{query}}</samp></p>
{{/if}}
{{> paginator}}
{{/if}}