Skip to content

Commit 377f60f

Browse files
committed
main functional complete(without dnd)
0 parents  commit 377f60f

23 files changed

+965
-0
lines changed

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["johnsoncodehk.volar"]
3+
}

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Vue 3 + TypeScript + Vite
2+
3+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4+
5+
## Recommended IDE Setup
6+
7+
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
8+
9+
## Type Support For `.vue` Imports in TS
10+
11+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:
12+
13+
1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
14+
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
15+
16+
You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Kanban</title>
8+
</head>
9+
<body>
10+
<main id="app"></main>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

package.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "kanban-from-vk",
3+
"private": true,
4+
"version": "0.0.0",
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vue-tsc --noEmit && vite build",
8+
"preview": "vite preview"
9+
},
10+
"dependencies": {
11+
"vue": "^3.2.25"
12+
},
13+
"devDependencies": {
14+
"@vitejs/plugin-vue": "^2.3.1",
15+
"typescript": "^4.5.4",
16+
"vite": "^2.9.5",
17+
"vue-tsc": "^0.34.7"
18+
}
19+
}

public/favicon.ico

4.19 KB
Binary file not shown.

src/App.vue

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup lang="ts">
2+
import Wrapper from './components/Wrapper.vue';
3+
</script>
4+
5+
<template>
6+
<Wrapper />
7+
</template>
8+
9+
<style >
10+
#app {
11+
width: 100vw;
12+
height: 100vh;
13+
}
14+
</style>

src/assets/background.png

3.59 MB
Loading

src/assets/plus.svg

+3
Loading

src/assets/style.css

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
2+
3+
*,
4+
*::before,
5+
*::after {
6+
box-sizing: border-box;
7+
margin: 0;
8+
padding: 0;
9+
text-size-adjust: none;
10+
font-family: 'Montserrat', sans-serif;
11+
font-weight: 400;
12+
font-size: .8125rem;
13+
line-height: 1.1875rem;
14+
}
15+
16+
body {
17+
-webkit-font-smoothing: antialiased;
18+
-moz-osx-font-smoothing: grayscale;
19+
20+
}

src/assets/testdata.ts

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import { ColumnType } from './../types/column.type';
2+
export const testdata: ColumnType[] = [
3+
{
4+
id: 0,
5+
title: "План на месяц",
6+
cards: [
7+
{
8+
content: "Пройти курс по React",
9+
},
10+
{
11+
content: "Отметить день рождения",
12+
},
13+
{
14+
content: "Пройти курс по React",
15+
},
16+
{
17+
content: "Отметить день рождения",
18+
},
19+
{
20+
content: "Пройти курс по React",
21+
},
22+
{
23+
content: "Отметить день рождения",
24+
},
25+
{
26+
content: "Пройти курс по React",
27+
},
28+
{
29+
content: "Отметить день рождения",
30+
},
31+
{
32+
content: "Пройти курс по React",
33+
},
34+
{
35+
content: "Записаться в мотошколу. Хотя немного страшновато, конечно.\
36+
Друзья и родители против, но очень хочется.\
37+
Но кого я обманываю, уже 2 года решаюсь на этот шаг 😢\
38+
Еще и друзья будут хрустиком называть.\
39+
В общем, хотя бы подумать над этим.",
40+
},
41+
{
42+
content: "Пройти курс по React",
43+
},
44+
{
45+
content: "Отметить день рождения",
46+
},
47+
{
48+
content: "Пройти курс по React",
49+
},
50+
{
51+
content: "Отметить день рождения",
52+
},
53+
{
54+
content: "Пройти курс по React",
55+
},
56+
{
57+
content: "Отметить день рождения",
58+
}
59+
]
60+
},
61+
{
62+
id: 1,
63+
title: "План на день",
64+
cards: [
65+
{
66+
content: "Записаться курс по React",
67+
},
68+
{
69+
content: "Сделать тестовое задание",
70+
}
71+
]
72+
},
73+
{
74+
id: 2,
75+
title: "План на неделю",
76+
cards: [
77+
{
78+
content: "Собрать портфолио",
79+
},
80+
]
81+
}
82+
]

src/components/Card.vue

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<script setup lang="ts">
2+
import { CardType } from '../types/card.type';
3+
4+
const props = defineProps<{
5+
card?: CardType,
6+
}>();
7+
8+
</script>
9+
10+
<template>
11+
<li>
12+
<div
13+
draggable="true"
14+
>
15+
<p>
16+
{{ card.content }}
17+
</p>
18+
</div>
19+
</li>
20+
</template>
21+
22+
<style scoped>
23+
div {
24+
padding: .75rem;
25+
border-radius: .1875rem;
26+
background-color: #FFFFFF;
27+
box-shadow: 0 .0625rem .25rem rgba(9, 45, 66, 0.25);
28+
}
29+
</style>

src/components/Column.vue

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue';
3+
import { ColumnType } from '../types/column.type';
4+
import Card from './Card.vue';
5+
import newBlock from './_newBlock.vue';
6+
7+
const props = defineProps<{
8+
column?: ColumnType,
9+
}>();
10+
11+
12+
const createCard = (value: string): void => {
13+
props.column?.cards.push({
14+
content: value
15+
});
16+
};
17+
18+
</script>
19+
20+
<template>
21+
<div class="column">
22+
<div >
23+
<h2>
24+
{{ column.title }}
25+
</h2>
26+
27+
<ul>
28+
<Card
29+
v-for="(card, index) in column.cards"
30+
:card="card"
31+
:key="index"
32+
></Card>
33+
</ul>
34+
35+
<newBlock
36+
:is-col="false"
37+
placeholder="Добавить карточку"
38+
@create-card="createCard"
39+
>
40+
</newBlock>
41+
</div>
42+
</div>
43+
</template>
44+
45+
<style >
46+
.column {
47+
z-index: 0;
48+
width: 17rem;
49+
height: fit-content;
50+
max-height: 100%;
51+
52+
overflow: hidden;
53+
background-color: #DFE3E6;
54+
55+
border-radius: .1875rem;
56+
}
57+
58+
.column h2 {
59+
padding: .75rem .75rem 0;
60+
font-weight: bold;
61+
}
62+
63+
.column ul {
64+
list-style: none;
65+
padding: .75rem;
66+
max-height: 25rem;
67+
68+
overflow-y: auto;
69+
70+
display: flex;
71+
flex-direction: column;
72+
gap: .75rem;
73+
}
74+
75+
.column ul {
76+
scrollbar-width: none;
77+
-ms-overflow-style: none;
78+
}
79+
80+
.column ul::-webkit-scrollbar {
81+
display: none;
82+
}
83+
</style>

src/components/Wrapper.vue

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<script setup lang="ts">
2+
import newBlock from './_newBlock.vue';
3+
import Column from './Column.vue';
4+
import { ref } from 'vue';
5+
import { testdata } from '../assets/testdata';
6+
7+
const columns = ref(testdata);
8+
9+
const createCol = (newCol: string): void => {
10+
columns.value.push({
11+
id: columns.value.length,
12+
title: newCol,
13+
cards: [],
14+
});
15+
};
16+
17+
</script>
18+
19+
<template>
20+
<div class="wrapper">
21+
<Column
22+
v-for="column of columns"
23+
:column="column"
24+
:key="column.id"
25+
>
26+
</Column>
27+
28+
<div class="column">
29+
<newBlock
30+
:is-col="true"
31+
placeholder="Добавить колонку"
32+
@create-col="createCol"
33+
>
34+
</newBlock>
35+
</div>
36+
</div>
37+
</template>
38+
39+
<style scoped>
40+
.wrapper {
41+
width: 100%;
42+
height: 100%;
43+
padding: 1.25rem;
44+
45+
background: url('../assets/background.png') no-repeat center;
46+
background-size: cover;
47+
48+
display: flex;
49+
flex-direction: row;
50+
gap: .75rem;
51+
}
52+
</style>

0 commit comments

Comments
 (0)