Add bottom fade to show less & hide buttons

This commit is contained in:
Freeplay 2023-05-28 00:17:23 -04:00
parent 8ef68f559c
commit 01de9c0a3b
8 changed files with 34 additions and 2 deletions

View File

@ -104,7 +104,8 @@ defineExpose({
width: 100%; width: 100%;
margin-top: 1em; margin-top: 1em;
position: sticky; position: sticky;
bottom: var(--stickyBottom); bottom: calc(var(--stickyBottom) - 1em);
padding: 20px;
> span { > span {
display: inline-block; display: inline-block;

View File

@ -59,6 +59,7 @@ const props = defineProps<{
transition: all 0.5s ease; transition: all 0.5s ease;
> .img { > .img {
position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;

View File

@ -41,6 +41,8 @@ defineExpose({
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
padding: 20px;
margin-bottom: -10px;
z-index: 5; z-index: 5;
> span { > span {
display: inline-block; display: inline-block;
@ -60,7 +62,9 @@ defineExpose({
width: 100%; width: 100%;
margin-top: 1em; margin-top: 1em;
position: sticky; position: sticky;
bottom: var(--stickyBottom); bottom: calc(var(--stickyBottom) - 1em);
padding: 20px;
z-index: 5;
> span { > span {
display: inline-block; display: inline-block;

View File

@ -151,6 +151,7 @@
<i class="ph-stop ph-bold"></i> {{ i18n.ts._mfm.stop }} <i class="ph-stop ph-bold"></i> {{ i18n.ts._mfm.stop }}
</template> </template>
</MkButton> </MkButton>
<div v-if="(isLong && !collapsed) || (props.note.cw && showContent)" class="fade"></div>
</div> </div>
</template> </template>
@ -371,5 +372,25 @@ function focusFooter(ev) {
margin-left: 0; margin-left: 0;
margin-right: 0.4rem; margin-right: 0.4rem;
} }
> .fade {
position: absolute;
inset: 0;
bottom: -400px;
display: flex;
align-items: flex-end;
z-index: 4;
pointer-events: none;
&::before {
content: "";
display: block;
height: 100px;
position: sticky;
bottom: 0;
width: 100%;
background: var(--panel);
mask: linear-gradient(to top, var(--gradient));
-webkit-mask: linear-gradient(to top, var(--gradient));
}
}
} }
</style> </style>

View File

@ -114,6 +114,7 @@ async function del() {
<style lang="scss" scoped> <style lang="scss" scoped>
.yigymqpb { .yigymqpb {
> .img { > .img {
position: relative;
display: block; display: block;
height: 64px; height: 64px;
margin: 0 auto; margin: 0 auto;

View File

@ -98,6 +98,7 @@ onMounted(() => {
grid-gap: 6px; grid-gap: 6px;
> .img { > .img {
position: relative;
height: 128px; height: 128px;
border-radius: 6px; border-radius: 6px;
overflow: clip; overflow: clip;

View File

@ -102,6 +102,7 @@ const zIndex = os.claimZIndex("high");
border-top: none; border-top: none;
} }
.mk-uploader > ol > li > .img { .mk-uploader > ol > li > .img {
position: relative;
display: block; display: block;
background-size: cover; background-size: cover;
background-position: center center; background-position: center center;

View File

@ -114,6 +114,7 @@ defineExpose<WidgetComponentExpose>({
} }
.img { .img {
position: relative;
border: solid 4px transparent; border: solid 4px transparent;
border-radius: 8px; border-radius: 8px;
} }
@ -126,6 +127,7 @@ defineExpose<WidgetComponentExpose>({
padding: 8px; padding: 8px;
.img { .img {
position: relative;
flex: 1 1 33%; flex: 1 1 33%;
width: 33%; width: 33%;
height: 80px; height: 80px;