Merge branch 'develop' into bh-worker
This commit is contained in:
commit
7932b18b4c
|
@ -7,7 +7,6 @@
|
||||||
:class="[
|
:class="[
|
||||||
$style.medias,
|
$style.medias,
|
||||||
count <= 4 ? $style['n' + count] : $style.nMany,
|
count <= 4 ? $style['n' + count] : $style.nMany,
|
||||||
$style[`n1${defaultStore.reactiveState.mediaListWithOneImageAppearance.value}`]
|
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<template v-for="media in mediaList.filter(media => previewable(media))">
|
<template v-for="media in mediaList.filter(media => previewable(media))">
|
||||||
|
@ -44,37 +43,6 @@ const pswpZIndex = os.claimZIndex('middle');
|
||||||
document.documentElement.style.setProperty('--mk-pswp-root-z-index', pswpZIndex.toString());
|
document.documentElement.style.setProperty('--mk-pswp-root-z-index', pswpZIndex.toString());
|
||||||
const count = $computed(() => props.mediaList.filter(media => previewable(media)).length);
|
const count = $computed(() => props.mediaList.filter(media => previewable(media)).length);
|
||||||
|
|
||||||
function calcAspectRatio() {
|
|
||||||
if (!gallery.value) return;
|
|
||||||
|
|
||||||
let img = props.mediaList[0];
|
|
||||||
|
|
||||||
if (props.mediaList.length !== 1 || !(img.properties.width && img.properties.height)) {
|
|
||||||
gallery.value.style.aspectRatio = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// アスペクト比上限設定では、横長の場合は高さを縮小させる
|
|
||||||
const ratioMax = (ratio: number) => `${Math.max(ratio, img.properties.width / img.properties.height).toString()} / 1`;
|
|
||||||
|
|
||||||
switch (defaultStore.state.mediaListWithOneImageAppearance) {
|
|
||||||
case '16_9':
|
|
||||||
gallery.value.style.aspectRatio = ratioMax(16 / 9);
|
|
||||||
break;
|
|
||||||
case '1_1':
|
|
||||||
gallery.value.style.aspectRatio = ratioMax(1);
|
|
||||||
break;
|
|
||||||
case '2_3':
|
|
||||||
gallery.value.style.aspectRatio = ratioMax(2 / 3);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
gallery.value.style.aspectRatio = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
watch([defaultStore.reactiveState.mediaListWithOneImageAppearance, gallery], () => calcAspectRatio());
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const lightbox = new PhotoSwipeLightbox({
|
const lightbox = new PhotoSwipeLightbox({
|
||||||
dataSource: props.mediaList
|
dataSource: props.mediaList
|
||||||
|
@ -194,36 +162,12 @@ const previewable = (file: misskey.entities.DriveFile): boolean => {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 8px;
|
grid-gap: 8px;
|
||||||
|
|
||||||
|
// for webkit
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
&.n1 {
|
&.n1 {
|
||||||
|
aspect-ratio: 16/9;
|
||||||
grid-template-rows: 1fr;
|
grid-template-rows: 1fr;
|
||||||
|
|
||||||
// default (expand)
|
|
||||||
min-height: 64px;
|
|
||||||
max-height: clamp(
|
|
||||||
64px,
|
|
||||||
calc(var(--containerHeight, 100svh) * 0.5), // but --containerHeight can broken (too big)
|
|
||||||
min(334px, 50vh)
|
|
||||||
);
|
|
||||||
|
|
||||||
&.n116_9 {
|
|
||||||
min-height: none;
|
|
||||||
max-height: none;
|
|
||||||
aspect-ratio: 16 / 9; // fallback
|
|
||||||
}
|
|
||||||
|
|
||||||
&.n11_1{
|
|
||||||
min-height: none;
|
|
||||||
max-height: none;
|
|
||||||
aspect-ratio: 1 / 1; // fallback
|
|
||||||
}
|
|
||||||
|
|
||||||
&.n12_3 {
|
|
||||||
min-height: none;
|
|
||||||
max-height: none;
|
|
||||||
aspect-ratio: 2 / 3; // fallback
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.n2 {
|
&.n2 {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<button v-if="closeButton" v-tooltip="i18n.ts.close" class="_button" :class="$style.headerButton" @click="close()"><i class="ti ti-x"></i></button>
|
<button v-if="closeButton" v-tooltip="i18n.ts.close" class="_button" :class="$style.headerButton" @click="close()"><i class="ti ti-x"></i></button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-container :class="$style.content">
|
<div :class="$style.content">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -541,7 +541,7 @@ defineExpose({
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
container-type: inline-size;
|
container-type: size;
|
||||||
}
|
}
|
||||||
|
|
||||||
$handleSize: 8px;
|
$handleSize: 8px;
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
import { Directive } from 'vue';
|
|
||||||
|
|
||||||
const map = new WeakMap<HTMLElement, ResizeObserver>();
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mounted(el: HTMLElement, binding, vn) {
|
|
||||||
const ro = new ResizeObserver((entries, observer) => {
|
|
||||||
el.style.setProperty('--containerHeight', el.offsetHeight + 'px');
|
|
||||||
});
|
|
||||||
ro.observe(el);
|
|
||||||
map.set(el, ro);
|
|
||||||
},
|
|
||||||
|
|
||||||
unmounted(el, binding, vn) {
|
|
||||||
const ro = map.get(el);
|
|
||||||
if (ro) {
|
|
||||||
ro.disconnect();
|
|
||||||
map.delete(el);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
} as Directive;
|
|
|
@ -11,7 +11,6 @@ import clickAnime from './click-anime';
|
||||||
import panel from './panel';
|
import panel from './panel';
|
||||||
import adaptiveBorder from './adaptive-border';
|
import adaptiveBorder from './adaptive-border';
|
||||||
import adaptiveBg from './adaptive-bg';
|
import adaptiveBg from './adaptive-bg';
|
||||||
import container from './container';
|
|
||||||
|
|
||||||
export default function(app: App) {
|
export default function(app: App) {
|
||||||
for (const [key, value] of Object.entries(directives)) {
|
for (const [key, value] of Object.entries(directives)) {
|
||||||
|
@ -32,5 +31,4 @@ export const directives = {
|
||||||
'panel': panel,
|
'panel': panel,
|
||||||
'adaptive-border': adaptiveBorder,
|
'adaptive-border': adaptiveBorder,
|
||||||
'adaptive-bg': adaptiveBg,
|
'adaptive-bg': adaptiveBg,
|
||||||
'container': container,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -81,7 +81,7 @@ let name = $ref(null);
|
||||||
let description = $ref(null);
|
let description = $ref(null);
|
||||||
let bannerUrl = $ref<string | null>(null);
|
let bannerUrl = $ref<string | null>(null);
|
||||||
let bannerId = $ref<string | null>(null);
|
let bannerId = $ref<string | null>(null);
|
||||||
let color = $ref(null);
|
let color = $ref('#000');
|
||||||
const pinnedNotes = ref([]);
|
const pinnedNotes = ref([]);
|
||||||
|
|
||||||
watch(() => bannerId, async () => {
|
watch(() => bannerId, async () => {
|
||||||
|
|
|
@ -206,7 +206,7 @@ definePageMetadata(computed(() => channel ? {
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.main {
|
.main {
|
||||||
min-height: calc(var(--containerHeight) - (var(--stickyTop, 0px) + var(--stickyBottom, 0px)));
|
min-height: calc(100cqh - (var(--stickyTop, 0px) + var(--stickyBottom, 0px)));
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
|
|
|
@ -131,7 +131,7 @@ definePageMetadata(computed(() => list ? {
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.main {
|
.main {
|
||||||
min-height: calc(var(--containerHeight) - (var(--stickyTop, 0px) + var(--stickyBottom, 0px)));
|
min-height: calc(100cqh - (var(--stickyTop, 0px) + var(--stickyBottom, 0px)));
|
||||||
}
|
}
|
||||||
|
|
||||||
.userItem {
|
.userItem {
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<option value="ignore">{{ i18n.ts._nsfw.ignore }}</option>
|
<option value="ignore">{{ i18n.ts._nsfw.ignore }}</option>
|
||||||
<option value="force">{{ i18n.ts._nsfw.force }}</option>
|
<option value="force">{{ i18n.ts._nsfw.force }}</option>
|
||||||
</MkSelect>
|
</MkSelect>
|
||||||
|
<!--
|
||||||
<MkRadios v-model="mediaListWithOneImageAppearance">
|
<MkRadios v-model="mediaListWithOneImageAppearance">
|
||||||
<template #label>{{ i18n.ts.mediaListWithOneImageAppearance }}</template>
|
<template #label>{{ i18n.ts.mediaListWithOneImageAppearance }}</template>
|
||||||
<option value="expand">{{ i18n.ts.default }}</option>
|
<option value="expand">{{ i18n.ts.default }}</option>
|
||||||
|
@ -64,6 +64,7 @@
|
||||||
<option value="1_1">{{ i18n.t('limitTo', { x: '1:1' }) }}</option>
|
<option value="1_1">{{ i18n.t('limitTo', { x: '1:1' }) }}</option>
|
||||||
<option value="2_3">{{ i18n.t('limitTo', { x: '2:3' }) }}</option>
|
<option value="2_3">{{ i18n.t('limitTo', { x: '2:3' }) }}</option>
|
||||||
</MkRadios>
|
</MkRadios>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<span :class="$style.title"><slot name="header"></slot></span>
|
<span :class="$style.title"><slot name="header"></slot></span>
|
||||||
<button v-tooltip="i18n.ts.settings" :class="$style.menu" class="_button" @click.stop="showSettingsMenu"><i class="ti ti-dots"></i></button>
|
<button v-tooltip="i18n.ts.settings" :class="$style.menu" class="_button" @click.stop="showSettingsMenu"><i class="ti ti-dots"></i></button>
|
||||||
</header>
|
</header>
|
||||||
<div v-show="active" ref="body" v-container :class="$style.body">
|
<div v-show="active" ref="body" :class="$style.body">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
@ -362,7 +362,7 @@ function onDrop(ev) {
|
||||||
overflow-x: clip;
|
overflow-x: clip;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
container-type: inline-size;
|
container-type: size;
|
||||||
background-color: var(--bg);
|
background-color: var(--bg);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<div :class="[$style.root, { [$style.withWallpaper]: wallpaper }]">
|
<div :class="[$style.root, { [$style.withWallpaper]: wallpaper }]">
|
||||||
<XSidebar v-if="!isMobile" :class="$style.sidebar"/>
|
<XSidebar v-if="!isMobile" :class="$style.sidebar"/>
|
||||||
|
|
||||||
<MkStickyContainer v-container :class="$style.contents">
|
<MkStickyContainer :class="$style.contents">
|
||||||
<template #header><XStatusBars :class="$style.statusbars"/></template>
|
<template #header><XStatusBars :class="$style.statusbars"/></template>
|
||||||
<main style="min-width: 0;" :style="{ background: pageMetadata?.value?.bg }" @contextmenu.stop="onContextmenu">
|
<main style="min-width: 0;" :style="{ background: pageMetadata?.value?.bg }" @contextmenu.stop="onContextmenu">
|
||||||
<div :class="$style.content" style="container-type: inline-size;">
|
<div :class="$style.content" style="container-type: size;">
|
||||||
<RouterView/>
|
<RouterView/>
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.spacer"></div>
|
<div :class="$style.spacer"></div>
|
||||||
|
|
Loading…
Reference in New Issue