aboutsummaryrefslogtreecommitdiff
path: root/build/posts/hamburger-menu-alternative/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'build/posts/hamburger-menu-alternative/index.html')
-rw-r--r--build/posts/hamburger-menu-alternative/index.html138
1 files changed, 138 insertions, 0 deletions
diff --git a/build/posts/hamburger-menu-alternative/index.html b/build/posts/hamburger-menu-alternative/index.html
new file mode 100644
index 0000000..a29b53d
--- /dev/null
+++ b/build/posts/hamburger-menu-alternative/index.html
@@ -0,0 +1,138 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="color-scheme" content="dark light">
+ <link rel="icon" href="data:,">
+ <title>Using Hamburger Menus? Try Sausage Links</title>
+ <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Atom feed for blog posts" />
+ <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="RSS feed for blog posts" />
+<style>*{box-sizing:border-box;}body{font-family:sans-serif;line-height:1.33;margin:0 auto;max-width:650px;padding:1rem;}blockquote{background:rgba(0,0,0,0.1);border-left:4px solid;padding-left:5px;}img{max-width:100%;}pre{border:1px solid;overflow:auto;padding:5px;}table{text-align:left;width:100%;}.footnotes{font-size:90%;}</style>
+</head>
+
+<nav>
+ <a href="#menu">Menu &darr;</a>
+</nav>
+
+<main>
+<h1 id="using-hamburger-menus-try-sausage-links">Using Hamburger Menus? Try Sausage Links</h1>
+<p>2019-06-14</p>
+<p>When designing medium to large sized menu navigations on the mobile web the default go-to, for some time now, has been hamburger menus. This isn&#8217;t necessarily a bad thing, but there is a simpler alternative for certain use cases.</p>
+<p>Before we get into the nitty-gritty details (and a simple demo) of the <em>sausage link</em> concept, let&#8217;s take a quick look at the pros and cons of hamburger menus.</p>
+<h2 id="hamburger-menus">Hamburger Menus</h2>
+<p>The concept of the <a href="https://codepen.io/search/pens?q=hamburger%20menu&amp;page=1&amp;order=popularity&amp;depth=everything">hamburger menu</a> isn&#8217;t <em>horrible</em> by any means, in fact it does solve a lot of problems from a visual perspective. Unfortunately, that doesn&#8217;t mean it exists without some annoying flaws.</p>
+<h3 id="the-good">The Good</h3>
+<ul>
+<li>Minimizes the amount visual space the menu requires</li>
+<li>Fairly commonplace now that a good portion of users understand it&#8217;s functionality</li>
+<li>Makes the lives of designers easier by tucking all items away on mobile 😛</li>
+</ul>
+<h3 id="the-bad">The Bad</h3>
+<ul>
+<li>Requires extra testing&#47;work to ensure the menu will play nice with screen readers and keyboard-only users</li>
+<li>Can get overly complex with the presence of children dropdown elements, help text etc.</li>
+<li>Adds bloat to projects that might require additional JavaScript to render these menus (CSS only hamburger menus avoid this issue)</li>
+<li>Adds an additional point of interaction from the user (click to open, then proceed to read through available options)</li>
+</ul>
+<p>As you can see, the bad points listed above aren&#8217;t <em>that</em> bad. I see them more as minor potholes along the UX journey for your end-users. A good portion of hamburger menu examples in the wild work perfectly fine and should remain as they are. However, those outliers who abuse or misuse the hamburger concept should be introduced to <strong>sausage links</strong>.</p>
+<h2 id="sausage-links">Sausage Links</h2>
+<p>I should start by mentioning that this concept is far from <strong>new</strong>. There are a good number of websites that already implement this menu type in some form or another. The point of this post isn&#8217;t to blow your mind with some new-never-thought-of navigation design. I&#8217;m just trying to bring awareness to another available menu concept.</p>
+<p>Enough chit-chat, let&#8217;s take a look at sausage links in action:</p>
+<p><img src="/public/images/scrolling-navigation.png" alt="Scrolling menu with sausage links" /></p>
+<p><a href="https://codepen.io/bradleytaunt/pen/QXjjbE/">Live CodePen Example</a></p>
+<p>The above CodePen adds a good amount of visual design fluff, so let&#8217;s take a look at the bare minimum HTML &#38; CSS needed to accomplish this menu:</p>
+<pre><code>&#60;nav class="sausage-links"&#62;
+ &#60;ul&#62;
+ &#60;li&#62;&#60;a href=""&#62;Homepage&#60;&#47;a&#62;&#60;&#47;li&#62;
+ &#60;li&#62;&#60;a href=""&#62;Categories&#60;&#47;a&#62;&#60;&#47;li&#62;
+ &#60;li&#62;&#60;a href=""&#62;Filter Properties&#60;&#47;a&#62;&#60;&#47;li&#62;
+ &#60;li&#62;&#60;a href=""&#62;Edit Optional Tags&#60;&#47;a&#62;&#60;&#47;li&#62;
+ &#60;li&#62;&#60;a href=""&#62;Research Papers&#60;&#47;a&#62;&#60;&#47;li&#62;
+ &#60;li&#62;&#60;a href=""&#62;Contact Our Team&#60;&#47;a&#62;&#60;&#47;li&#62;
+ &#60;&#47;ul&#62;
+&#60;&#47;nav&#62;
+
+
+
+&#47;* Sausage Links Nav Container *&#47;
+.sausage-links {
+ position: relative;
+}
+
+&#47;* The left and right "faded" pseudo elements *&#47;
+.sausage-links:before, .sausage-links:after {
+ content: &#39;&#39;;
+ height: calc(100% - 2em);
+ pointer-events: none;
+ position: absolute;
+ top: 1em;
+ width: 10px;
+ z-index: 2;
+}
+.sausage-links:before {
+ background: linear-gradient(to right, rgba(255,255,255,0) 0%, white 100%);
+ right: 0;
+}
+.sausage-links:after {
+ background: linear-gradient(to left, rgba(255,255,255,0) 0%, white 100%);
+ left: 0;
+}
+
+&#47;* Basic flexbox to prevent items from breaking lines *&#47;
+.sausage-links ul {
+ display: flex;
+ flex-wrap: nowrap;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+.sausage-links ul li {
+ white-space: nowrap;
+}
+
+.sausage-links ul li a, .sausage-links ul li a:visited {
+ display: inline-block;
+}
+</code></pre>
+<p>Pretty simple, eh?</p>
+<p><strong>Update</strong>: Thanks to <a href="https://twitter.com/dany0w">@dany0w</a> for pointing out that I forgot to include <code>-webkit-overflow-scrolling: touch</code> for momentum scrolling on iOS.</p>
+<h3 id="the-good-1">The Good</h3>
+<ul>
+<li>Extremely minimal amount of CSS required</li>
+<li>Screen reader &#47; keyboard-only safe</li>
+<li>Zero JavaScript needed</li>
+<li>No need for hacky hidden <code>radio</code> inputs for toggling parent containers etc.</li>
+<li>Users can see first few available options without any interaction</li>
+</ul>
+<h3 id="the-bad-1">The Bad</h3>
+<ul>
+<li>May not look the most visually appealing for certain project designs (ugly scrollbar in some instances)</li>
+<li>Better suited for small to medium menu lists compared to massive sitemaps</li>
+<li>Without proper fade &#47; cut off visual cues, users may not understand they can scroll</li>
+</ul>
+<h2 id="so-should-i-use-hamburger-menus-or-sausage-links">So, should I use hamburger menus or sausage links?</h2>
+<p>That really depends on your project or overall mobile design (I know, such a helpful answer). I&#8217;m sure there are even a few use cases where it would make sense to have sausage links within a toggle-based hamburger menu. The menu possibilities could be endless!</p>
+<p>That&#8217;s it. I hope I&#8217;ve inspired you to try out sausage links in the near future or at least made you think more deeply about mobile navigation design!</p>
+<p>&#8230;is anyone else really hungry now?</p>
+<footer role="contentinfo">
+ <h2>Menu Navigation</h2>
+ <ul id="menu">
+ <li><a href="/">Home</a></li>
+ <li><a href="/projects">Projects</a></li>
+ <li><a href="/uses">Uses</a></li>
+ <li><a href="/wiki">Wiki</a></li>
+ <li><a href="/resume">Resume</a></li>
+ <li><a href="/colophon">Colophon</a></li>
+ <li><a href="/now">Now</a></li>
+ <li><a href="/donate">Donate</a></li>
+ <li><a href="/atom.xml">RSS</a></li>
+ <li><a href="#top">&uarr; Top of the page</a></li>
+ </ul>
+ <small>
+ Built with <a href="https://git.sr.ht/~bt/barf">barf</a>. <br>
+ Maintained with ♥ for the web. <br>
+ Proud supporter of <a href="https://usefathom.com/ref/DKHJVX">Fathom</a> &amp; <a href="https://nextdns.io/?from=74d3p3h8">NextDNS</a>. <br>
+ The content for this site is <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>.<br> The <a href="https://git.sr.ht/~bt/bt.ht">code for this site</a> is <a href="https://git.sr.ht/~bt/bt.ht/tree/master/item/LICENSE">MIT</a>.
+ </small>
+</footer> \ No newline at end of file