Skip to content

Commit

Permalink
refactor(components): refactor bottom settings component
Browse files Browse the repository at this point in the history
  • Loading branch information
tks18 committed Jul 24, 2022
1 parent 8208cd9 commit 902d45f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
29 changes: 29 additions & 0 deletions src/components/bottom-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
>
<v-icon>mdi-cog-refresh</v-icon> Settings
</v-btn>
<v-btn
v-if="model == 'fab'"
:class="endofPage ? 'fab-button-bottom' : 'fab-button'"
:bottom="true"
:absolute="true"
:fixed="true"
:right="true"
color="primary"
rounded
fab
v-bind="attrs"
v-on="on"
>
<v-icon>mdi-tune</v-icon>
</v-btn>
</template>
<v-sheet class="pa-8 mt-auto">
<v-row align="start" justify="end">
Expand Down Expand Up @@ -146,6 +161,7 @@ export default {
},
},
data: () => ({
endofPage: false,
activated: false,
colorDiag: false,
blurDiag: false,
Expand All @@ -160,6 +176,7 @@ export default {
],
}),
mounted() {
this.scroll();
const themecache = JSON.parse(localStorage.getItem('themecache'));
if (themecache && themecache != null) {
this.$state.store.botSettings.darkmode = themecache.dark;
Expand Down Expand Up @@ -210,6 +227,18 @@ export default {
}),
);
},
scroll() {
window.onscroll = () => {
if (
window.innerHeight + window.pageYOffset >=
document.body.offsetHeight - 60
) {
this.endofPage = true;
} else {
this.endofPage = false;
}
};
},
},
};
</script>
4 changes: 2 additions & 2 deletions src/styles/common.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.fab-button-bottom {
margin-bottom: 130px;
margin-bottom: 280px;
z-index: 9999;
transition: margin-bottom 0.5s ease-in-out;
}

@media only screen and (min-width: 966px) {
.fab-button-bottom {
margin-bottom: 200px;
margin-bottom: 170px;
z-index: 9999;
transition: margin-bottom 0.5s ease-in-out;
}
Expand Down

0 comments on commit 902d45f

Please sign in to comment.