Tweak look of buttons

This commit is contained in:
Joscha 2025-04-09 15:29:20 +02:00
parent b20156031b
commit 9d07b9c92d
4 changed files with 58 additions and 34 deletions

View file

@ -136,12 +136,14 @@ onMounted(() => {
<p>{{ originalsInfo }}</p> <p>{{ originalsInfo }}</p>
</div> </div>
<div class="buttons"> <div class="buttons">
<CPhotoButtonGallery @click="onGallery" /> <div>
<CPhotoButtonRecord :disabled="stream === undefined" @click="onRecord" /> <CPhotoButtonGallery @click="onGallery" />
<CPhotoButtonFlip <CPhotoButtonRecord :disabled="stream === undefined" @click="onRecord" />
:disabled="stream === undefined || facing === undefined" <CPhotoButtonFlip
@click="onFlip" :disabled="stream === undefined || facing === undefined"
/> @click="onFlip"
/>
</div>
</div> </div>
<div class="cover" :class="{ hidden: !covered }"> <div class="cover" :class="{ hidden: !covered }">
<RiLoader4Fill size="48px" /> <RiLoader4Fill size="48px" />
@ -149,6 +151,17 @@ onMounted(() => {
</template> </template>
<style> <style>
:root {
--button-fg: #000;
--button-active-fg: #fff;
--button-active-bg: #000;
--button-disabled-fg: #888;
--record-button-fg: #f00;
--record-button-active-fg: #800;
--record-button-disabled-fg: var(--button-disabled-fg);
}
body { body {
margin: 0; margin: 0;
background-color: black; background-color: black;
@ -166,32 +179,44 @@ video.mirrored {
scale: -1 1; scale: -1 1;
} }
.originals { .originals,
.buttons {
position: absolute; position: absolute;
top: 0;
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.originals {
top: 0;
}
.buttons {
bottom: 0;
}
.originals p,
.buttons div {
border-radius: 100px;
background-color: #fffa;
backdrop-filter: blur(8px);
}
.originals p { .originals p {
margin: 0; margin: 10px 0 0 0;
margin-top: 20px; padding: 5px 20px;
padding: 0.2em 0.8em;
border-radius: 10em;
background-color: #fffa;
text-align: center; text-align: center;
} }
.buttons { .buttons div {
position: absolute;
bottom: 0;
width: 100%;
margin-bottom: 20px;
display: flex; display: flex;
justify-content: space-evenly;
align-items: center; align-items: center;
gap: 20px;
/* The big button has a height of 100px, the smaller one a height of 74px. This
* calculation ensures the border of the background element is cocentric with
* the smaller buttons. */
padding: 10px calc(10px + (100px - 74px) / 2);
margin-bottom: 10px;
} }
.cover { .cover {

View file

@ -12,21 +12,20 @@ import { RiCameraSwitchFill } from "@remixicon/vue";
button { button {
padding: 8px; padding: 8px;
color: white; color: var(--button-fg);
border: 5px solid white; border: 5px solid var(--button-fg);
border-radius: 100px; border-radius: 100px;
background-color: transparent; background-color: transparent;
} }
button:enabled:active { button:enabled:active {
color: black; color: var(--button-active-fg);
background-color: white; background-color: var(--button-active-bg);
} }
button:disabled { button:disabled {
--disabled: #444; color: var(--button-disabled-fg);
color: var(--disabled); border-color: var(--button-disabled-fg);
border-color: var(--disabled);
} }
svg { svg {

View file

@ -27,16 +27,16 @@ function onImageChange() {
label { label {
padding: 8px; padding: 8px;
border: 5px solid white; border: 5px solid var(--button-fg);
border-radius: 100px; border-radius: 100px;
background-color: transparent; background-color: transparent;
color: white; color: var(--button-fg);
} }
label:active { label:active {
background-color: white; color: var(--button-active-fg);
color: black; background-color: var(--button-active-bg);
} }
svg { svg {

View file

@ -9,7 +9,7 @@ button {
width: 100px; width: 100px;
height: 100px; height: 100px;
--color: red; --color: var(--record-button-fg);
border: 10px solid var(--color); border: 10px solid var(--color);
border-radius: 100px; border-radius: 100px;
@ -17,11 +17,11 @@ button {
} }
button:enabled:active { button:enabled:active {
--color: white; --color: var(--record-button-active-fg);
} }
button:disabled { button:disabled {
--color: #444; --color: var(--record-button-disabled-fg);
} }
button div { button div {