diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-04-24 22:38:24 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-24 22:38:24 +0900 |
| commit | fec3c70886c13a267814e7eba5d2dd9aa807687b (patch) | |
| tree | d88fcd2904b964a30a925be6e1b26e1e51ee329d /src/client/components | |
| parent | Tweak UI (diff) | |
| download | sharkey-fec3c70886c13a267814e7eba5d2dd9aa807687b.tar.gz sharkey-fec3c70886c13a267814e7eba5d2dd9aa807687b.tar.bz2 sharkey-fec3c70886c13a267814e7eba5d2dd9aa807687b.zip | |
Gallery (#7194)
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
Diffstat (limited to 'src/client/components')
| -rw-r--r-- | src/client/components/gallery-post-preview.vue | 126 | ||||
| -rw-r--r-- | src/client/components/ui/button.vue | 7 | ||||
| -rw-r--r-- | src/client/components/ui/container.vue | 1 | ||||
| -rw-r--r-- | src/client/components/ui/pagination.vue | 10 |
4 files changed, 137 insertions, 7 deletions
diff --git a/src/client/components/gallery-post-preview.vue b/src/client/components/gallery-post-preview.vue new file mode 100644 index 0000000000..5c3bdb1349 --- /dev/null +++ b/src/client/components/gallery-post-preview.vue @@ -0,0 +1,126 @@ +<template> +<MkA :to="`/gallery/${post.id}`" class="ttasepnz _panel" tabindex="-1"> + <div class="thumbnail"> + <ImgWithBlurhash class="img" :src="post.files[0].thumbnailUrl" :hash="post.files[0].blurhash"/> + </div> + <article> + <header> + <MkAvatar :user="post.user" class="avatar"/> + </header> + <footer> + <span class="title">{{ post.title }}</span> + </footer> + </article> +</MkA> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { userName } from '@client/filters/user'; +import ImgWithBlurhash from '@client/components/img-with-blurhash.vue'; +import * as os from '@client/os'; + +export default defineComponent({ + components: { + ImgWithBlurhash + }, + props: { + post: { + type: Object, + required: true + }, + }, + methods: { + userName + } +}); +</script> + +<style lang="scss" scoped> +.ttasepnz { + display: block; + position: relative; + height: 200px; + + &:hover { + text-decoration: none; + color: var(--accent); + + > .thumbnail { + transform: scale(1.1); + } + + > article { + > footer { + &:before { + opacity: 1; + } + } + } + } + + > .thumbnail { + width: 100%; + height: 100%; + position: absolute; + transition: all 0.5s ease; + + > .img { + width: 100%; + height: 100%; + object-fit: cover; + } + } + + > article { + position: absolute; + z-index: 1; + width: 100%; + height: 100%; + + > header { + position: absolute; + top: 0; + width: 100%; + padding: 12px; + box-sizing: border-box; + display: flex; + + > .avatar { + margin-left: auto; + width: 32px; + height: 32px; + } + } + + > footer { + position: absolute; + bottom: 0; + width: 100%; + padding: 16px; + box-sizing: border-box; + color: #fff; + text-shadow: 0 0 8px #000; + background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); + + &:before { + content: ""; + display: block; + position: absolute; + z-index: -1; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient(rgba(0, 0, 0, 0.4), transparent); + opacity: 0; + transition: opacity 0.5s ease; + } + + > .title { + font-weight: bold; + } + } + } +} +</style> diff --git a/src/client/components/ui/button.vue b/src/client/components/ui/button.vue index 3901e8ae44..c92f30db97 100644 --- a/src/client/components/ui/button.vue +++ b/src/client/components/ui/button.vue @@ -139,7 +139,8 @@ export default defineComponent({ } &.primary { - color: #fff; + font-weight: bold; + color: #fff !important; background: var(--accent); &:not(:disabled):hover { @@ -200,10 +201,6 @@ export default defineComponent({ min-width: 100px; } - &.primary { - font-weight: bold; - } - > .ripples { position: absolute; z-index: 0; diff --git a/src/client/components/ui/container.vue b/src/client/components/ui/container.vue index cfd928518e..2e8eea7132 100644 --- a/src/client/components/ui/container.vue +++ b/src/client/components/ui/container.vue @@ -199,6 +199,7 @@ export default defineComponent({ > .fade { display: block; position: absolute; + z-index: 10; bottom: 0; left: 0; width: 100%; diff --git a/src/client/components/ui/pagination.vue b/src/client/components/ui/pagination.vue index ac8ed01e12..1bd77447b7 100644 --- a/src/client/components/ui/pagination.vue +++ b/src/client/components/ui/pagination.vue @@ -10,8 +10,8 @@ <div v-else class="cxiknjgy"> <slot :items="items"></slot> - <div class="more" v-show="more" key="_more_"> - <MkButton class="button" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary> + <div class="more _gap" v-show="more" key="_more_"> + <MkButton class="button" v-appear="($store.state.enableInfiniteScroll && !disableAutoLoad) ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary> <template v-if="!moreFetching">{{ $ts.loadMore }}</template> <template v-if="moreFetching"><MkLoading inline/></template> </MkButton> @@ -38,6 +38,12 @@ export default defineComponent({ pagination: { required: true }, + + disableAutoLoad: { + type: Boolean, + required: false, + default: false, + } }, }); </script> |