refactor: rework webcam settings visuals (#679)

This commit is contained in:
th33xitus authored and GitHub committed 2022-03-01 00:18:47 +01:00
1 parent efb0167f53
commit 5bfdcf3816
1 file changed
+54 -9
+54 -9
View File
@@ -1,3 +1,30 @@
<style lang="scss" scoped>
._transition i::before {
transition: transform 500ms;
}
._rotate-180:before {
transform: rotate(180deg);
}
.v-item-group {
button:hover::before,
button:focus::before {
opacity: 0 !important;
}
._menu-button {
height: 40px;
width: 62px;
border: 1px solid rgba(255, 255, 255, 0.25) !important;
}
._menu-button:hover {
border-color: rgba(255, 255, 255, 1) !important;
}
._menu-button:focus {
border: 2px solid var(--color-primary) !important;
}
}
</style>
<template>
<div>
<v-card v-if="!form.bool" flat>
@@ -36,17 +63,26 @@
<v-row>
<v-col class="col-12 col-sm-6">
<v-row>
<v-col class="col-2">
<v-col class="d-flex align-center">
<v-item-group>
<v-menu :offset-y="true" title="Icon">
<template #activator="{ on, attrs }">
<v-btn
class="px-2 minwidth-0"
class="px-2 mr-2 _transition _menu-button"
color="transparent"
v-bind="attrs"
elevation="0"
v-on="on">
v-on="on"
:ripple="false"
@blur="selectIcon = !selectIcon"
@focus="selectIcon = !selectIcon">
<v-icon>{{ form.icon }}</v-icon>
<v-icon
:class="!selectIcon ? '' : '_rotate-180'"
:color="!selectIcon ? '' : 'primary'"
class="pl-1 mr-n2">
mdi-menu-down
</v-icon>
</v-btn>
</template>
<v-list dense class="py-0">
@@ -65,52 +101,59 @@
</v-list>
</v-menu>
</v-item-group>
</v-col>
<v-col class="col-10">
<v-text-field
v-model="form.name"
:label="$t('Settings.WebcamsTab.Name')"
hide-details="auto"
outlined
:rules="[rules.required, rules.unique]"
dense></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="py-1">
<v-col class="py-2">
<v-text-field
v-model="form.urlStream"
:label="$t('Settings.WebcamsTab.UrlStream')"
hide-details="auto"
outlined
dense
:rules="
form.service !== 'mjpegstreamer-adaptive' ? [rules.required] : []
"></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="py-1">
<v-col class="py-2">
<v-text-field
v-model="form.urlSnapshot"
:label="$t('Settings.WebcamsTab.UrlSnapshot')"
hide-details="auto"
outlined
dense
:rules="
form.service === 'mjpegstreamer-adaptive' ? [rules.required] : []
"></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="py-1">
<v-col class="py-2">
<v-select
v-model="form.service"
:items="serviceItems"
hide-details
outlined
dense
:label="$t('Settings.WebcamsTab.Service')"
attach></v-select>
</v-col>
</v-row>
<v-row v-if="form.service === 'mjpegstreamer-adaptive'">
<v-col class="py-1">
<v-col class="py-2">
<v-text-field
v-model="form.targetFps"
outlined
dense
hide-details
:label="$t('Settings.WebcamsTab.TargetFPS')"></v-text-field>
</v-col>
@@ -206,6 +249,8 @@ interface webcamForm {
},
})
export default class SettingsWebcamsTab extends Mixins(BaseMixin) {
private selectIcon: boolean = false
private form: webcamForm = {
bool: false,
id: null,