Skip to content

Commit

Permalink
Update 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuNatsu committed Aug 26, 2023
1 parent 424f7e1 commit 2ae6e90
Show file tree
Hide file tree
Showing 27 changed files with 813 additions and 718 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# P2P-Transfer

A P2P File Transfer Web App

17 changes: 17 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

rm -rf ./build
mkdir ./build

cd ./frontend
pnpm install
pnpm generate
cp -r ./dist ../build/www
cd ..

cd ./backend
pnpm install
pnpm build
cp ./dist/server.min.mjs ./package.json ../build
cd ..

210 changes: 0 additions & 210 deletions frontend/@.vue

This file was deleted.

6 changes: 2 additions & 4 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nuxt 3 Minimal Starter
# Frontend

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
Frontend for P2P Transfer

## Setup

Expand Down Expand Up @@ -59,5 +59,3 @@ pnpm run preview
# yarn
yarn preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
20 changes: 6 additions & 14 deletions frontend/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,12 @@ async function onBeforeEnter(): Promise<void> {

<template>
<NuxtLayout>
<ClientOnly>
<notifications position="top center"/>
</ClientOnly>
<div
class="bg-gray-50 fixed flex flex-col gap-12 inset-0 items-center justify-center">
<AppHeader/>
<NuxtPage
:transition="{
name: 'page',
mode: 'out-in',
onBeforeEnter
}"/>
</div>
<AppFooter/>
<NuxtPage
:transition="{
name: 'page',
mode: 'out-in',
onBeforeEnter
}"/>
</NuxtLayout>
</template>

Expand Down
1 change: 1 addition & 0 deletions frontend/assets/icons/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions frontend/components/DLModeSelector.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script lang="ts" setup>
/* Properties */
defineProps<{
input: boolean;
}>();
/* Emits */
defineEmits<{
'update:input': [value: boolean]
}>();
</script>

<template>
<div class="flex flex-col items-center overflow-hidden rounded-lg">
<div class="flex font-bold items-center w-full">
<button
@click="$emit('update:input', true)"
class="py-2 w-1/2"
:class="input ? 'bg-green-300' : 'bg-gray-200'">
{{ $t('button.blob_mode') }}
</button>
<button
@click="$emit('update:input', false)"
class="py-2 w-1/2"
:class="input ? 'bg-gray-200' : 'bg-green-300'">
{{ $t('button.stream_mode') }}
</button>
</div>
<div class="bg-green-300 px-4 py-4 w-80">
{{ $t(input ? 'ui.blob_mode' : 'ui.stream_mode') }}
</div>
</div>
</template>
3 changes: 0 additions & 3 deletions frontend/components/FileSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* Properties */
defineProps<{
id: string;
disabled: boolean;
}>();
/* Emits */
Expand All @@ -14,13 +13,11 @@ defineEmits<{
<template>
<label
class="bg-white border-2 cursor-pointer font-bold px-4 rounded-3xl select-none transition-colors hover:text-white"
:class="disabled ? '!bg-white !cursor-not-allowed !opacity-50 !text-black' : ''"
:for="id">
<slot></slot>
<input
@change="$emit('select', $event)"
class="hidden"
:disabled="disabled"
:id="id"
multiple="false"
type="file"/>
Expand Down
10 changes: 4 additions & 6 deletions frontend/components/LangSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ const availableLocales = computed(() => {
<template>
<div class="flex font-smiley items-center justify-center">
<NuxtLink
v-for="locale in availableLocales"
:key="locale.code"
:to="switchLocalePath(locale.code)">
<span class="transition-colors hover:text-blue-500">
{{ locale.name }}
</span>
v-for="i in availableLocales"
class="transition-colors hover:text-blue-500"
:to="switchLocalePath(i.code)">
{{ i.name }}
</NuxtLink>
</div>
</template>
21 changes: 21 additions & 0 deletions frontend/components/ProgressBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script lang="ts" setup>
/* Properties */
defineProps<{
progress: number;
color?: string;
}>();
</script>

<template>
<div class="border-2 border-gray-400 h-5 overflow-hidden relative rounded-xl">
<div
class="h-full text-base"
:class="color"
:style="{ width: `${progress}%` }">
</div>
<div
class="absolute flex inset-0 items-center justify-center text-sm">
{{ progress.toFixed(1) }}%
</div>
</div>
</template>
Loading

0 comments on commit 2ae6e90

Please sign in to comment.