smoothed out navbar slide (unfinished)
This commit is contained in:
@ -1,16 +1,12 @@
|
||||
<template>
|
||||
<aside
|
||||
:class="['actionbar', darkMode ? 'actionbar-darkmode' : 'actionbar-lightmode', isExpanded ? 'is-expanded' : 'is-not-expanded']">
|
||||
<div :class="['icon', darkMode ? 'indicator-darkmode' : 'indicator-lightmode']" id="indicator-icon"
|
||||
@click="toggleActionbar">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Indicator-Icon-Opened.svg" />
|
||||
<aside :class="['actionbar', darkMode ? 'actionbar-darkmode' : 'actionbar-lightmode', isExpanded ? 'is-expanded' : 'is-not-expanded']">
|
||||
<div :class="['icon', darkMode ? 'indicator-darkmode' : 'indicator-lightmode']" id="indicator-icon" @click="toggleActionbar">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Indicator-Icon-Opened.svg" />
|
||||
</div>
|
||||
<nav class="actions">
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="search">
|
||||
<div class="icon" id="search-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Search-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Search-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Search</pre>
|
||||
@ -18,8 +14,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="filter">
|
||||
<div class="icon" id="filter-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Filter-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Filter-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Filter</pre>
|
||||
@ -27,8 +22,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="instances">
|
||||
<div class="icon" id="instances-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Instances-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Instances-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Instances</pre>
|
||||
@ -36,8 +30,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="attachments">
|
||||
<div class="icon" id="attachments-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Attachments-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Attachments-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Attachments</pre>
|
||||
@ -45,8 +38,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="sell">
|
||||
<div class="icon" id="sell-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Sell-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Sell-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Sell</pre>
|
||||
@ -54,8 +46,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="archive">
|
||||
<div class="icon" id="archive-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Archive-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Archive-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Archive</pre>
|
||||
@ -63,8 +54,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="new">
|
||||
<div class="icon" id="new-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Add-New-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Add-New-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">New</pre>
|
||||
@ -72,8 +62,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="edit" @click="toggleEditable">
|
||||
<div class="icon" id="edit-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Edit-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Edit-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Edit</pre>
|
||||
@ -81,8 +70,7 @@
|
||||
</button>
|
||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="delete" @click="deleteAsset">
|
||||
<div class="icon" id="delete-icon">
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||
src="../icons/actionbar-icons/Delete-Icon.svg" />
|
||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Delete-Icon.svg" />
|
||||
</div>
|
||||
<Transition name="fade">
|
||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Delete</pre>
|
||||
@ -93,8 +81,12 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useStore } from 'vuex';
|
||||
|
||||
const darkMode = ref(true)
|
||||
const isExpanded = ref(true)
|
||||
|
||||
// get accesss to the store
|
||||
const store = useStore()
|
||||
const toggleEditable = () => {
|
||||
@ -103,26 +95,17 @@ const toggleEditable = () => {
|
||||
const deleteAsset = () => {
|
||||
store.commit('doDeleteAsset');
|
||||
};
|
||||
|
||||
const toggleActionbar = () => {
|
||||
isExpanded.value = !isExpanded.value;
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "Actionbar",
|
||||
data() {
|
||||
return {
|
||||
darkMode: true,
|
||||
isExpanded: true,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toggleActionbar() {
|
||||
this.isExpanded = !this.isExpanded;
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -147,37 +130,30 @@ aside.actionbar {
|
||||
justify-content: center;
|
||||
padding: 1.875rem 0.625rem;
|
||||
gap: 1.25rem;
|
||||
transition: all 10s ease-in-out 0s;
|
||||
overflow: clip;
|
||||
}
|
||||
|
||||
.actionbar-darkmode {
|
||||
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||
background-color: #2C2C2C;
|
||||
}
|
||||
|
||||
.actionbar-lightmode {
|
||||
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
aside.is-expanded {
|
||||
animation: expand 0.5s linear both;
|
||||
}
|
||||
|
||||
aside.is-not-expanded {
|
||||
animation: contract 0.5s linear both;
|
||||
width: stretch;
|
||||
inline-size: stretch;
|
||||
}
|
||||
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 1.25rem 0;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding: 1.25rem 0;
|
||||
gap: 1.25rem;
|
||||
overflow: clip;
|
||||
}
|
||||
@ -191,34 +167,21 @@ button {
|
||||
border-radius: 0.625rem;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 0.125rem;
|
||||
border: none;
|
||||
transition: 0.2s ease-in-out;
|
||||
overflow: clip;
|
||||
gap: 0.125rem
|
||||
}
|
||||
.button-darkmode { background-color: #2C2C2C; }
|
||||
.button-lightmode { background-color: #FFFFFF; }
|
||||
|
||||
.button-darkmode {
|
||||
background-color: #2C2C2C;
|
||||
}
|
||||
.button-darkmode:hover,
|
||||
.indicator-darkmode:hover { background-color: #444444; }
|
||||
|
||||
.button-lightmode {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.button-lightmode:hover,
|
||||
.indicator-lightmode:hover { background-color: #ACACAC; }
|
||||
|
||||
.button-darkmode:hover,
|
||||
.indicator-darkmode:hover {
|
||||
background-color: #444444;
|
||||
}
|
||||
|
||||
.button-lightmode:hover,
|
||||
.indicator-lightmode:hover {
|
||||
background-color: #ACACAC;
|
||||
}
|
||||
|
||||
.is-not-expanded>button {
|
||||
align-self: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.is-not-expanded>button { align-self: center; }
|
||||
|
||||
|
||||
.icon {
|
||||
@ -229,7 +192,9 @@ button {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 0.5rem;
|
||||
transition: padding 0.5s linear
|
||||
}
|
||||
.is-not-expanded .icon {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
#indicator-icon {
|
||||
@ -237,16 +202,9 @@ button {
|
||||
height: 1.875rem;
|
||||
border-radius: 0.3125rem;
|
||||
transition: 0.2s ease-in-out;
|
||||
}
|
||||
}
|
||||
.is-not-expanded #indicator-icon { transform: rotate(180deg); }
|
||||
|
||||
.is-not-expanded .icon {
|
||||
align-self: center;
|
||||
padding: 0 0.375rem;
|
||||
}
|
||||
|
||||
.is-not-expanded #indicator-icon {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
img {
|
||||
width: 0.875rem;
|
||||
@ -255,44 +213,31 @@ img {
|
||||
object-position: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#indicator-icon>img {
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
.img-darkmode {
|
||||
filter: invert(100%);
|
||||
}
|
||||
.img-darkmode { filter: invert(100%); }
|
||||
#indicator-icon>img { height: 1.25rem; }
|
||||
|
||||
|
||||
.label {
|
||||
display: inline-flex;
|
||||
min-width: 0;
|
||||
padding: 0rem 0.3125rem 0rem 0rem;
|
||||
letter-spacing: 5%;
|
||||
padding: 0rem 0.625rem 0rem 0rem;
|
||||
align-self: center;
|
||||
letter-spacing: 0.02rem;
|
||||
white-space: nowrap;
|
||||
font: 400 0.875rem/1.25rem Overpass, sans-serif;
|
||||
}
|
||||
|
||||
.label-darkmode {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.label-lightmode {
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
.label-darkmode { color: #FFFFFF; }
|
||||
.label-lightmode { color: #000000; }
|
||||
|
||||
|
||||
.fade-enter-from,
|
||||
.fade-leave-to {
|
||||
|
||||
.fade-enter-from, .fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.fade-enter-to,
|
||||
.fade-leave-from {
|
||||
opacity: 1;
|
||||
max-width: 0;
|
||||
}
|
||||
|
||||
.fade-enter-active {
|
||||
@ -312,8 +257,8 @@ img {
|
||||
|
||||
@keyframes expand {
|
||||
from {
|
||||
max-inline-size: 3.25rem;
|
||||
max-width: 3.25rem;
|
||||
max-inline-size: 3.125rem;
|
||||
max-width: 3.125rem;
|
||||
}
|
||||
|
||||
to {
|
||||
@ -329,8 +274,8 @@ img {
|
||||
}
|
||||
|
||||
to {
|
||||
max-inline-size: 3.25rem;
|
||||
max-width: 3.25rem;
|
||||
max-inline-size: 3.125rem;
|
||||
max-width: 3.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user