refactor
This commit is contained in:
parent
bdf08c8a54
commit
1c57983bfd
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div ref="rootEl" class="meijqfqm">
|
||||
<canvas :id="idForCanvas" ref="canvasEl" class="canvas" :width="width" height="300" @contextmenu.prevent="() => {}"></canvas>
|
||||
<div :id="idForTags" ref="tagsEl" class="tags">
|
||||
<div ref="rootEl" :class="$style.root">
|
||||
<canvas :id="idForCanvas" ref="canvasEl" style="display: block;" :width="width" height="300" @contextmenu.prevent="() => {}"></canvas>
|
||||
<div :id="idForTags" ref="tagsEl" :class="$style.tags">
|
||||
<ul>
|
||||
<slot></slot>
|
||||
</ul>
|
||||
@ -70,21 +70,17 @@ defineExpose({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.meijqfqm {
|
||||
<style lang="scss" module>
|
||||
.root {
|
||||
position: relative;
|
||||
overflow: clip;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
|
||||
> .canvas {
|
||||
display: block;
|
||||
}
|
||||
|
||||
> .tags {
|
||||
.tags {
|
||||
position: absolute;
|
||||
top: 999px;
|
||||
left: 999px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="adhpbeou">
|
||||
<div class="label" @click="focus"><slot name="label"></slot></div>
|
||||
<div class="content">
|
||||
<div>
|
||||
<div :class="$style.label" @click="focus"><slot name="label"></slot></div>
|
||||
<div :class="$style.content">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div class="caption"><slot name="caption"></slot></div>
|
||||
<div :class="$style.caption"><slot name="caption"></slot></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -16,9 +16,8 @@ function focus() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.adhpbeou {
|
||||
> .label {
|
||||
<style lang="scss" module>
|
||||
.label {
|
||||
font-size: 0.85em;
|
||||
padding: 0 0 8px 0;
|
||||
user-select: none;
|
||||
@ -28,7 +27,7 @@ function focus() {
|
||||
}
|
||||
}
|
||||
|
||||
> .caption {
|
||||
.caption {
|
||||
font-size: 0.85em;
|
||||
padding: 8px 0 0 0;
|
||||
color: var(--fgTransparentWeak);
|
||||
@ -37,5 +36,4 @@ function focus() {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -2,22 +2,28 @@
|
||||
<MkStickyContainer>
|
||||
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
|
||||
<MkSpacer :contentMax="700">
|
||||
<div v-if="tab === 'featured'" class="rknalgpo">
|
||||
<div v-if="tab === 'featured'">
|
||||
<MkPagination v-slot="{items}" :pagination="featuredPagesPagination">
|
||||
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
||||
<div class="_gaps">
|
||||
<MkPagePreview v-for="page in items" :key="page.id" :page="page"/>
|
||||
</div>
|
||||
</MkPagination>
|
||||
</div>
|
||||
|
||||
<div v-else-if="tab === 'my'" class="rknalgpo my">
|
||||
<div v-else-if="tab === 'my'" class="_gaps">
|
||||
<MkButton class="new" @click="create()"><i class="ti ti-plus"></i></MkButton>
|
||||
<MkPagination v-slot="{items}" :pagination="myPagesPagination">
|
||||
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
||||
<div class="_gaps">
|
||||
<MkPagePreview v-for="page in items" :key="page.id" :page="page"/>
|
||||
</div>
|
||||
</MkPagination>
|
||||
</div>
|
||||
|
||||
<div v-else-if="tab === 'liked'" class="rknalgpo">
|
||||
<div v-else-if="tab === 'liked'">
|
||||
<MkPagination v-slot="{items}" :pagination="likedPagesPagination">
|
||||
<MkPagePreview v-for="like in items" :key="like.page.id" class="ckltabjg" :page="like.page"/>
|
||||
<div class="_gaps">
|
||||
<MkPagePreview v-for="like in items" :key="like.page.id" :page="like.page"/>
|
||||
</div>
|
||||
</MkPagination>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
@ -79,21 +85,3 @@ definePageMetadata(computed(() => ({
|
||||
icon: 'ti ti-note',
|
||||
})));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rknalgpo {
|
||||
&.my .ckltabjg:first-child {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.ckltabjg:not(:last-child) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
@media (min-width: 500px) {
|
||||
.ckltabjg:not(:last-child) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -9,11 +9,11 @@
|
||||
</template>
|
||||
<template #default="{items}">
|
||||
<div class="_gaps">
|
||||
<div v-for="token in items" :key="token.id" class="_panel bfomjevm">
|
||||
<img v-if="token.iconUrl" class="icon" :src="token.iconUrl" alt=""/>
|
||||
<div class="body">
|
||||
<div class="name">{{ token.name }}</div>
|
||||
<div class="description">{{ token.description }}</div>
|
||||
<div v-for="token in items" :key="token.id" class="_panel" :class="$style.app">
|
||||
<img v-if="token.iconUrl" :class="$style.appIcon" :src="token.iconUrl" alt=""/>
|
||||
<div :class="$style.appBody">
|
||||
<div :class="$style.appName">{{ token.name }}</div>
|
||||
<div>{{ token.description }}</div>
|
||||
<MkKeyValue oneline>
|
||||
<template #key>{{ i18n.ts.installedDate }}</template>
|
||||
<template #value><MkTime :time="token.createdAt"/></template>
|
||||
@ -28,7 +28,7 @@
|
||||
<li v-for="p in token.permission" :key="p">{{ i18n.t(`_permissions.${p}`) }}</li>
|
||||
</ul>
|
||||
</details>
|
||||
<div class="actions">
|
||||
<div>
|
||||
<MkButton inline danger @click="revoke(token)"><i class="ti ti-trash"></i></MkButton>
|
||||
</div>
|
||||
</div>
|
||||
@ -75,12 +75,13 @@ definePageMetadata({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bfomjevm {
|
||||
<style lang="scss" module>
|
||||
.app {
|
||||
display: flex;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
> .icon {
|
||||
.appIcon {
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
margin: 0 12px 0 0;
|
||||
@ -89,13 +90,12 @@ definePageMetadata({
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
> .body {
|
||||
.appBody {
|
||||
width: calc(100% - 62px);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
> .name {
|
||||
.appName {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -34,7 +34,3 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
|
@ -56,6 +56,3 @@ definePageMetadata(computed(() => user ? {
|
||||
avatar: user,
|
||||
} : null));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
|
@ -56,6 +56,3 @@ definePageMetadata(computed(() => user ? {
|
||||
avatar: user,
|
||||
} : null));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
|
@ -2,7 +2,6 @@
|
||||
<MkStickyContainer>
|
||||
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
|
||||
<div>
|
||||
<Transition name="fade" mode="out-in">
|
||||
<div v-if="user">
|
||||
<XHome v-if="tab === 'home'" :user="user"/>
|
||||
<XTimeline v-else-if="tab === 'notes'" :user="user"/>
|
||||
@ -16,7 +15,6 @@
|
||||
</div>
|
||||
<MkError v-else-if="error" @retry="fetchUser()"/>
|
||||
<MkLoading v-else/>
|
||||
</Transition>
|
||||
</div>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
@ -118,14 +116,3 @@ definePageMetadata(computed(() => user ? {
|
||||
},
|
||||
} : null));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: opacity 0.125s ease;
|
||||
}
|
||||
.fade-enter-from,
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<MkContainer :naked="widgetProps.transparent" :showHeader="false" data-cy-mkw-clock class="mkw-clock">
|
||||
<div class="vubelbmv" :class="widgetProps.size">
|
||||
<div v-if="widgetProps.label === 'tz' || widgetProps.label === 'timeAndTz'" class="_monospace label a abbrev">{{ tzAbbrev }}</div>
|
||||
<MkContainer :naked="widgetProps.transparent" :showHeader="false" data-cy-mkw-clock>
|
||||
<div :class="[$style.root, $style[widgetProps.size]]">
|
||||
<div v-if="widgetProps.label === 'tz' || widgetProps.label === 'timeAndTz'" class="_monospace" :class="[$style.label, $style.a]">{{ tzAbbrev }}</div>
|
||||
<MkAnalogClock
|
||||
class="clock"
|
||||
:class="$style.clock"
|
||||
:thickness="widgetProps.thickness"
|
||||
:offset="tzOffset"
|
||||
:graduations="widgetProps.graduations"
|
||||
@ -11,8 +11,8 @@
|
||||
:twentyfour="widgetProps.twentyFour"
|
||||
:sAnimation="widgetProps.sAnimation"
|
||||
/>
|
||||
<MkDigitalClock v-if="widgetProps.label === 'time' || widgetProps.label === 'timeAndTz'" class="_monospace label c time" :showS="false" :offset="tzOffset"/>
|
||||
<div v-if="widgetProps.label === 'tz' || widgetProps.label === 'timeAndTz'" class="_monospace label d offset">{{ tzOffsetLabel }}</div>
|
||||
<MkDigitalClock v-if="widgetProps.label === 'time' || widgetProps.label === 'timeAndTz'" :class="[$style.label, $style.c]" class="_monospace" :showS="false" :offset="tzOffset"/>
|
||||
<div v-if="widgetProps.label === 'tz' || widgetProps.label === 'timeAndTz'" class="_monospace" :class="[$style.label, $style.d]">{{ tzOffsetLabel }}</div>
|
||||
</div>
|
||||
</MkContainer>
|
||||
</template>
|
||||
@ -140,39 +140,10 @@ defineExpose<WidgetComponentExpose>({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.vubelbmv {
|
||||
<style lang="scss" module>
|
||||
.root {
|
||||
position: relative;
|
||||
|
||||
> .label {
|
||||
position: absolute;
|
||||
opacity: 0.7;
|
||||
|
||||
&.a {
|
||||
top: 14px;
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
&.b {
|
||||
top: 14px;
|
||||
right: 14px;
|
||||
}
|
||||
|
||||
&.c {
|
||||
bottom: 14px;
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
&.d {
|
||||
bottom: 14px;
|
||||
right: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
> .clock {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
&.small {
|
||||
padding: 12px;
|
||||
|
||||
@ -197,4 +168,33 @@ defineExpose<WidgetComponentExpose>({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
opacity: 0.7;
|
||||
|
||||
&.a {
|
||||
top: 14px;
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
&.b {
|
||||
top: 14px;
|
||||
right: 14px;
|
||||
}
|
||||
|
||||
&.c {
|
||||
bottom: 14px;
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
&.d {
|
||||
bottom: 14px;
|
||||
right: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.clock {
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user