From 7ca373b020062a6bc569476b44003c60f62b6148 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 16 Feb 2019 14:43:41 -0500 Subject: [PATCH] Add Other dropdown menu --- site/css/main.scss | 59 ++++++++++++++++++++++++++++++++++- site/layouts/default.html.ejs | 11 +++++-- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/site/css/main.scss b/site/css/main.scss index 33e75d0..4706e3a 100644 --- a/site/css/main.scss +++ b/site/css/main.scss @@ -237,13 +237,70 @@ figure { .site-nav ul { padding: 0; margin: 0; + display: inline-block; + position: relative; li { list-style: none; display: inline; - margin-right: 1em; font-variant: small-caps; font-weight: bold; + + &:not(:last-child) { + margin-right: 1em; + } + + a.dropdown-link { + color: black; + text-decoration: none; + + .arrow-down { + display: inline-block; + width: 0.5em; + height: 0.5em; + margin-bottom: 2px; + margin-left: 2px; + border-bottom: 2px solid var(--ui-text-color); + border-right: 2px solid var(--ui-text-color); + transform: rotate(45deg); + } + } + + ul { + visibility: hidden; + opacity: 0; + min-width: 5rem; + position: absolute; + transition: all 0.5s ease; + right: -1em; + display: none; + padding: 1em; + background-color: white; + box-shadow: 0 10px 15px -5px var(--shadow-color), // bottom + 10px 0 15px -5px var(--shadow-color), // right + -10px 0 15px -5px var(--shadow-color); // left + z-index: 10; + + li { + width: 100%; + display: block; + margin-right: 0px; + text-align: right; + + &:not(:last-child) { + margin-bottom: 1em; + } + } + } + + &:hover > ul, + &:focus-within > ul, + ul:hover, + ul:focus { + visibility: visible; + opacity: 1; + display: block; + } } } diff --git a/site/layouts/default.html.ejs b/site/layouts/default.html.ejs index 5ae0d6a..d1b5458 100644 --- a/site/layouts/default.html.ejs +++ b/site/layouts/default.html.ejs @@ -50,10 +50,17 @@

The outper part of a shadow is called the penumbra.