Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
59a33754e2 | |||
0806ae54c2 | |||
d2b2f11baf | |||
253c3f6e4c | |||
34a4c6b2ce | |||
![]() |
2975e6088d | ||
![]() |
7926efa222 | ||
![]() |
9f91514f78 |
15 changed files with 6099 additions and 30 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,6 +8,7 @@
|
||||||
node_modules
|
node_modules
|
||||||
.env
|
.env
|
||||||
*.local
|
*.local
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
|
|
||||||
# Cache
|
# Cache
|
||||||
.cache
|
.cache
|
||||||
|
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "public"]
|
||||||
|
path = public
|
||||||
|
url = ssh://git@git.iwakura.rip:6969/stereo.cat/public.git
|
11
README.md
11
README.md
|
@ -1,3 +1,14 @@
|
||||||
# stereo.cat frontend
|
# stereo.cat frontend
|
||||||
|
|
||||||
written in typescript with qwik
|
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)
|
||||||
|
|
3
bun.lock
3
bun.lock
|
@ -4,7 +4,6 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "my-qwik-empty-starter",
|
"name": "my-qwik-empty-starter",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cloudgakkai/qwik-aos": "github:CloudGakkai/qwik-aos",
|
|
||||||
"@types/aos": "^3.0.7",
|
"@types/aos": "^3.0.7",
|
||||||
"aos": "^3.0.0-beta.6",
|
"aos": "^3.0.0-beta.6",
|
||||||
"ky": "^1.8.1",
|
"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=="],
|
"@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=="],
|
"@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=="],
|
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
|
||||||
|
|
6069
package-lock.json
generated
Normal file
6069
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
1
public
Submodule
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 |
|
@ -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 |
|
@ -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 |
|
@ -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."
|
|
||||||
}
|
|
|
@ -19,9 +19,9 @@ const formatSize = (bytes: number) => {
|
||||||
export default component$(({ file }: FileProps) => {
|
export default component$(({ file }: FileProps) => {
|
||||||
const files = useNanostore$<StereoFile[]>(dashboardFiles);
|
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;
|
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();
|
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="rounded-xl bg-neutral-900 flex flex-col group overflow-hidden hover:bg-neutral-800 transition-all duration-200">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<a
|
<a
|
||||||
href={`/api/${file.Owner}/${file.Name}`}
|
href={`/api/${file.ID}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="flex w-full h-60 overflow-clip"
|
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">
|
<div class="absolute bottom-2 right-2 gap-2 z-10 group-hover:flex hidden duration-200 transition-all">
|
||||||
<a
|
<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"
|
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"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<SolarDownloadMinimalisticBold class="w-6 h-6"/>
|
<SolarDownloadMinimalisticBold class="w-6 h-6"/>
|
||||||
|
@ -93,7 +93,7 @@ export default component$(({ file }: FileProps) => {
|
||||||
|
|
||||||
<button
|
<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"
|
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"/>
|
<SolarTrashBin2Bold class="w-6 h-6"/>
|
||||||
</button>
|
</button>
|
||||||
|
@ -148,7 +148,7 @@ const FilePreview = component$(({ file }: FileProps) => {
|
||||||
<img
|
<img
|
||||||
width={400}
|
width={400}
|
||||||
height={300}
|
height={300}
|
||||||
src={`/api/${file.Owner}/${file.Name}`}
|
src={`/api/${file.ID}`}
|
||||||
alt={file.Name}
|
alt={file.Name}
|
||||||
class="w-full h-60 object-cover flex-grow"
|
class="w-full h-60 object-cover flex-grow"
|
||||||
/>
|
/>
|
||||||
|
@ -160,7 +160,7 @@ const FilePreview = component$(({ file }: FileProps) => {
|
||||||
<video
|
<video
|
||||||
width={400}
|
width={400}
|
||||||
height={300}
|
height={300}
|
||||||
src={`/api/${file.Owner}/${file.Name}`}
|
src={`/api/${file.ID}`}
|
||||||
class="w-full h-60 object-cover flex-grow"
|
class="w-full h-60 object-cover flex-grow"
|
||||||
controls
|
controls
|
||||||
autoplay
|
autoplay
|
||||||
|
@ -180,7 +180,7 @@ const FilePreview = component$(({ file }: FileProps) => {
|
||||||
<audio
|
<audio
|
||||||
controls
|
controls
|
||||||
class="w-full h-12"
|
class="w-full h-12"
|
||||||
src={`/api/${file.Owner}/${file.Name}`}
|
src={`/api/${file.ID}`}
|
||||||
>
|
>
|
||||||
Your browser does not support the audio element.
|
Your browser does not support the audio element.
|
||||||
</audio>
|
</audio>
|
||||||
|
|
|
@ -5,16 +5,14 @@ export const client = ky.create({
|
||||||
prefixUrl: '/api',
|
prefixUrl: '/api',
|
||||||
credentials: 'include'
|
credentials: 'include'
|
||||||
});
|
});
|
||||||
// TODO: make wrapper for apiclient fr
|
|
||||||
export const api = {
|
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[]>(),
|
list: async () => await client.get('list').json<StereoFile[]>(),
|
||||||
upload: async (file: File) => {
|
upload: async (file: File) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
return await client.post('upload', { body: formData });
|
return await client.post('upload', { body: formData });
|
||||||
},
|
},
|
||||||
delete: async (uid: string, file: string) => {
|
delete: async (uid: string) => await client.delete(uid).json(),
|
||||||
return await client.delete(`${uid}/${file}`).json();
|
|
||||||
},
|
|
||||||
}
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
export type StereoFile = {
|
export type StereoFile = {
|
||||||
|
ID: string;
|
||||||
Name: string;
|
Name: string;
|
||||||
Owner: string;
|
Owner: string;
|
||||||
CreatedAt: string;
|
|
||||||
Size: number;
|
Size: number;
|
||||||
|
CreatedAt: string;
|
||||||
|
Mime: string;
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue