Skip to content

Commit 99aca65

Browse files
committed
chore(config): clean and unify build configs for sugarss + vite
1 parent a07e80b commit 99aca65

File tree

20 files changed

+828
-783
lines changed

20 files changed

+828
-783
lines changed

.postcssrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.stylelintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"extends": "stylelint-config-sugarss-recommended",
3-
"customSyntax": "postcss-html"
3+
"customSyntax": "postcss-sugarss"
44
}

docs/assets/index.3e63470d.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 576 additions & 450 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "todo",
2+
"name": "hibi",
33
"private": true,
44
"version": "0.0.0",
55
"scripts": {
@@ -9,17 +9,16 @@
99
"lint-js": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
1010
"lint-css": "stylelint src",
1111
"lint": "npm run lint-js # npm run lint-css",
12-
"test": "vitest run",
13-
"coverage": "vitest run --coverage"
12+
"test": "vitest run --passWithNoTests",
13+
"coverage": "vitest run --coverage --passWithNoTests"
1414
},
1515
"dependencies": {
1616
"pinia": "^2.0.13",
17-
"vue": "^3.2.25",
1817
"vue-router": "^4.0.14"
1918
},
2019
"devDependencies": {
2120
"@peculiar/webcrypto": "^1.4.0",
22-
"@vitejs/plugin-vue": "^3.0.0",
21+
"@vitejs/plugin-vue": "^3.2.0",
2322
"@vue/test-utils": "^2.0.0-rc.18",
2423
"c8": "^7.11.0",
2524
"eslint": "^8.12.0",
@@ -31,7 +30,8 @@
3130
"stylelint": "^14.6.1",
3231
"stylelint-config-sugarss-recommended": "^3.0.0",
3332
"sugarss": "^4.0.1",
34-
"vite": "^3.0.0",
35-
"vitest": "^0.18.0"
33+
"vite": "^3.2.11",
34+
"vitest": "^0.18.0",
35+
"vue": "^3.5.22"
3636
}
3737
}

src/App.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
<template>
2-
<router-view />
1+
<template lang='pug'>
2+
.app
3+
router-view
34
</template>
45

6+
<script setup>
7+
// Корневой компонент — просто "контейнер"
8+
// Здесь рендерится текущая страница
9+
</script>
10+
511
<style>
612
@font-face
713
font-family: "Montserrat"
8-
src: url('assets/montserrat-regular.woff2') format("woff2")
14+
src: url('@/assets/montserrat-regular.woff2') format("woff2")
915
1016
@font-face
1117
font-family: "Vensfolk"
12-
src: url('assets/vensfolk.otf') format('opentype')
18+
src: url('@/assets/vensfolk.otf') format('opentype')
1319
1420
body
1521
margin: 0
16-
background-image: linear-gradient(35deg, #fdfcfb 0%, #e2d1c3 100%)
22+
background: linear-gradient(35deg, #fdfcfb 0%, #e2d1c3 100%)
23+
font-family: "Montserrat"
1724
1825
.app
19-
font-family: "Montserrat"
2026
min-height: 100vh
21-
color: #2c3e50
2227
box-sizing: border-box
23-
28+
color: #2c3e50
2429
</style>

src/components/DayCircle.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template lang='pug'>
2+
button.day-circle(
3+
:class="{ done }"
4+
@click="$emit('click')"
5+
)
6+
</template>
7+
8+
<script setup>
9+
// Компонент "круг-день".
10+
// При клике эмитит событие наверх.
11+
12+
const props = defineProps({
13+
done: Boolean
14+
})
15+
</script>
16+
17+
<style scoped>
18+
.day-circle
19+
width: 28px
20+
height: 28px
21+
border-radius: 50%
22+
border: 2px solid #bbb
23+
background: none
24+
cursor: pointer
25+
transition: all 0.2s ease
26+
27+
.day-circle.done
28+
background: #8f0000
29+
border-color: #8f0000
30+
</style>

src/components/TaskEditor.vue

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<template lang='pug'>
2+
.task-editor
3+
input.task-editor__input(
4+
v-model='name'
5+
placeholder='Новая привычка...'
6+
@keyup.enter='add'
7+
)
8+
select.task-editor__select(v-model='type')
9+
option(value='habit') привычка
10+
option(value='periodic') периодическая
11+
button.task-editor__button(@click='add') +
12+
</template>
13+
14+
<script setup>
15+
import { ref } from 'vue'
16+
import { useTasksStore } from '@/stores/tasks'
17+
18+
const name = ref('')
19+
const type = ref('habit')
20+
const store = useTasksStore()
21+
22+
// Добавляем новую задачу
23+
function add() {
24+
if (!name.value.trim()) return
25+
store.addTask({ name: name.value, type: type.value })
26+
name.value = ''
27+
}
28+
</script>
29+
30+
<style scoped>
31+
.task-editor
32+
display: flex
33+
gap: 8px
34+
margin-top: 24px
35+
36+
.task-editor__input
37+
flex: 1
38+
border: none
39+
border-bottom: 1px solid #aaa
40+
background: none
41+
font-family: 'Montserrat'
42+
font-size: 1em
43+
44+
.task-editor__button
45+
all: unset
46+
cursor: pointer
47+
font-size: 1.5em
48+
width: 32px
49+
text-align: center
50+
51+
.task-editor__button:hover
52+
color: #8f0000
53+
</style>

src/components/TaskItem.vue

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template lang='pug'>
2+
li.task-item
3+
span.task-item__name {{ task.name }}
4+
.task-item__days
5+
DayCircle(
6+
v-for='(day, index) in 7'
7+
:key='index'
8+
:done='isDone(index)'
9+
@click='toggle(index)'
10+
)
11+
</template>
12+
13+
<script setup>
14+
// Один элемент списка — отдельная привычка или задача
15+
16+
import DayCircle from './DayCircle.vue'
17+
import { useTasksStore } from '@/stores/tasks'
18+
import { getDateForIndex } from '@/composables/useDateHelpers'
19+
20+
const props = defineProps({ task: Object })
21+
const store = useTasksStore()
22+
23+
// Проверяем, выполнен ли день по индексу
24+
function isDone(index) {
25+
const date = getDateForIndex(index)
26+
return props.task.history.some(h => h.date === date)
27+
}
28+
29+
// Кликаем — отмечаем или убираем выполнение
30+
function toggle(index) {
31+
const date = getDateForIndex(index)
32+
store.toggleDay(props.task.id, date)
33+
}
34+
</script>
35+
36+
<style>
37+
.task-item
38+
display: flex
39+
justify-content: space-between
40+
align-items: center
41+
padding: 12px 0
42+
43+
.task-item__name
44+
font-family: "Montserrat"
45+
font-size: 1em
46+
47+
.task-item__days
48+
display: flex
49+
gap: 6px
50+
</style>

src/components/TodoItem.vue

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)