Update Menu component: update style, add nav details for projects and footer, use div instead of aside
This commit is contained in:
parent
6c14c929fc
commit
e0242ead0f
1 changed files with 198 additions and 97 deletions
|
|
@ -5,86 +5,150 @@
|
|||
<path d="M10.6751 2.625L3.00007 10.3125C2.94028 10.3686 2.89263 10.4364 2.86005 10.5116C2.82748 10.5869 2.81067 10.668 2.81067 10.75C2.81067 10.832 2.82748 10.9131 2.86005 10.9884C2.89263 11.0636 2.94028 11.1314 3.00007 11.1875L10.6751 18.875M17.1876 2.625L9.50007 10.3125C9.38555 10.4293 9.32141 10.5864 9.32141 10.75C9.32141 10.9136 9.38555 11.0707 9.50007 11.1875L17.1876 18.875" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
<aside v-if="isExpanded" id="menu" class="flex | rounded-lg">
|
||||
<header class="flex">
|
||||
<div v-if="isExpanded" id="menu" class="flex | rounded-lg">
|
||||
<header class="w-full | flex">
|
||||
<h2>Nom du service</h2>
|
||||
</header>
|
||||
<nav>
|
||||
<nav class="w-full | flow">
|
||||
<ul class="flex">
|
||||
<li data-icon="home">
|
||||
<a aria-current="page">Home</a>
|
||||
<li data-icon="home" class="active">
|
||||
<a href="#" aria-current="page">Home</a>
|
||||
</li>
|
||||
<li data-icon="megaphone" data-count="4">
|
||||
<a>Notifications</a>
|
||||
<a href="#">Notifications</a>
|
||||
</li>
|
||||
<li data-icon="calendar">
|
||||
<a>Réunions</a>
|
||||
<a href="#">Réunions</a>
|
||||
<span class="pill pill--secondary">Dans 2h</span>
|
||||
</li>
|
||||
<li data-icon="inspiration">
|
||||
<a>Inspirations</a>
|
||||
<a href="#">Inspirations</a>
|
||||
<span class="pill pill--secondary">Nouveauté</span>
|
||||
</li>
|
||||
</ul>
|
||||
<details open>
|
||||
<summary>Projets en cours</summary>
|
||||
<ul>
|
||||
<li><a href="#" class="new">Miss Dior Blooming Bouquet</a></li>
|
||||
<li><a href="#">Dior J’adore</a></li>
|
||||
<li><a href="#">Gris Dior</a></li>
|
||||
<li><a href="#">Sauvage 60ml</a></li>
|
||||
</ul>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Projets archivés</summary>
|
||||
<ul>
|
||||
<li><a href="#">Titre projet archivé 1</a></li>
|
||||
<li><a href="#">Titre projet archivé 2</a></li>
|
||||
</ul>
|
||||
</details>
|
||||
</nav>
|
||||
</aside>
|
||||
<footer class="w-full">
|
||||
<ul class="flex">
|
||||
<li data-icon="user">
|
||||
<a href="#">Profil</a>
|
||||
</li>
|
||||
<li data-icon="logout">
|
||||
<a href="#">Déconnexion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
button[aria-controls="menu"] {
|
||||
position: fixed;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
top: 48px;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
}
|
||||
button[aria-controls="menu"] svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
button[aria-controls="menu"][aria-expanded="true"] {
|
||||
padding: 10px;
|
||||
left: calc(var(--sidebar-width) - var(--space-xl));
|
||||
margin-top: 1rem;
|
||||
padding: 0.625rem; /* 10px */
|
||||
left: var(--gutter);
|
||||
transform: translateX(calc(var(--sidebar-width) - 100% - 1rem));
|
||||
}
|
||||
button[aria-controls="menu"][aria-expanded="false"] {
|
||||
top: var(--gutter);
|
||||
padding: 18px;
|
||||
width: 3.75rem;
|
||||
height: 3.75rem;
|
||||
padding: 1.25rem;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* Menu */
|
||||
|
||||
#menu {
|
||||
--flow-space: var(--space-2xl);
|
||||
--flow-space: var(--space-32);
|
||||
--direction: column;
|
||||
--items: flex-start;
|
||||
--wrap: no-wrap;
|
||||
width: var(--sidebar-width);
|
||||
height: calc(100vh - var(--gutter) * 2);
|
||||
height: calc(100dvh - var(--gutter) * 2);
|
||||
padding: var(--gap);
|
||||
background: var(--color-background);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#menu [data-icon]::before {
|
||||
background-color: var(--color-grey-700);
|
||||
}
|
||||
|
||||
#menu header {
|
||||
--justify: center;
|
||||
padding-left: var(--gap);
|
||||
height: 40px;
|
||||
min-height: var(--space-40);
|
||||
font-family: var(--font-serif);
|
||||
font-size: var(--text-lg);
|
||||
background: var(--color-background);
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
#menu header::before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: -1rem;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -2rem;
|
||||
background: linear-gradient(to bottom, var(--color-background) 0%, var(--color-background) 75%, transparent 100%);
|
||||
}
|
||||
|
||||
#menu nav {
|
||||
width: 100%;
|
||||
--flow-space: var(--space-32);
|
||||
flex: 1 1 0%;
|
||||
}
|
||||
|
||||
#menu ul {
|
||||
--direction: column;
|
||||
--items: flex-start;
|
||||
--row-gap: var(--space-xs);
|
||||
--row-gap: var(--space-4);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#menu li {
|
||||
#menu li,
|
||||
#menu summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 2.5rem; /* 40px */
|
||||
max-height: 2.75rem; /* 44px */
|
||||
padding: 0 var(--space-lg);
|
||||
gap: var(--space-md);
|
||||
padding: 0 var(--space-16);
|
||||
gap: var(--space-12);
|
||||
border-radius: var(--rounded-md);
|
||||
}
|
||||
|
||||
#menu li {
|
||||
position: relative;
|
||||
min-height: 2.75rem; /* 44px */
|
||||
}
|
||||
|
||||
#menu li[data-count]::after {
|
||||
|
|
@ -100,9 +164,46 @@
|
|||
margin-left: auto;
|
||||
}
|
||||
|
||||
#menu .active {
|
||||
#menu li a::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#menu .active,
|
||||
#menu li:hover {
|
||||
background-color: var(--color-grey-50);
|
||||
}
|
||||
|
||||
#menu details {
|
||||
font-family: var(--font-serif);
|
||||
background-size: 1px 21px;
|
||||
background-image: repeating-linear-gradient(0deg, var(--color-grey-50), var(--color-grey-50) 1px, transparent 1px, transparent);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
#menu details > summary {
|
||||
font-family: var(--font-sans);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 500;
|
||||
color: var(--color-grey-700);
|
||||
background-color: var(--color-background);
|
||||
width: fit-content;
|
||||
}
|
||||
#menu details .new::after {
|
||||
content: 'Nouvelles modifications';
|
||||
color: transparent;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: .375rem; /* 6px */
|
||||
height: .375rem; /* 6px */
|
||||
border-radius: var(--rounded-full);
|
||||
background-color: var(--color-primary-100);
|
||||
margin-left: var(--space-8);
|
||||
transform: translateY(-0.1em);
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script setup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue