Sharkey/packages/frontend/src/components/MkRadio.vue
tamaina 15761a0fa8
enhance(client): 1枚だけのメディアリストの画像のアスペクト比を画像に応じて縦長にする (#10452)
* ✌️

* fix

* ✌️

* 422px上限

* 334

* min-height: 130px

* 64px

* fix

* wip

* ✌️

* fix

* max-height: none

* MkImgWithBlurHashでratioを計算する

* wip

* fix

* fix?

* Revert "fix?"

This reverts commit e39d832dd1498ae58a2372b6dc527585ae165bac.

* Revert "fix"

This reverts commit 15be36ba55a411c5aac69037f693e1d922451f15.

* Revert "wip"

This reverts commit af7d86f69dd89e138d98f1285976b502f382e6c6.

* fix

* Revert "Revert "wip""

This reverts commit bb0036ae22ea2bca896ee9bb500bae624e81049b.

* Revert "Revert "fix""

This reverts commit c1d94a45c575cc843e061a0c55df1106bf033035.

* Revert "Revert "fix?""

This reverts commit 9cb4fbfd96db9adaf92cf3ec1f6f15b1b257d7b3.

* fix

* use clamp

* readable

* add 1:1, 3:4

* moveComment

* 3:4 → 2:3

* fix

* default

* fallback

* Revert "fallback"

This reverts commit 741717dd4903ed89b6536d8ea1ca061aacfa7dcb.

* Fix?(server): Content-Dispositionのパースでエラーが発生した場合にもダウンロードが完了するように
#10626
2023-04-15 21:35:19 +09:00

132 lines
2.1 KiB
Vue

<template>
<div
v-adaptive-border
class="novjtctn"
:class="{ disabled, checked }"
:aria-checked="checked"
:aria-disabled="disabled"
@click="toggle"
>
<input
type="radio"
:disabled="disabled"
>
<span class="button">
<span></span>
</span>
<span class="label"><slot></slot></span>
</div>
</template>
<script lang="ts" setup>
import { } from 'vue';
const props = defineProps<{
modelValue: any;
value: any;
disabled?: boolean;
}>();
const emit = defineEmits<{
(ev: 'update:modelValue', value: any): void;
}>();
let checked = $computed(() => props.modelValue === props.value);
function toggle(): void {
if (props.disabled) return;
emit('update:modelValue', props.value);
}
</script>
<style lang="scss" scoped>
.novjtctn {
position: relative;
display: inline-block;
text-align: left;
cursor: pointer;
padding: 7px 10px;
min-width: 60px;
background-color: var(--panel);
background-clip: padding-box !important;
border: solid 1px var(--panel);
border-radius: 6px;
font-size: 90%;
transition: all 0.2s;
> * {
user-select: none;
}
&.disabled {
opacity: 0.6;
&, * {
cursor: not-allowed !important;
}
}
&:hover {
border-color: var(--inputBorderHover) !important;
}
&.checked {
background-color: var(--accentedBg) !important;
border-color: var(--accentedBg) !important;
color: var(--accent);
&, * {
cursor: default !important;
}
> .button {
border-color: var(--accent);
&:after {
background-color: var(--accent);
transform: scale(1);
opacity: 1;
}
}
}
> input {
position: absolute;
width: 0;
height: 0;
opacity: 0;
margin: 0;
}
> .button {
position: absolute;
width: 14px;
height: 14px;
background: none;
border: solid 2px var(--inputBorder);
border-radius: 100%;
transition: inherit;
&:after {
content: '';
display: block;
position: absolute;
top: 3px;
right: 3px;
bottom: 3px;
left: 3px;
border-radius: 100%;
opacity: 0;
transform: scale(0);
transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
}
> .label {
margin-left: 28px;
display: block;
line-height: 20px;
cursor: pointer;
}
}
</style>