Skip to content

Commit 5319626

Browse files
committed
Vue Lab - Fixed CSS.
1 parent a54c5dd commit 5319626

3 files changed

Lines changed: 59 additions & 71 deletions

File tree

4 - Frameworks/Ejercicios/VUE/vue-lab/todo-app/components/SearchBar.vue

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<template>
22
<div class="search-container">
3-
<input
4-
type="text"
5-
v-model="searchQuery"
6-
placeholder="Search todos..."
7-
class="search-input"
8-
@input="search"
9-
/>
3+
<input type="text" v-model="searchQuery" placeholder="Search todos..." class="search-input" @input="search" />
104
</div>
115
</template>
126

@@ -31,14 +25,5 @@ const search = () => {
3125
width: 100%;
3226
padding: 0.5rem;
3327
font-size: 1rem;
34-
border: 1px solid #ddd;
35-
border-radius: 4px;
36-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
37-
}
38-
39-
.search-input:focus {
40-
outline: none;
41-
border-color: #4CAF50;
42-
box-shadow: 0 2px 4px rgba(76,175,80,0.2);
4328
}
4429
</style>
Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,49 @@
11
<template>
2-
<div class="filter-container">
3-
<button
4-
v-for="option in filterOptions"
5-
:key="option.value"
6-
@click="store.setFilter(option.value)"
7-
:class="{ active: store.filter === option.value }"
8-
class="filter-button"
9-
>
10-
{{ option.label }}
11-
</button>
12-
</div>
13-
</template>
14-
15-
<script setup lang="ts">
16-
import { useTodoStore } from '~/stores/todo-store'
17-
import type { FilterType } from '~/stores/todo-store'
18-
19-
const store = useTodoStore()
20-
21-
const filterOptions = [
22-
{ value: 'all' as FilterType, label: 'All' },
23-
{ value: 'active' as FilterType, label: 'Active' },
24-
{ value: 'completed' as FilterType, label: 'Completed' }
25-
]
26-
</script>
27-
28-
<style scoped>
29-
.filter-container {
30-
display: flex;
31-
justify-content: center;
32-
gap: 1rem;
33-
margin: 1rem 0;
34-
}
35-
36-
.filter-button {
37-
padding: 0.5rem 1rem;
38-
border: 1px solid #ddd;
39-
border-radius: 4px;
40-
background: white;
41-
cursor: pointer;
42-
transition: all 0.2s;
43-
}
44-
45-
.filter-button:hover {
46-
background: #f5f5f5;
47-
}
48-
49-
.filter-button.active {
50-
background: #4CAF50;
51-
color: white;
52-
border-color: #4CAF50;
53-
}
54-
</style>
2+
<div class="filter-container">
3+
<button v-for="option in filterOptions" :key="option.value" @click="store.setFilter(option.value)"
4+
:class="{ active: store.filter === option.value }" class="filter-button">
5+
{{ option.label }}
6+
</button>
7+
</div>
8+
</template>
9+
10+
<script setup lang="ts">
11+
import { useTodoStore } from '~/stores/todo-store'
12+
import type { FilterType } from '~/types/index'
13+
14+
const store = useTodoStore()
15+
16+
const filterOptions = [
17+
{ value: 'all' as FilterType, label: 'All' },
18+
{ value: 'active' as FilterType, label: 'Active' },
19+
{ value: 'completed' as FilterType, label: 'Completed' }
20+
]
21+
</script>
22+
23+
<style scoped>
24+
.filter-container {
25+
display: flex;
26+
justify-content: center;
27+
gap: 1rem;
28+
margin: 1rem 0;
29+
}
30+
31+
.filter-button {
32+
padding: 0.5rem 1rem;
33+
border: 1px solid #ddd;
34+
border-radius: 4px;
35+
background: white;
36+
cursor: pointer;
37+
transition: all 0.2s;
38+
}
39+
40+
.filter-button:hover {
41+
background: #f5f5f5;
42+
}
43+
44+
.filter-button.active {
45+
background: #4CAF50;
46+
color: white;
47+
border-color: #4CAF50;
48+
}
49+
</style>

4 - Frameworks/Ejercicios/VUE/vue-lab/todo-app/components/TodoInput.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ const addTodo = () => {
3232
3333
.add-button {
3434
padding: 0.5rem 1rem;
35-
background-color: #4CAF50;
36-
color: white;
35+
border-radius: 4px;
3736
border: none;
3837
cursor: pointer;
38+
font-weight: bold;
39+
transition: all 0.2s;
40+
background-color: #4CAF50;
41+
color: white;
42+
border-color: #4CAF50;
43+
}
44+
45+
.add-button:hover {
46+
background-color: #45a049;
3947
}
4048
</style>

0 commit comments

Comments
 (0)