2023-07-27 14:31:52 +09:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-01-09 20:23:06 +09:00
|
|
|
<template>
|
|
|
|
<div class="_panel">
|
|
|
|
<div :class="$style.container" :style="{ backgroundImage: $i.bannerUrl ? `url(${ $i.bannerUrl })` : null }">
|
|
|
|
<div :class="$style.avatarContainer">
|
2023-01-16 14:18:11 +09:00
|
|
|
<MkAvatar :class="$style.avatar" :user="$i"/>
|
2023-01-09 20:23:06 +09:00
|
|
|
</div>
|
|
|
|
<div :class="$style.bodyContainer">
|
|
|
|
<div :class="$style.body">
|
2023-02-08 20:07:19 +09:00
|
|
|
<MkA :class="$style.name" :to="userPage($i)">
|
|
|
|
<MkUserName :user="$i"/>
|
|
|
|
</MkA>
|
2023-01-09 20:23:06 +09:00
|
|
|
<div :class="$style.username"><MkAcct :user="$i" detail/></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-21 11:36:45 +09:00
|
|
|
import { useWidgetPropsManager, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js';
|
2023-09-19 16:37:43 +09:00
|
|
|
import { GetFormResultType } from '@/scripts/form.js';
|
|
|
|
import { $i } from '@/account.js';
|
|
|
|
import { userPage } from '@/filters/user.js';
|
2023-01-09 20:23:06 +09:00
|
|
|
|
|
|
|
const name = 'profile';
|
|
|
|
|
|
|
|
const widgetPropsDef = {
|
|
|
|
};
|
|
|
|
|
|
|
|
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
|
|
|
|
|
2023-05-19 16:20:53 +09:00
|
|
|
const props = defineProps<WidgetComponentProps<WidgetProps>>();
|
|
|
|
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
|
2023-01-09 20:23:06 +09:00
|
|
|
|
|
|
|
const { widgetProps, configure } = useWidgetPropsManager(name,
|
|
|
|
widgetPropsDef,
|
|
|
|
props,
|
|
|
|
emit,
|
|
|
|
);
|
|
|
|
|
|
|
|
defineExpose<WidgetComponentExpose>({
|
|
|
|
name,
|
|
|
|
configure,
|
|
|
|
id: props.widget ? props.widget.id : null,
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.container {
|
|
|
|
position: relative;
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatarContainer {
|
|
|
|
display: inline-block;
|
|
|
|
text-align: center;
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
display: inline-block;
|
|
|
|
width: 60px;
|
|
|
|
height: 60px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border: solid 3px #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.bodyContainer {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
min-width: 0;
|
|
|
|
padding: 0 16px 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.body {
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: clip;
|
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
color: #fff;
|
|
|
|
filter: drop-shadow(0 0 4px #000);
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.username {
|
|
|
|
color: #fff;
|
|
|
|
filter: drop-shadow(0 0 4px #000);
|
|
|
|
}
|
|
|
|
</style>
|