Skip to content

Commit

Permalink
made the layout more responsive, begun adding divisions page
Browse files Browse the repository at this point in the history
  • Loading branch information
smeggmann99 committed Oct 29, 2024
1 parent d399ac3 commit 6914eda
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 23 deletions.
2 changes: 2 additions & 0 deletions web/optivum-better-schedule-frontend/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ declare module 'vue' {
Clock: typeof import('./src/components/clock/Clock.vue')['default']
copy: typeof import('./src/components/HelloWorld copy.vue')['default']
Digit: typeof import('./src/components/clock/Digit.vue')['default']
DivisionButton: typeof import('./src/components/DivisionButton.vue')['default']
Divisions: typeof import('./src/components/pages/Divisions.vue')['default']
Dots: typeof import('./src/components/Dots.vue')['default']
Drawer: typeof import('./src/components/Drawer.vue')['default']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- DivisionsButton.vue -->
<template>
<v-card class="card-box rounded-pill pa-8" elevation="8">
<v-btn class="fill-height fill-width" :ripple="false" v-ripple>
<span>{{ text }}</span>
</v-btn>
</v-card>
</template>

<script setup>
import { defineProps } from 'vue'
const props = defineProps({
text: {
type: String,
required: true
}
})
</script>

<style scoped>
.card-box {
margin: 3vh;
aspect-ratio: 1 / 1;
display: inline-flex;
align-items: center;
justify-content: center;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const items = computed(() => [
}
.menu-card {
z-index: 999;
width: 32px;
aspect-ratio: 1 / 1;
display: inline-flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@
<div class="text-center">
<span class="theme-title">{{ t('theme.name') }}</span>
<v-btn-toggle v-model="currentTheme" mandatory class="ma-4 elevation-8" color="tertiary" variant="outlined">
<v-btn value="dracula">
<span>{{ t('theme.options.dracula') }}</span>
<v-icon end>mdi-ghost</v-icon>
</v-btn>
<v-btn value="dark">
<span>{{ t('theme.options.dark') }}</span>
<v-icon end>mdi-weather-night</v-icon>
</v-btn>
<v-btn value="auto">
<span>{{ t('theme.options.auto') }}</span>
<v-icon end>mdi-auto-mode</v-icon>
</v-btn>
<v-btn value="light">
<span>{{ t('theme.options.light') }}</span>
<v-icon end>mdi-weather-sunny</v-icon>
</v-btn>
<v-btn value="dracula" icon="mdi-ghost" />
<v-btn value="dark" icon="mdi-weather-night" />
<v-btn value="auto" icon="mdi-auto-mode" />
<v-btn value="light" icon="mdi-weather-sunny" />
</v-btn-toggle>
</div>
</v-container>
Expand Down
27 changes: 20 additions & 7 deletions web/optivum-better-schedule-frontend/src/components/Weather.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<span class="temperature">{{ temperature }}</span>
</div>
</v-col>
<v-col class="text-right condition-col" cols="5">
<v-col class="text-right condition-col" cols="6">
<div class="d-flex flex-column align-end">
<span class="condition-text">{{ conditionName }}</span>
<span class="condition-text">{{ conditionDescription }}</span>
<span class="condition-text-lower">{{ conditionDescription }}</span>
</div>
</v-col>
</v-row>
Expand Down Expand Up @@ -237,7 +237,7 @@ onUnmounted(() => {

<style scoped>
.weather-card {
width: 70%;
width: 100%;
padding: 1.5vw;
background-color: transparent;
user-select: none;
Expand Down Expand Up @@ -276,7 +276,7 @@ onUnmounted(() => {
.temperature {
font-size: 3vw;
font-weight: 700;
font-weight: 400;
color: var(--v-primary-darken1);
user-select: none;
}
Expand All @@ -286,6 +286,15 @@ onUnmounted(() => {
}
.condition-text {
font-size: 2vw;
font-weight: 800;
color: var(--v-secondary-lighten2);
text-align: right;
white-space: nowrap;
user-select: none;
}
.condition-text-lower {
font-size: 2vw;
font-weight: 400;
color: var(--v-secondary-lighten2);
Expand Down Expand Up @@ -323,7 +332,7 @@ onUnmounted(() => {
}
.forecast-icon {
font-size: 2.5vw;
font-size: 4vw;
color: var(--v-info-base);
user-select: none;
}
Expand All @@ -332,9 +341,9 @@ onUnmounted(() => {
color: var(--v-primary-lighten4);
}
@media (max-width: 800px) {
@media (max-width: 700px) {
.weather-card {
width: 95%;
width: 100%;
padding: 1vw;
}
Expand All @@ -354,6 +363,10 @@ onUnmounted(() => {
font-size: 3vw;
}
.condition-text-lower {
font-size: 2.5vw;
}
.forecast-day,
.forecast-temp {
font-size: 4vw;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!-- Divisions.vue -->
<template>
<v-container class="search-container" flui>
<v-col class="divisions-grid" align="center" justify="center">
<v-text-field v-model="search" class="search" label="Search Icons" placeholder="Type to search..."
prepend-inner-icon="mdi-magnify" outlined></v-text-field>
</v-col>
</v-container>
<v-slide-y-reverse-transition appear>
<v-container class="grid-container" fluid>
<v-row class="divisions-grid" align="center" justify="center">
<v-col cols="12" class="d-flex justify-center grid-item">
<v-row>
<v-col v-for="(item, index) in filteredItems" :key="index" cols="4" sm="3" md="2" lg="1"
class="d-flex align-center justify-center">
<DivisionButton :text="item" />
</v-col>
</v-row>
</v-col>
</v-row>
</v-container>
</v-slide-y-reverse-transition>
</template>

<script setup>
import { ref, computed } from 'vue'
import DivisionButton from '../DivisionButton.vue';
// Reactive state
const search = ref('') // Holds the search input
const items = ref([
'START', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'access-point-off',
'ab-testing', 'abacus', 'access-point', 'account', 'account-alert', 'account-box',
'access-point-check', 'access-point-minus', 'access-point-network', 'END',
])
// Computed property for filtered items
const filteredItems = computed(() => {
// If search is empty, show all items
if (!search.value) return items.value
// Filter items based on search input
return items.value.filter(item => item.toLowerCase().includes(search.value.toLowerCase()))
})
</script>

<style scoped>
.grid-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
padding: 0;
}
.search-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
position: static;
padding: 0;
}
.divisions-grid {
flex-wrap: nowrap;
display: grid;
width: 100%;
justify-items: center;
align-items: center;
gap: 1rem;
padding: 0;
}
.grid-item {
max-width: 100%;
padding: 0;
}
.search {
width: 100%;
max-width: 500px;
margin: 1rem;
}
</style>
4 changes: 4 additions & 0 deletions web/optivum-better-schedule-frontend/src/router.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { createRouter, createWebHistory } from 'vue-router'

import MainPage from './components/pages/Home.vue'
import DivisionsPage from './components/pages/Divisions.vue'
import SettingsPage from './components/pages/Settings.vue'

const routes = [
{ path: '/', component: MainPage },
{ path: '/home', component: MainPage },
{ path: '/divisions', component: DivisionsPage },
{ path: '/settings', component: SettingsPage },

{ path: '/division/:id', component: DivisionsPage, props: true },
]

const router = createRouter({
Expand Down

0 comments on commit 6914eda

Please sign in to comment.