Compare commits

..

1 commit

Author SHA1 Message Date
Snoweuph
28c38b0a36 Importing from Github 2023-07-23 03:13:21 +02:00
14 changed files with 1054 additions and 0 deletions

28
.gitignore vendored Normal file
View file

@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

24
LICENSE Normal file
View file

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>

13
index.html Normal file
View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

598
package-lock.json generated Normal file
View file

@ -0,0 +1,598 @@
{
"name": "todo-app",
"version": "0.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "todo-app",
"version": "0.0.0",
"dependencies": {
"vue": "^3.2.31"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.0.0",
"@vitejs/plugin-vue": "^2.2.2",
"vite": "^2.8.4"
}
},
"node_modules/@babel/parser": {
"version": "7.17.3",
"license": "MIT",
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@fortawesome/fontawesome-free": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.0.0.tgz",
"integrity": "sha512-6LB4PYBST1Rx40klypw1SmSDArjFOcfBf2LeX9Zg5EKJT2eXiyiJq+CyBYKeXyK0sXS2FsCJWSPr/luyhuvh0Q==",
"dev": true,
"hasInstallScript": true,
"engines": {
"node": ">=6"
}
},
"node_modules/@vitejs/plugin-vue": {
"version": "2.2.4",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12.0.0"
},
"peerDependencies": {
"vite": "^2.5.10",
"vue": "^3.2.25"
}
},
"node_modules/@vue/compiler-core": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/shared": "3.2.31",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
}
},
"node_modules/@vue/compiler-dom": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@vue/compiler-core": "3.2.31",
"@vue/shared": "3.2.31"
}
},
"node_modules/@vue/compiler-sfc": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.31",
"@vue/compiler-dom": "3.2.31",
"@vue/compiler-ssr": "3.2.31",
"@vue/reactivity-transform": "3.2.31",
"@vue/shared": "3.2.31",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7",
"postcss": "^8.1.10",
"source-map": "^0.6.1"
}
},
"node_modules/@vue/compiler-ssr": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@vue/compiler-dom": "3.2.31",
"@vue/shared": "3.2.31"
}
},
"node_modules/@vue/reactivity": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@vue/shared": "3.2.31"
}
},
"node_modules/@vue/reactivity-transform": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.31",
"@vue/shared": "3.2.31",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7"
}
},
"node_modules/@vue/runtime-core": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@vue/reactivity": "3.2.31",
"@vue/shared": "3.2.31"
}
},
"node_modules/@vue/runtime-dom": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@vue/runtime-core": "3.2.31",
"@vue/shared": "3.2.31",
"csstype": "^2.6.8"
}
},
"node_modules/@vue/server-renderer": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@vue/compiler-ssr": "3.2.31",
"@vue/shared": "3.2.31"
},
"peerDependencies": {
"vue": "3.2.31"
}
},
"node_modules/@vue/shared": {
"version": "3.2.31",
"license": "MIT"
},
"node_modules/csstype": {
"version": "2.6.19",
"license": "MIT"
},
"node_modules/esbuild": {
"version": "0.14.23",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"esbuild-android-arm64": "0.14.23",
"esbuild-darwin-64": "0.14.23",
"esbuild-darwin-arm64": "0.14.23",
"esbuild-freebsd-64": "0.14.23",
"esbuild-freebsd-arm64": "0.14.23",
"esbuild-linux-32": "0.14.23",
"esbuild-linux-64": "0.14.23",
"esbuild-linux-arm": "0.14.23",
"esbuild-linux-arm64": "0.14.23",
"esbuild-linux-mips64le": "0.14.23",
"esbuild-linux-ppc64le": "0.14.23",
"esbuild-linux-riscv64": "0.14.23",
"esbuild-linux-s390x": "0.14.23",
"esbuild-netbsd-64": "0.14.23",
"esbuild-openbsd-64": "0.14.23",
"esbuild-sunos-64": "0.14.23",
"esbuild-windows-32": "0.14.23",
"esbuild-windows-64": "0.14.23",
"esbuild-windows-arm64": "0.14.23"
}
},
"node_modules/esbuild-linux-64": {
"version": "0.14.23",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/estree-walker": {
"version": "2.0.2",
"license": "MIT"
},
"node_modules/function-bind": {
"version": "1.1.1",
"dev": true,
"license": "MIT"
},
"node_modules/has": {
"version": "1.0.3",
"dev": true,
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.1"
},
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/is-core-module": {
"version": "2.8.1",
"dev": true,
"license": "MIT",
"dependencies": {
"has": "^1.0.3"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/magic-string": {
"version": "0.25.7",
"license": "MIT",
"dependencies": {
"sourcemap-codec": "^1.4.4"
}
},
"node_modules/nanoid": {
"version": "3.3.1",
"license": "MIT",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/path-parse": {
"version": "1.0.7",
"dev": true,
"license": "MIT"
},
"node_modules/picocolors": {
"version": "1.0.0",
"license": "ISC"
},
"node_modules/postcss": {
"version": "8.4.7",
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.1",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
}
},
"node_modules/resolve": {
"version": "1.22.0",
"dev": true,
"license": "MIT",
"dependencies": {
"is-core-module": "^2.8.1",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/rollup": {
"version": "2.68.0",
"dev": true,
"license": "MIT",
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=10.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/source-map": {
"version": "0.6.1",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/sourcemap-codec": {
"version": "1.4.8",
"license": "MIT"
},
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/vite": {
"version": "2.8.5",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.14.14",
"postcss": "^8.4.6",
"resolve": "^1.22.0",
"rollup": "^2.59.0"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": ">=12.2.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
},
"peerDependencies": {
"less": "*",
"sass": "*",
"stylus": "*"
},
"peerDependenciesMeta": {
"less": {
"optional": true
},
"sass": {
"optional": true
},
"stylus": {
"optional": true
}
}
},
"node_modules/vue": {
"version": "3.2.31",
"license": "MIT",
"dependencies": {
"@vue/compiler-dom": "3.2.31",
"@vue/compiler-sfc": "3.2.31",
"@vue/runtime-dom": "3.2.31",
"@vue/server-renderer": "3.2.31",
"@vue/shared": "3.2.31"
}
}
},
"dependencies": {
"@babel/parser": {
"version": "7.17.3"
},
"@fortawesome/fontawesome-free": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.0.0.tgz",
"integrity": "sha512-6LB4PYBST1Rx40klypw1SmSDArjFOcfBf2LeX9Zg5EKJT2eXiyiJq+CyBYKeXyK0sXS2FsCJWSPr/luyhuvh0Q==",
"dev": true
},
"@vitejs/plugin-vue": {
"version": "2.2.4",
"dev": true,
"requires": {}
},
"@vue/compiler-core": {
"version": "3.2.31",
"requires": {
"@babel/parser": "^7.16.4",
"@vue/shared": "3.2.31",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
}
},
"@vue/compiler-dom": {
"version": "3.2.31",
"requires": {
"@vue/compiler-core": "3.2.31",
"@vue/shared": "3.2.31"
}
},
"@vue/compiler-sfc": {
"version": "3.2.31",
"requires": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.31",
"@vue/compiler-dom": "3.2.31",
"@vue/compiler-ssr": "3.2.31",
"@vue/reactivity-transform": "3.2.31",
"@vue/shared": "3.2.31",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7",
"postcss": "^8.1.10",
"source-map": "^0.6.1"
}
},
"@vue/compiler-ssr": {
"version": "3.2.31",
"requires": {
"@vue/compiler-dom": "3.2.31",
"@vue/shared": "3.2.31"
}
},
"@vue/reactivity": {
"version": "3.2.31",
"requires": {
"@vue/shared": "3.2.31"
}
},
"@vue/reactivity-transform": {
"version": "3.2.31",
"requires": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.31",
"@vue/shared": "3.2.31",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7"
}
},
"@vue/runtime-core": {
"version": "3.2.31",
"requires": {
"@vue/reactivity": "3.2.31",
"@vue/shared": "3.2.31"
}
},
"@vue/runtime-dom": {
"version": "3.2.31",
"requires": {
"@vue/runtime-core": "3.2.31",
"@vue/shared": "3.2.31",
"csstype": "^2.6.8"
}
},
"@vue/server-renderer": {
"version": "3.2.31",
"requires": {
"@vue/compiler-ssr": "3.2.31",
"@vue/shared": "3.2.31"
}
},
"@vue/shared": {
"version": "3.2.31"
},
"csstype": {
"version": "2.6.19"
},
"esbuild": {
"version": "0.14.23",
"dev": true,
"requires": {
"esbuild-android-arm64": "0.14.23",
"esbuild-darwin-64": "0.14.23",
"esbuild-darwin-arm64": "0.14.23",
"esbuild-freebsd-64": "0.14.23",
"esbuild-freebsd-arm64": "0.14.23",
"esbuild-linux-32": "0.14.23",
"esbuild-linux-64": "0.14.23",
"esbuild-linux-arm": "0.14.23",
"esbuild-linux-arm64": "0.14.23",
"esbuild-linux-mips64le": "0.14.23",
"esbuild-linux-ppc64le": "0.14.23",
"esbuild-linux-riscv64": "0.14.23",
"esbuild-linux-s390x": "0.14.23",
"esbuild-netbsd-64": "0.14.23",
"esbuild-openbsd-64": "0.14.23",
"esbuild-sunos-64": "0.14.23",
"esbuild-windows-32": "0.14.23",
"esbuild-windows-64": "0.14.23",
"esbuild-windows-arm64": "0.14.23"
}
},
"esbuild-linux-64": {
"version": "0.14.23",
"dev": true,
"optional": true
},
"estree-walker": {
"version": "2.0.2"
},
"function-bind": {
"version": "1.1.1",
"dev": true
},
"has": {
"version": "1.0.3",
"dev": true,
"requires": {
"function-bind": "^1.1.1"
}
},
"is-core-module": {
"version": "2.8.1",
"dev": true,
"requires": {
"has": "^1.0.3"
}
},
"magic-string": {
"version": "0.25.7",
"requires": {
"sourcemap-codec": "^1.4.4"
}
},
"nanoid": {
"version": "3.3.1"
},
"path-parse": {
"version": "1.0.7",
"dev": true
},
"picocolors": {
"version": "1.0.0"
},
"postcss": {
"version": "8.4.7",
"requires": {
"nanoid": "^3.3.1",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
}
},
"resolve": {
"version": "1.22.0",
"dev": true,
"requires": {
"is-core-module": "^2.8.1",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
}
},
"rollup": {
"version": "2.68.0",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
}
},
"source-map": {
"version": "0.6.1"
},
"source-map-js": {
"version": "1.0.2"
},
"sourcemap-codec": {
"version": "1.4.8"
},
"supports-preserve-symlinks-flag": {
"version": "1.0.0",
"dev": true
},
"vite": {
"version": "2.8.5",
"dev": true,
"requires": {
"esbuild": "^0.14.14",
"fsevents": "~2.3.2",
"postcss": "^8.4.6",
"resolve": "^1.22.0",
"rollup": "^2.59.0"
}
},
"vue": {
"version": "3.2.31",
"requires": {
"@vue/compiler-dom": "3.2.31",
"@vue/compiler-sfc": "3.2.31",
"@vue/runtime-dom": "3.2.31",
"@vue/server-renderer": "3.2.31",
"@vue/shared": "3.2.31"
}
}
}
}

17
package.json Normal file
View file

@ -0,0 +1,17 @@
{
"name": "todo-app",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview --port 5050"
},
"dependencies": {
"vue": "^3.2.31"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.0.0",
"@vitejs/plugin-vue": "^2.2.2",
"vite": "^2.8.4"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

41
src/App.vue Normal file
View file

@ -0,0 +1,41 @@
<script setup>
import TodoApp from "./components/TodoApp.vue";
</script>
<template>
<header>
<img
alt="Vue logo"
class="logo"
src="./assets/logo.svg"
width="125"
height="125"
/>
<h1>Vue.js Todo App</h1>
</header>
<main>
<TodoApp />
</main>
</template>
<style>
@import "./assets/base.css";
@import "./assets/utility.css";
@import "./assets/table.css";
#app {
max-width: 60rem;
margin: 0 auto;
padding: 2rem;
display: grid;
font-weight: normal;
}
.logo {
display: block;
margin: 0 auto;
}
h1 {
text-align: center;
}
</style>

88
src/assets/base.css Normal file
View file

@ -0,0 +1,88 @@
/* color palette from <https://github.com/vuejs/theme> */
:root {
--vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2;
--vt-c-black: #181818;
--vt-c-black-soft: #222222;
--vt-c-black-mute: #282828;
--vt-c-indigo: #2c3e50;
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
--vt-c-divider-dark-1: rgba(105, 60, 60, 0.65);
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
--vt-c-text-light-1: var(--vt-c-indigo);
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
--vt-c-text-dark-1: var(--vt-c-white);
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
}
/* semantic color variables for this project */
:root {
--color-background: var(--vt-c-white);
--color-background-soft: var(--vt-c-white-soft);
--color-background-mute: var(--vt-c-white-mute);
--color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1);
--color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1);
--vt-c-mint-dark2: #45C48B;
--vt-c-mint-dark1: #41B883;
--vt-c-mint:#379E70;
--vt-c-mint-light2: #2A7855;
--vt-c-mint-light1: #143828;
--section-gap: 160px;
}
@media (prefers-color-scheme: dark) {
:root {
--color-background: var(--vt-c-black);
--color-background-soft: var(--vt-c-black-soft);
--color-background-mute: var(--vt-c-black-mute);
--color-border: var(--vt-c-divider-dark-2);
--color-border-hover: var(--vt-c-divider-dark-1);
--color-heading: var(--vt-c-text-dark-1);
--color-text: var(--vt-c-text-dark-2);
--vt-c-mint-light1: #45C48B;
--vt-c-mint-light2: #41B883;
--vt-c-mint:#379E70;
--vt-c-mint-dark1: #2A7855;
--vt-c-mint-dark2: #143828;
}
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
position: relative;
font-weight: normal;
}
body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition: color 0.5s, background-color 0.5s;
line-height: 1.6;
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 15px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

1
src/assets/logo.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69" xmlns:v="https://vecta.io/nano"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>

After

Width:  |  Height:  |  Size: 308 B

43
src/assets/table.css Normal file
View file

@ -0,0 +1,43 @@
table {
border: none;
border-radius: 0.5rem;
border-collapse: separate;
border-spacing: 0;
padding: 0;
}
th, td {
height: 3rem;
padding: 0.5rem;
border: 1px solid var(--vt-c-mint);
border-bottom: none;
border-right: none;
text-align: left;
vertical-align: middle;
}
th{
background-color: var(--vt-c-mint-dark2);
}
table th:first-child{
border-top-left-radius: 0.5rem;
}
table th:last-child{
border-top-right-radius: 0.5rem;
border-right: 1px solid var(--vt-c-mint);
}
table td:last-child{
border-right: 1px solid var(--vt-c-mint);
}
table tr:last-child td{
border-bottom: 1px solid var(--vt-c-mint);
}
table tr:last-child td:first-child{
border-bottom-left-radius: 0.5rem;
}
table tr:last-child td:last-child{
border-bottom-right-radius: 0.5rem;
}
th.table-icon{
width: 3rem;
}

4
src/assets/utility.css Normal file
View file

@ -0,0 +1,4 @@
.text-center {
text-align: center;
vertical-align: middle;
}

177
src/components/TodoApp.vue Normal file
View file

@ -0,0 +1,177 @@
<script>
export default {
data() {
return {
task: "",
editedTask: null,
availableStatuses: ["to-do", "in-progress", "done"],
tasks: [
{
name: "Placeholder Name 1",
status: "to-do",
},
{
name: "Placeholder Name 2",
status: "done",
},
],
};
},
methods: {
submitTask() {
if (this.task === "") return;
console.log(!this.editedTask);
if (this.editedTask === null) {
this.tasks.push({
name: this.task,
status: "to-do",
});
} else {
this.tasks[this.editedTask].name = this.task;
this.editedTask = null;
}
this.task = "";
},
delTask(index) {
this.tasks.splice(index, 1);
},
editTask(index) {
this.task = this.tasks[index].name;
this.editedTask = index;
},
editStatus(objectIndex, statusIndex) {
this.tasks[objectIndex].status = this.availableStatuses[statusIndex];
},
},
};
</script>
<template>
<div class="add-task">
<input
v-model="task"
type="text"
placeholder="Enter Task"
id="add-Task-Input"
/>
<button @click="submitTask" class="add-task-submit">Submit</button>
</div>
<table class="task-table">
<thead>
<tr>
<th scope="col">Task</th>
<th scope="col" id="table-head-status">Status</th>
<th scope="col" class="text-center table-icon">#</th>
<th scope="col" class="text-center table-icon">#</th>
</tr>
</thead>
<tbody>
<tr v-for="(task, index) in tasks" :key="index">
<td>{{ task.name }}</td>
<td class="text-center task-status">
<select
name="task-status"
class="task-status-select"
@change="editStatus(index, $event.target.value)"
>
<option
v-for="(status, statusIndex) in availableStatuses"
:key="status"
:value="statusIndex"
>
{{ status }}
</option>
</select>
</td>
<td>
<div class="text-center task-action-button" @click="editTask(index)">
<span class="fa fa-pen"></span>
</div>
</td>
<td>
<div class="text-center task-action-button" @click="delTask(index)">
<span class="fa fa-trash"></span>
</div>
</td>
</tr>
</tbody>
</table>
</template>
<style>
.add-task {
margin: 0 auto;
display: flex;
justify-content: center;
}
#add-Task-Input {
height: 1rem;
width: 100%;
padding: 1rem;
margin-right: 0.1rem;
border-radius: 0.25rem;
border: none;
}
.add-task-submit {
background-color: var(--vt-c-mint);
border-radius: 0.25rem;
/*make a round border*/
border: 0.1rem solid var(--vt-c-mint-dark1);
transition-duration: 100ms;
}
.add-task-submit:hover {
background-color: var(--vt-c-mint-light2);
border-color: var(--vt-c-mint);
}
.add-task-submit:active {
background-color: var(--vt-c-mint-light1);
border-color: var(--vt-c-mint-light2);
}
@media (prefers-color-scheme: dark) {
.add-task-submit:hover {
background-color: var(--vt-c-mint-light2);
border-color: var(--vt-c-mint);
}
.add-task-submit:active {
background-color: var(--vt-c-mint-dark1);
border-color: var(--vt-c-mint-dark2);
}
}
.task-table {
width: 100%;
margin: 1rem auto;
}
#table-head-status {
width: 8rem;
}
.task-status {
padding: 0;
}
.task-status-select {
color: var(--color-text);
background-color: var(--color-background);
border: none;
outline: none;
width: 100%;
height: 100%;
}
.task-status-select:hover {
color: var(--vt-c-mint);
}
.task-status-select:active {
color: var(--vt-c-mint-dark1);
}
.task-status-select option {
color: var(--vt-c-mint);
}
.task-action-button {
transition-duration: 100ms;
}
.task-action-button:hover {
color: var(--vt-c-mint);
}
.task-action-button:active {
color: var(--vt-c-mint-dark1);
}
</style>

6
src/main.js Normal file
View file

@ -0,0 +1,6 @@
import { createApp } from 'vue'
import App from './App.vue'
import '@fortawesome/fontawesome-free/css/all.css'
import '@fortawesome/fontawesome-free/js/all.js'
createApp(App).mount('#app')

14
vite.config.js Normal file
View file

@ -0,0 +1,14 @@
import { fileURLToPath, URL } from 'url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})