refactor
This commit is contained in:
parent
1de774fa3d
commit
d2eec3a9e4
|
@ -1,16 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-show="props.modelValue.length != 0" class="skeikyzd">
|
<div v-show="props.modelValue.length != 0" :class="$style.root">
|
||||||
<Sortable :modelValue="props.modelValue" class="files" itemKey="id" :animation="150" :delay="100" :delayOnTouchOnly="true" @update:modelValue="v => emit('update:modelValue', v)">
|
<Sortable :modelValue="props.modelValue" :class="$style.files" itemKey="id" :animation="150" :delay="100" :delayOnTouchOnly="true" @update:modelValue="v => emit('update:modelValue', v)">
|
||||||
<template #item="{element}">
|
<template #item="{element}">
|
||||||
<div class="file" @click="showFileMenu(element, $event)" @contextmenu.prevent="showFileMenu(element, $event)">
|
<div :class="$style.file" @click="showFileMenu(element, $event)" @contextmenu.prevent="showFileMenu(element, $event)">
|
||||||
<MkDriveFileThumbnail :data-id="element.id" class="thumbnail" :file="element" fit="cover"/>
|
<MkDriveFileThumbnail :data-id="element.id" :class="$style.thumbnail" :file="element" fit="cover"/>
|
||||||
<div v-if="element.isSensitive" class="sensitive">
|
<div v-if="element.isSensitive" :class="$style.sensitive">
|
||||||
<i class="ti ti-alert-triangle icon"></i>
|
<i class="ti ti-alert-triangle" style="margin: auto;"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Sortable>
|
</Sortable>
|
||||||
<p class="remain">{{ 16 - props.modelValue.length }}/16</p>
|
<p :class="$style.remain">{{ 16 - props.modelValue.length }}/16</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -108,60 +108,53 @@ function showFileMenu(file, ev: MouseEvent) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" module>
|
||||||
.skeikyzd {
|
.root {
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
> .files {
|
.files {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
> .file {
|
.file {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 64px;
|
width: 64px;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover > .remove {
|
.thumbnail {
|
||||||
display: block;
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
color: var(--fg);
|
||||||
|
}
|
||||||
|
|
||||||
> .thumbnail {
|
.sensitive {
|
||||||
width: 100%;
|
display: flex;
|
||||||
height: 100%;
|
position: absolute;
|
||||||
z-index: 1;
|
width: 64px;
|
||||||
color: var(--fg);
|
height: 64px;
|
||||||
}
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 2;
|
||||||
|
background: rgba(17, 17, 17, .7);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
> .sensitive {
|
.remain {
|
||||||
display: flex;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 64px;
|
top: 8px;
|
||||||
height: 64px;
|
right: 8px;
|
||||||
top: 0;
|
margin: 0;
|
||||||
left: 0;
|
padding: 0;
|
||||||
z-index: 2;
|
font-size: 90%;
|
||||||
background: rgba(17, 17, 17, .7);
|
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
> .icon {
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .remain {
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 8px;
|
|
||||||
right: 8px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -72,7 +72,3 @@ defineExpose<WidgetComponentExpose>({
|
||||||
id: props.widget ? props.widget.id : null,
|
id: props.widget ? props.widget.id : null,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div data-cy-mkw-onlineUsers class="mkw-onlineUsers" :class="{ _panel: !widgetProps.transparent, pad: !widgetProps.transparent }">
|
<div data-cy-mkw-onlineUsers :class="[$style.root, { _panel: !widgetProps.transparent, [$style.pad]: !widgetProps.transparent }]">
|
||||||
<I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" textTag="span" class="text">
|
<span :class="$style.text">
|
||||||
<template #n><b>{{ number(onlineUsersCount) }}</b></template>
|
<I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" textTag="span">
|
||||||
</I18n>
|
<template #n><b style="color: #41b781;">{{ number(onlineUsersCount) }}</b></template>
|
||||||
|
</I18n>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -55,22 +57,16 @@ defineExpose<WidgetComponentExpose>({
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" module>
|
||||||
.mkw-onlineUsers {
|
.root {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
&.pad {
|
&.pad {
|
||||||
padding: 16px 0;
|
padding: 16px 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
> .text {
|
.text {
|
||||||
::v-deep(b) {
|
color: var(--fgTransparentWeak);
|
||||||
color: #41b781;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep(span) {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue