-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from web-radio/feature/ui-improvements
[Feature] UI improvements
- Loading branch information
Showing
16 changed files
with
414 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<script lang="ts" setup> | ||
import VDropdownMenu from 'v-dropdown-menu'; | ||
import { computed } from 'vue'; | ||
const props = defineProps<{ | ||
icon: string; | ||
label?: string; | ||
required?: boolean; | ||
options: { text: string; value: any }[]; | ||
}>(); | ||
const model = defineModel(); | ||
function selectOption(optionValue: any) { | ||
if (model.value !== optionValue || props.required) model.value = optionValue; | ||
else model.value = undefined; | ||
} | ||
const selectedOption = computed(() => | ||
props.options.find( | ||
(option) => JSON.stringify([option.value]) === JSON.stringify([model.value]) | ||
) | ||
); | ||
</script> | ||
|
||
<template> | ||
<v-dropdown-menu :overlay="false" style="width: 100%"> | ||
<template #trigger> | ||
<button | ||
class="chip" | ||
:class="{ 'chip--active': model && model !== 'all' }" | ||
> | ||
<span class="material-symbols-rounded">{{ icon }}</span> | ||
{{ selectedOption?.value !== undefined ? selectedOption.text : label }} | ||
<span class="material-symbols-rounded" style="margin-left: 10px"> | ||
keyboard_arrow_down | ||
</span> | ||
</button> | ||
</template> | ||
<template #body> | ||
<div class="dropdown__options"> | ||
<div | ||
class="dropdown__option" | ||
v-for="(option, index) in options" | ||
:key="index" | ||
@click="selectOption(option.value)" | ||
> | ||
{{ option.text }} | ||
</div> | ||
</div> | ||
</template> | ||
</v-dropdown-menu> | ||
</template> | ||
|
||
<style lang="scss"> | ||
.dropdown__options { | ||
margin-top: 5px; | ||
max-height: calc(100vh - 340px); | ||
background: #09090d; | ||
border-radius: 7px; | ||
border: 1px solid #ffffff10; | ||
overflow: scroll; | ||
z-index: 20; | ||
|
||
.dropdown__option { | ||
padding: 10px 15px; | ||
user-select: none; | ||
width: 100%; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
background: #ffffff06; | ||
} | ||
} | ||
} | ||
|
||
.v-dropdown-menu__container { | ||
background-color: inherit !important; | ||
border: inherit !important; | ||
} | ||
|
||
.v-dropdown-menu { | ||
width: inherit !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script setup lang="ts"> | ||
import { useToggle } from '@vueuse/core'; | ||
const model = defineModel(); | ||
defineProps<{ icon: string; text: string }>(); | ||
const toggle = useToggle(model); | ||
</script> | ||
|
||
<template> | ||
<button class="chip" :class="{ 'chip--active': model }" @click="toggle()"> | ||
<span class="material-symbols-rounded">{{ icon }}</span> | ||
{{ text }} | ||
</button> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<script lang="ts" setup> | ||
const model = defineModel(); | ||
</script> | ||
|
||
<template> | ||
<div class="search-field"> | ||
<input | ||
class="search-field__input" | ||
v-model="model" | ||
:placeholder="$t('nav.search')" | ||
/> | ||
<div class="search-field__icon"> | ||
<span class="material-symbols-rounded">search</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.search-field { | ||
width: 100%; | ||
position: relative; | ||
max-width: 650px; | ||
.search-field__icon { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
left: 15px; | ||
display: flex; | ||
align-items: center; | ||
.material-symbols-rounded { | ||
color: #fff; | ||
font-size: 20px; | ||
} | ||
} | ||
input.search-field__input { | ||
background: #ffffff04; | ||
border-radius: 7px; | ||
border: 1px solid #ffffff10; | ||
width: 100%; | ||
outline: none; | ||
color: #fff; | ||
font-family: 'Poppins', sans-serif !important; | ||
padding: 15px 15px 15px 50px; | ||
font-size: 14px; | ||
&::placeholder { | ||
color: #cfcfcf; | ||
line-height: 16px; | ||
font-family: 'Poppins', sans-serif !important; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.