|
1 | 1 | <template> |
2 | | - <div class="container"> |
3 | | - <h1>Sorting Visualizer</h1> |
4 | | - |
5 | | - <div class="input-section"> |
6 | | - <div class="method-selector"> |
7 | | - <label for="sortMethod">Select Sorting Method:</label> |
8 | | - <select v-model="sortMethod"> |
9 | | - <option value="bubble">Bubble Sort</option> |
10 | | - <option value="insertion">Insertion Sort</option> |
11 | | - <option value="selection">Selection Sort</option> |
12 | | - <option value="merge">Merge Sort</option> |
13 | | - <option value="quick">Quick Sort</option> |
14 | | - <option value="shell">Shell Sort</option> |
15 | | - <option value="heap">Heap Sort</option> |
16 | | - </select> |
17 | | - </div> |
| 2 | + <div class="app-wrapper"> |
| 3 | + <div class="container"> |
| 4 | + <h1>Sorting Visualizer</h1> |
| 5 | + |
| 6 | + <div class="input-section"> |
| 7 | + <div class="method-selector"> |
| 8 | + <label for="sortMethod">Select Sorting Method:</label> |
| 9 | + <select v-model="sortMethod"> |
| 10 | + <option value="bubble">Bubble Sort</option> |
| 11 | + <option value="insertion">Insertion Sort</option> |
| 12 | + <option value="selection">Selection Sort</option> |
| 13 | + <option value="merge">Merge Sort</option> |
| 14 | + <option value="quick">Quick Sort</option> |
| 15 | + <option value="shell">Shell Sort</option> |
| 16 | + <option value="heap">Heap Sort</option> |
| 17 | + </select> |
| 18 | + </div> |
18 | 19 |
|
19 | | - <div class="numbers-input"> |
20 | | - <label>Enter 5 Numbers:</label> |
21 | | - <div class="input-group"> |
22 | | - <input |
23 | | - v-for="(num, index) in numbers" |
24 | | - :key="index" |
25 | | - type="number" |
26 | | - v-model="numbers[index]" |
27 | | - :placeholder="`Number ${index + 1}`" |
28 | | - class="number-input" |
29 | | - > |
| 20 | + <div class="numbers-input"> |
| 21 | + <label>Enter 5 Numbers:</label> |
| 22 | + <div class="input-group"> |
| 23 | + <input |
| 24 | + v-for="(num, index) in numbers" |
| 25 | + :key="index" |
| 26 | + type="number" |
| 27 | + v-model="numbers[index]" |
| 28 | + :placeholder="`Number ${index + 1}`" |
| 29 | + class="number-input" |
| 30 | + > |
| 31 | + </div> |
30 | 32 | </div> |
31 | | - </div> |
32 | 33 |
|
33 | | - <button @click="sortNumbers" :disabled="isLoading"> |
34 | | - {{ isLoading ? 'Sorting...' : 'Sort Numbers' }} |
35 | | - </button> |
36 | | - </div> |
| 34 | + <button @click="sortNumbers" :disabled="isLoading"> |
| 35 | + {{ isLoading ? 'Sorting...' : 'Sort Numbers' }} |
| 36 | + </button> |
| 37 | + </div> |
37 | 38 |
|
38 | | - <div class="output-section"> |
39 | | - <div class="steps-container"> |
40 | | - <h2>Sorting Steps:</h2> |
41 | | - <div id="sortingSteps" class="steps-list"> |
42 | | - <div v-for="(step, index) in sortingSteps" |
43 | | - :key="index" |
44 | | - class="step-item"> |
45 | | - {{ step }} |
| 39 | + <div class="output-section"> |
| 40 | + <div class="steps-container"> |
| 41 | + <h2>Sorting Steps:</h2> |
| 42 | + <div id="sortingSteps" class="steps-list"> |
| 43 | + <div v-for="(step, index) in sortingSteps" |
| 44 | + :key="index" |
| 45 | + class="step-item"> |
| 46 | + {{ step }} |
| 47 | + </div> |
46 | 48 | </div> |
47 | 49 | </div> |
48 | | - </div> |
49 | | - <div class="result-container"> |
50 | | - <h2>Final Result:</h2> |
51 | | - <div id="sortingResult" class="result">{{ result }}</div> |
| 50 | + <div class="result-container"> |
| 51 | + <h2>Final Result:</h2> |
| 52 | + <div id="sortingResult" class="result">{{ result }}</div> |
| 53 | + </div> |
52 | 54 | </div> |
53 | 55 | </div> |
| 56 | + <Footer /> |
54 | 57 | </div> |
55 | 58 | </template> |
56 | 59 |
|
57 | 60 | <script> |
58 | 61 | import { ref } from 'vue' |
| 62 | +import Footer from './components/Footer.vue' |
59 | 63 |
|
60 | 64 | export default { |
61 | 65 | name: 'App', |
| 66 | + components: { |
| 67 | + Footer |
| 68 | + }, |
62 | 69 | setup() { |
63 | 70 | const sortMethod = ref('bubble') |
64 | 71 | const numbers = ref(Array(5).fill('')) |
@@ -119,7 +126,14 @@ export default { |
119 | 126 | </script> |
120 | 127 |
|
121 | 128 | <style scoped> |
| 129 | +.app-wrapper { |
| 130 | + min-height: 100vh; |
| 131 | + display: flex; |
| 132 | + flex-direction: column; |
| 133 | +} |
| 134 | +
|
122 | 135 | .container { |
| 136 | + flex: 1; |
123 | 137 | max-width: 800px; |
124 | 138 | margin: 0 auto; |
125 | 139 | padding: 20px; |
|
0 commit comments