🎨 Organize cards into view

This commit is contained in:
zhbaor 2023-02-23 11:08:38 +08:00
parent e75d604a01
commit 761cb651ab
5 changed files with 52 additions and 44 deletions

View file

@ -8,7 +8,7 @@
"name": "frontend", "name": "frontend",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"bootstrap": "^5.2.3", "bootstrap": "^5.3.0-alpha1",
"bootstrap-icons": "^1.10.3", "bootstrap-icons": "^1.10.3",
"vue": "^3.2.45" "vue": "^3.2.45"
}, },
@ -506,9 +506,9 @@
"integrity": "sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==" "integrity": "sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ=="
}, },
"node_modules/bootstrap": { "node_modules/bootstrap": {
"version": "5.2.3", "version": "5.3.0-alpha1",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.0-alpha1.tgz",
"integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==", "integrity": "sha512-ABZpKK4ObS3kKlIqH+ZVDqoy5t/bhFG0oHTAzByUdon7YIom0lpCeTqRniDzJmbtcWkNe800VVPBiJgxSYTYew==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",

View file

@ -9,7 +9,7 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"bootstrap": "^5.2.3", "bootstrap": "^5.3.0-alpha1",
"bootstrap-icons": "^1.10.3", "bootstrap-icons": "^1.10.3",
"vue": "^3.2.45" "vue": "^3.2.45"
}, },

View file

@ -1,45 +1,11 @@
<script setup> <script setup>
import "bootstrap/dist/css/bootstrap.css"; import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-icons/font/bootstrap-icons.css"; import "bootstrap-icons/font/bootstrap-icons.css";
import AudioCard from "./components/AudioCard.vue"; import AudioDownload from "./views/AudioDownload.vue";
const p1 = {
number: "BV1es41127Fd",
received: 0,
total: 0,
};
const p2 = {
number: "BV1es41127Fd",
title: "【洛天依/乐正绫原创】霜雪千年【PV付/COP】",
received: 0,
total: 0,
};
const p3 = {
number: "BV1es41127Fd",
title: "【洛天依/乐正绫原创】霜雪千年【PV付/COP】",
received: 1314514,
total: 1919810,
};
const p4 = {
number: "BV1es41127Fd",
title: "【洛天依/乐正绫原创】霜雪千年【PV付/COP】",
received: 1919810,
total: 1919810,
};
</script> </script>
<template> <template>
<div id="wrapper"> <AudioDownload></AudioDownload>
<AudioCard v-bind="p1"></AudioCard>
<AudioCard v-bind="p2"></AudioCard>
<AudioCard v-bind="p3"></AudioCard>
<AudioCard v-bind="p4"></AudioCard>
</div>
</template> </template>
<style scoped> <style scoped></style>
#wrapper {
margin-top: 20px;
margin-left: 20px;
}
</style>

View file

@ -44,7 +44,7 @@ const progress = computed(() => {
</script> </script>
<template> <template>
<div class="card"> <div class="card mb-2 w-100 shadow-sm">
<div class="card-body position-relative"> <div class="card-body position-relative">
<h6 v-if="number" class="text-muted mb-1">{{ number }}</h6> <h6 v-if="number" class="text-muted mb-1">{{ number }}</h6>
<div v-else class="placeholder-wave"> <div v-else class="placeholder-wave">
@ -68,7 +68,9 @@ const progress = computed(() => {
role="progressbar" role="progressbar"
:style="{ width: progress + '%' }" :style="{ width: progress + '%' }"
> >
<span v-if="status == 'Fetching'" class="text-dark">Fetching Information</span> <span v-if="status == 'Fetching'" class="text-dark"
>Fetching Information</span
>
<span v-else-if="status == 'Ready'">Ready</span> <span v-else-if="status == 'Ready'">Ready</span>
<span v-else-if="status == 'Downloading'" <span v-else-if="status == 'Downloading'"
>{{ progress }}%<span class="px-1"></span>({{ received_mib }} / >{{ progress }}%<span class="px-1"></span>({{ received_mib }} /

View file

@ -0,0 +1,40 @@
<script setup>
import AudioCard from "../components/AudioCard.vue";
const p1 = {
number: "BV1es41127Fd",
received: 0,
total: 0,
};
const p2 = {
number: "BV1es41127Fd",
title: "【洛天依/乐正绫原创】霜雪千年【PV付/COP】",
received: 0,
total: 0,
};
const p3 = {
number: "BV1es41127Fd",
title: "【洛天依/乐正绫原创】霜雪千年【PV付/COP】",
received: 1314514,
total: 1919810,
};
const p4 = {
number: "BV1es41127Fd",
title: "【洛天依/乐正绫原创】霜雪千年【PV付/COP】",
received: 1919810,
total: 1919810,
};
</script>
<template>
<div
class="d-flex flex-column p-3 align-items-center bg-body-secondary vh-100"
>
<AudioCard v-bind="p1"></AudioCard>
<AudioCard v-bind="p2"></AudioCard>
<AudioCard v-bind="p3"></AudioCard>
<AudioCard v-bind="p4"></AudioCard>
</div>
</template>
<style scoped></style>