Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
127 lines (118 loc) · 8.97 KB
/
Copy pathindex.html
File metadata and controls
127 lines (118 loc) · 8.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>S3 Browser</title>
<meta name="description" content="Browse public Amazon S3 buckets like folders. No login required." />
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23e8a33d' d='M1 3h5l1.5 1.5H15V13H1z'/></svg>" />
<link rel="stylesheet" href="style.css?v=dev" />
<script>
// Apply a saved theme before first paint to avoid a flash of the wrong colors.
try {
const t = localStorage.getItem("s3-browser:theme");
if (t === "light" || t === "dark") document.documentElement.dataset.theme = t;
} catch {}
</script>
<script type="module" src="js/app.js?v=dev"></script>
<script type="module" src="js/theme.js?v=dev"></script>
</head>
<body>
<header class="topbar">
<h1><a href="./" id="home-link">S3 Browser</a></h1>
<form id="location-form" class="location-form" autocomplete="off">
<input id="location-input" type="text" spellcheck="false" placeholder="bucket, bucket/prefix/, s3://bucket/prefix/, or an S3 https URL" aria-label="Bucket or S3 location" />
<input id="region-input" type="text" spellcheck="false" placeholder="region (optional)" aria-label="Region (optional)" />
<button type="submit">Go</button>
</form>
<div class="theme-switch" role="group" aria-label="Color theme">
<button type="button" data-theme-choice="light" title="Light" aria-label="Light theme"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg></button>
<button type="button" data-theme-choice="system" title="System" aria-label="Match system theme"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></svg></button>
<button type="button" data-theme-choice="dark" title="Dark" aria-label="Dark theme"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg></button>
</div>
</header>
<main>
<section id="welcome" class="welcome">
<p>Browse public (anonymous-read) S3 buckets. Enter a bucket name or S3 URI above, or try one of these:</p>
<ul class="examples">
<li><a href="?path=aind-open-data">aind-open-data</a></li>
<li><a href="?path=allen-brain-cell-atlas">allen-brain-cell-atlas</a></li>
<li><a href="?path=dandiarchive">dandiarchive</a></li>
<li><a href="?path=openneuro.org">openneuro.org</a></li>
</ul>
<p class="note">The bucket must allow public listing and send CORS headers. Everything runs in your browser; nothing is sent anywhere except S3.</p>
</section>
<section id="browser" class="browser" hidden>
<div class="pathbar">
<nav id="breadcrumbs" class="breadcrumbs" aria-label="Path"></nav>
<button id="copy-current" class="copy-btn" type="button" title="Copy S3 URI of this folder" aria-label="Copy S3 URI of this folder"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg></button>
</div>
<div class="controls">
<input id="search-input" class="search-input" type="search" spellcheck="false" autocomplete="off" placeholder="Filter: name starts with…" aria-label="Filter this folder by name prefix (case-sensitive)" title="Shows entries whose names start with this text (case-sensitive)" />
<label>Per page
<select id="page-size">
<option>25</option>
<option>50</option>
<option selected>100</option>
<option>250</option>
<option>500</option>
<option>1000</option>
<option value="custom">Custom…</option>
</select>
</label>
<input id="page-size-custom" type="number" min="1" max="1000" step="1" hidden aria-label="Custom page size" />
<span id="page-info" class="page-info"></span>
<button id="first-page" type="button" title="First page">« First</button>
<button id="prev-page" type="button" title="Previous page">‹ Prev</button>
<button id="next-page" type="button" title="Next page">Next ›</button>
</div>
<div id="status" class="status" role="status"></div>
<div class="table-wrap">
<table id="listing">
<thead>
<tr>
<th class="col-name"><button type="button" data-sort="name">Name</button></th>
<th class="col-size"><button type="button" data-sort="size">Size</button></th>
<th class="col-modified"><button type="button" data-sort="modified">Last modified</button></th>
<th class="col-actions"><span class="visually-hidden">Actions</span></th>
</tr>
</thead>
<tbody id="listing-body"></tbody>
</table>
</div>
<p class="hint">S3 lists keys in lexicographic order. Sorting by size or date applies to the current page only.</p>
</section>
<section id="viewer" class="viewer" hidden>
<div class="pathbar">
<nav id="viewer-breadcrumbs" class="breadcrumbs" aria-label="Path"></nav>
<span id="viewer-meta" class="muted"></span>
<button id="viewer-toggle" type="button" hidden>Raw</button>
<button id="viewer-copy" class="copy-btn" type="button" title="Copy S3 URI" aria-label="Copy S3 URI"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg></button>
<a id="viewer-raw" class="action-link icon-link" href="#" target="_blank" rel="noopener" title="Raw file from S3 (may download)" aria-label="Raw file from S3 (may download)"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="M7 10l5 5 5-5"/><path d="M12 15V3"/></svg></a>
</div>
<div id="viewer-notice" class="preview-notice viewer-notice" hidden></div>
<div id="viewer-body" class="preview-body viewer-body"></div>
</section>
</main>
<dialog id="preview">
<div class="preview-head">
<div class="preview-title">
<strong id="preview-name"></strong>
<span id="preview-meta" class="muted"></span>
</div>
<div class="preview-actions">
<button id="preview-toggle" type="button" hidden>Raw</button>
<a id="preview-open" class="action-link icon-link" href="#" target="_blank" rel="noopener" title="View in a new tab" aria-label="View in a new tab"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/></svg></a>
<button id="preview-copy" class="copy-btn" type="button" title="Copy S3 URI" aria-label="Copy S3 URI"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg></button>
<button id="preview-close" class="icon-btn" type="button" title="Close" aria-label="Close preview"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</div>
</div>
<div id="preview-notice" class="preview-notice" hidden></div>
<div id="preview-body" class="preview-body"></div>
</dialog>
<div id="toast" class="toast" role="status" aria-live="polite"></div>
<footer>
<a href="https://github.com/AllenNeuralDynamics/s3-browser">Source</a> · MIT License
</footer>
</body>
</html>