-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
142 lines (128 loc) · 3.47 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<template>
<div class="app-container">
<div class="lesson-navigation">
<button
:class="{ active: currentLesson === 'lifecycle' }"
@click="currentLesson = 'lifecycle'"
>
Жизненный цикл Vue
</button>
<button
:class="{ active: currentLesson === 'collections' }"
@click="currentLesson = 'collections'"
>
JavaScript Collections
</button>
<button
:class="{ active: currentLesson === 'arrays' }"
@click="currentLesson = 'arrays'"
>
Работа с массивами
</button>
<button
:class="{ active: currentLesson === 'websocket' }"
@click="currentLesson = 'websocket'"
>
WebSocket
</button>
<button
:class="{ active: currentLesson === 'eventloop' }"
@click="currentLesson = 'eventloop'"
>
Event Loop
</button>
<button
:class="{ active: currentLesson === 'rendering' }"
@click="currentLesson = 'rendering'"
>
BrowserRenderingCycle
</button>
<button
:class="{ active: currentLesson === 'algorithms' }"
@click="currentLesson = 'algorithms'"
>
AlgorithmsDemo
</button>
</div>
<div class="lesson-content">
<LifecycleDemo v-if="currentLesson === 'lifecycle'" />
<CollectionsDemo v-if="currentLesson === 'collections'" />
<ArraysWorkshop v-if="currentLesson === 'arrays'" />
<WebSocketDemo v-if="currentLesson === 'websocket'" />
<EventLoopExplorer v-if="currentLesson === 'eventloop'" />
<BrowserRenderingCycle v-if="currentLesson === 'rendering'"/>
<AlgorithmsDemo v-if="currentLesson === 'algorithms'"/>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
import LifecycleDemo from './components/LifecycleDemo.vue';
import CollectionsDemo from './components/CollectionsDemo.vue';
import ArraysWorkshop from './components/ArraysWorkshop.vue';
import WebSocketDemo from './components/WebSocketDemo.vue';
import EventLoopExplorer from './components/EventLoopExplorer.vue';
import BrowserRenderingCycle from './components/BrowserRenderingCycle.vue';
import AlgorithmsDemo from './components/AlgorithmsDemo.vue';
const currentLesson = ref('lifecycle');
</script>
<style>
.app-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
font-family: Arial, sans-serif;
}
.lesson-navigation {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 30px;
flex-wrap: wrap;
}
.lesson-navigation button {
padding: 12px 24px;
font-size: 1rem;
background: #f5f5f5;
border: 1px solid #ddd;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s;
}
.lesson-navigation button:hover {
background: #eaeaea;
transform: translateY(-2px);
}
.lesson-navigation button.active {
background: #34495e;
color: white;
border-color: #34495e;
box-shadow: 0 4px 6px rgba(52, 73, 94, 0.2);
}
.lesson-content {
border: 1px solid #eee;
border-radius: 8px;
padding: 20px;
background: #fff;
min-height: 500px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
.lesson-navigation {
flex-direction: column;
align-items: stretch;
}
.lesson-navigation button {
margin-bottom: 10px;
}
.lesson-content {
padding: 15px;
}
}
@media (max-width: 576px) {
.app-container {
padding: 10px;
}
}
</style>