Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ctrl+M now opens/closes sidebar #605

Merged
merged 6 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions EssentialCSharp.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@
<header class="header-background">
<div class="banner d-flex justify-content-between">
<div class="d-flex align-items-center menu-position">
<button class="menu-btn" v-on:click="sidebarShown = !sidebarShown">
<button class="menu-btn sidebar-tooltip" v-on:click="sidebarShown = !sidebarShown">
<i class="fa fa-bars fa-lg icon-light"></i>
<span class="sidebar-tooltip-text">
<b>Navigation</b>
<br />
Or Ctrl + M
</span>
</button>
<div class="d-none d-lg-block">
<ul class="nav align-items-center">
Expand Down Expand Up @@ -302,7 +307,7 @@
<details :open="expandedTocs.has(item.key)"
v-on:toggle="!$event.target.open ? expandedTocs.delete(item.key) : expandedTocs.add(item.key)">
<summary :class="{
'toc-content' : item.level==0,
'toc-content' : item.level= =0,
'nested' : item.level>
0,
'current-section': currentPage.some(p => p.key == item.key),
Expand Down
25 changes: 25 additions & 0 deletions EssentialCSharp.Web/wwwroot/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,31 @@ a:hover {
border-color: transparent transparent var(--grey-lighten-1) transparent;
}

.sidebar-tooltip {
Joshua-Lester3 marked this conversation as resolved.
Show resolved Hide resolved
position: relative;
display: inline-block;
}

.sidebar-tooltip:hover .sidebar-tooltip-text {
transition-delay: 1s;
transition-property: visibility;
visibility: visible;
}

.sidebar-tooltip .sidebar-tooltip-text {
visibility: hidden;
position: absolute;
width: 150px;
color: var(--primary-color);
font-size: 1rem;
background-color: var(--grey-lighten-1);
border-radius: 10px;
padding: 10px;
white-space: normal;
left: 2rem;
bottom: -35px;
}

.nav-link {
color: white;
}
Expand Down
4 changes: 4 additions & 0 deletions EssentialCSharp.Web/wwwroot/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ const app = createApp({
goToPrevious();
}
}

if (e.code == "KeyM" && e.ctrlKey) {
BenjaminMichaelis marked this conversation as resolved.
Show resolved Hide resolved
sidebarShown.value = !sidebarShown.value;
}
});

const sidebarShown = ref(false);
Expand Down
Loading