Compare commits

...
Sign in to create a new pull request.

8 commits

Author SHA1 Message Date
hex
59a33754e2 more disclaimers 2025-06-15 23:21:13 +02:00
hex
0806ae54c2 real 2025-06-15 23:17:10 +02:00
hex
d2b2f11baf readme 2025-06-15 23:15:29 +02:00
hex
253c3f6e4c add separate repo 2025-06-15 23:12:03 +02:00
hex
34a4c6b2ce remove public 2025-06-15 23:11:48 +02:00
grngxd
2975e6088d fix delete route 2025-06-15 10:13:30 +01:00
grngxd
7926efa222 fix backend 2025-06-14 20:28:59 +01:00
grngxd
9f91514f78 gitignore 2025-06-14 17:18:43 +01:00
15 changed files with 6099 additions and 30 deletions

1
.gitignore vendored
View file

@ -8,6 +8,7 @@
node_modules
.env
*.local
vite.config.ts.timestamp-*
# Cache
.cache

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "public"]
path = public
url = ssh://git@git.iwakura.rip:6969/stereo.cat/public.git

View file

@ -1,3 +1,14 @@
# stereo.cat frontend
written in typescript with qwik
## running in dev env
```
git clone https://git.iwakura.rip/stereo.cat/frontend.git
git submodule update --init --recursive
bun install
bun dev
```
## disclaimer
All graphic assets belonging to stereo.cat may not be used in unofficial instances, forks or versions of our software. Please replace them if you are hosting our software yourself, they can be found in the ``public`` folder in this repository. More information (like the full license) can be found [here](https://git.iwakura.rip/stereo.cat/public)

View file

@ -4,7 +4,6 @@
"": {
"name": "my-qwik-empty-starter",
"dependencies": {
"@cloudgakkai/qwik-aos": "github:CloudGakkai/qwik-aos",
"@types/aos": "^3.0.7",
"aos": "^3.0.0-beta.6",
"ky": "^1.8.1",
@ -38,8 +37,6 @@
"@builder.io/qwik-city": ["@builder.io/qwik-city@1.14.1", "", { "dependencies": { "@mdx-js/mdx": "^3", "@types/mdx": "^2", "source-map": "^0.7.4", "svgo": "^3.3", "undici": "*", "valibot": ">=0.36.0 <2", "vfile": "6.0.2", "vite": "^5", "vite-imagetools": "^7", "zod": "3.22.4" } }, "sha512-VsAvk7u2HyyTnL9GhpT+h10t2XAIlxtv6LFL3Xt9/1QZ6lMfGWMcMEAMuZB1Ib+D/oTfu7QRqZngRg3FsrIKyg=="],
"@cloudgakkai/qwik-aos": ["@cloudgakkai/qwik-aos@github:CloudGakkai/qwik-aos#affd212", {}, "CloudGakkai-qwik-aos-affd212"],
"@emnapi/runtime": ["@emnapi/runtime@1.4.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ=="],
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],

6069
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

1
public Submodule

@ -0,0 +1 @@
Subproject commit a4f5725fbaf2db1053be198d81d08e1ea0c3e843

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 KiB

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 500 500"><g clip-path="url(#a)"><circle cx="250" cy="250" r="250" fill="#fff"/><path fill="#18B6F6" d="m367.87 418.45-61.17-61.18-.94.13v-.67L175.7 227.53l32.05-31.13L188.9 87.73 99.56 199.09c-15.22 15.42-18.03 40.51-7.08 59.03l55.83 93.11a46.82 46.82 0 0 0 40.73 22.81l27.65-.27 151.18 44.68Z"/><path fill="#AC7EF4" d="m401.25 196.94-12.29-22.81-6.41-11.67-2.54-4.56-.26.26-33.66-58.63a47.07 47.07 0 0 0-41.27-23.75l-29.51.8-88.01.28a47.07 47.07 0 0 0-40.33 23.34L93.4 207l95.76-119.54L314.7 226.19l-22.3 22.67 13.35 108.54.13-.26v.26h-.26l.26.27 10.42 10.2 50.62 49.78c2.13 2 5.6-.4 4.13-2.96l-31.25-61.85 54.5-101.3 1.73-2c.67-.81 1.33-1.62 1.87-2.42a46.8 46.8 0 0 0 3.34-50.18Z"/><path fill="#fff" d="M315.1 225.65 189.18 87.6l17.9 108.14L175 227l130.5 130.27-11.75-108.14 21.37-23.48Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h500v500H0z"/></clipPath></defs></svg>

Before

Width:  |  Height:  |  Size: 947 B

View file

@ -1,3 +0,0 @@
<svg width="281" height="248" viewBox="0 0 281 248" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.744835 19.1645C0.340705 16.0258 0.876443 12.8377 2.2843 10.0034L6.37392 1.7703C7.01957 0.470487 8.7912 0.269553 9.71155 1.39175L85.375 93.6495H195.875L271.538 1.39175C272.459 0.269551 274.23 0.470487 274.876 1.77029L278.966 10.0034C280.374 12.8377 280.909 16.0258 280.505 19.1645L264.378 144.419C256.8 203.277 206.688 247.35 147.344 247.35H133.906C74.5619 247.35 24.4504 203.277 16.872 144.419L0.744835 19.1645Z" fill="#D9D9D9"/>
</svg>

Before

Width:  |  Height:  |  Size: 548 B

View file

@ -1,9 +0,0 @@
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"name": "qwik-project-name",
"short_name": "Welcome to Qwik",
"start_url": ".",
"display": "standalone",
"background_color": "#fff",
"description": "A Qwik project app."
}

View file

View file

@ -19,9 +19,9 @@ const formatSize = (bytes: number) => {
export default component$(({ file }: FileProps) => {
const files = useNanostore$<StereoFile[]>(dashboardFiles);
const deleteFile = $(async (uid: string, name: string) => {
const deleteFile = $(async (id: string) => {
if (!confirm("Are you sure you want to delete this file?")) return;
console.log(await api.delete(uid, name));
await api.delete(id);
files.value = await api.list();
});
@ -66,7 +66,7 @@ export default component$(({ file }: FileProps) => {
<div class="rounded-xl bg-neutral-900 flex flex-col group overflow-hidden hover:bg-neutral-800 transition-all duration-200">
<div class="relative">
<a
href={`/api/${file.Owner}/${file.Name}`}
href={`/api/${file.ID}`}
target="_blank"
class="flex w-full h-60 overflow-clip"
>
@ -78,7 +78,7 @@ export default component$(({ file }: FileProps) => {
<div class="absolute bottom-2 right-2 gap-2 z-10 group-hover:flex hidden duration-200 transition-all">
<a
class="bg-neutral-600/40 backdrop-blur-lg hover:bg-neutral-600/75 transition-all duration-200 text-white p-2 rounded-lg active:scale-95"
href={`/api/${file.Owner}/${file.Name}`}
href={`/api/${file.ID}`}
target="_blank"
>
<SolarDownloadMinimalisticBold class="w-6 h-6"/>
@ -93,7 +93,7 @@ export default component$(({ file }: FileProps) => {
<button
class="bg-red-600/50 backdrop-blur-lg hover:bg-red-600/75 transition-all duration-200 text-white p-2 rounded-lg active:scale-95"
onClick$={async () => await deleteFile(file.Owner, file.Name)}
onClick$={async () => await deleteFile(file.ID)}
>
<SolarTrashBin2Bold class="w-6 h-6"/>
</button>
@ -148,7 +148,7 @@ const FilePreview = component$(({ file }: FileProps) => {
<img
width={400}
height={300}
src={`/api/${file.Owner}/${file.Name}`}
src={`/api/${file.ID}`}
alt={file.Name}
class="w-full h-60 object-cover flex-grow"
/>
@ -160,7 +160,7 @@ const FilePreview = component$(({ file }: FileProps) => {
<video
width={400}
height={300}
src={`/api/${file.Owner}/${file.Name}`}
src={`/api/${file.ID}`}
class="w-full h-60 object-cover flex-grow"
controls
autoplay
@ -180,7 +180,7 @@ const FilePreview = component$(({ file }: FileProps) => {
<audio
controls
class="w-full h-12"
src={`/api/${file.Owner}/${file.Name}`}
src={`/api/${file.ID}`}
>
Your browser does not support the audio element.
</audio>

View file

@ -5,16 +5,14 @@ export const client = ky.create({
prefixUrl: '/api',
credentials: 'include'
});
// TODO: make wrapper for apiclient fr
export const api = {
file: async (file_id: string) => await client.get(file_id),
file: async (uid: string) => await client.get<Blob>(uid),
list: async () => await client.get('list').json<StereoFile[]>(),
upload: async (file: File) => {
const formData = new FormData();
formData.append('file', file);
return await client.post('upload', { body: formData });
},
delete: async (uid: string, file: string) => {
return await client.delete(`${uid}/${file}`).json();
},
delete: async (uid: string) => await client.delete(uid).json(),
}

View file

@ -1,6 +1,8 @@
export type StereoFile = {
ID: string;
Name: string;
Owner: string;
CreatedAt: string;
Size: number;
CreatedAt: string;
Mime: string;
}