{"id":43949,"date":"2018-09-09T01:25:01","date_gmt":"2018-09-09T05:25:01","guid":{"rendered":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=43949"},"modified":"2018-09-09T03:24:48","modified_gmt":"2018-09-09T07:24:48","slug":"more-theme-changes-are-you-kidding-me","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=43949","title":{"rendered":"MORE Theme Changes? Are You KIDDING Me?"},"content":{"rendered":"<p>The nightmare of fussing continues. To be totally honest, this is kind of fun. I could do this forever, except I know that having a consistent experience is important and I know how disorienting it is when you show up to a previously familiar site to find everything has been moved around. So I need to stop messing around with the site because I don&#8217;t want to drive everyone crazy. At the same time, I really want to see the results of just one more round of changes. Maybe two. Possibly two. We&#8217;ll see.<\/p>\n<p>What&#8217;s new?<\/p>\n<ol>\n<li>The main menu has been moved to the right. I&#8217;ll talk more about that below.\n<li>Fixed some instances where a comment and its direct reply might end up being nearly the same color.\n<li>Regardless of whether it eventually winds up on the right, the left, or the top, the menu is now more compact.\n<\/ol>\n<p>Some people say they dislike the left-menu because it feels wrong or alien. Apparently left-to-right reading habits have them scanning over the useless (to them) sidebar every time they visit the site. So let&#8217;s put the menu on the right and see what happens. As before, I&#8217;m adopting a &#8220;Squeaky wheel&#8221; approach to design, so if you love something and don&#8217;t want to see it changed then you need to speak up.<\/p>\n<p>So let&#8217;s talk about this main menu some more&#8230; <!--more--><\/p>\n<p>Given: We need the main menu. People don&#8217;t need it often, but when they <em>do<\/em> need it, they <em>really<\/em> need it. The main menu is mostly for newcomers, which means we can&#8217;t hide it away in a rollout bar of some sort. Longtime readers will be able to find it, but the people who need it most (newcomers) will have trouble. That&#8217;s no good. Also, the menu is that one place where you get the all-important &#8220;Return to the front page&#8221; link, and that needs to be easily available.<\/p>\n<p>These are the places where we can put this menu:<\/p>\n<table class=\"\" border=\"1\" bordercolor=\"#cccccc\" cellspacing=\"0\" cellpadding=\"5\">\n<tr>\n<th>Location<\/th>\n<th>Advantage<\/th>\n<th>Drawback<\/th>\n<\/tr>\n<tr>\n<td>Menu on Top<\/td>\n<td>The main menu takes up very little screen space. When the user scrolls down, the menu is gone and their display is entirely focused on the text.<\/td>\n<td>Once you scroll down, you lose access to the &#8220;return to homepage&#8221; link. Worse, on desktop displays you end up with VAST fields of wasted space on either side of the text.<\/td>\n<\/tr>\n<tr>\n<td>Menu Left<\/td>\n<td>The &#8220;Home&#8221; link is always visible, and the menu now occupies that empty space that was wasted on desktops.<\/td>\n<td>This puts the main text slightly off-center, which apparently drives some people nuts. It also puts the menu &#8220;before&#8221; the main text for people scanning the display left-to-right. (I have no idea why these people don&#8217;t have the same problem with top menus. Usage habits and user expectations are strange sometimes.)<\/td>\n<\/tr>\n<tr>\n<td>Menu Right<\/td>\n<td>The &#8220;Home&#8221; link is always visible, and the menu now occupies that empty space that was wasted on desktops.<\/td>\n<td>This puts the main text slightly off-center, which apparently drives some people nuts. However, it&#8217;s not quite as distracting for people doing left-to-right scanning.<\/td>\n<\/tr>\n<\/table>\n<p>When I began messing with this, it seemed like desktop users wanted side-menus and mobiles wanted top-menus. So it made sense to use side-menu for &#8220;big&#8221; displays and top-menu for &#8220;small&#8221; ones. However, it&#8217;s now clear that actually adapting to different screens is a larger and more subtle problem than I can solve on my own. Some desktop users shrink their window, throwing things into an approximate &#8220;portrait&#8221; mode. Some mobile displays are large. Some desktop displays are small. <\/p>\n<p>(And because I know someone will suggest &#8220;make it an option&#8221;, I should add: Allowing users to select the layout themselves would mean using cookies and Javascript. That&#8217;s a nightmare of extra complexity that will make troubleshooting more difficult for me. Also, the WordPress system of cookies is broken due to over-zealous EU GDPR compliance. It took me four hours just to get cookies working in the comment field. I can&#8217;t imagine what a pain in the ass it would be to gain cookie access for some sort of homebrew layout customization. Sorry, this operation is too small for me to do fancy stuff like that. I need something simple that fits within my sphere of knowledge.)<\/p>\n<p>One thing I&#8217;ve noticed is that the people who disliked the wasted space problem of menu-top do not seem to be delighted with the side-menu arrangement. At least, none of them have shown up to express approval. Perhaps the menu-top thing we had a month ago was already the optimal solution, and I should have ignored the complaints about wasted space. But for the sake of knowledge, I&#8217;m going to leave the menu on the right for a few days and see how people respond to that. If the gripes still outweigh the expressions of relief, then I&#8217;ll drop the side-menu altogether and we can go back to having the menu at the top.<\/p>\n<p>It&#8217;s all good for me. I already got what I wanted out of the redesign. I got to cut out huge sections of confusing details and legacy code, which helps with maintainability. I think this theme is less than half the number of lines of code and makes a fraction of the MySQL calls. <\/p>\n<p>Still, there&#8217;s one major issue left, and I&#8217;m a bit stumped&#8230;<\/p>\n<h3>Footnote Popups<\/h3>\n<p>Apparently, people using Apple mobile devices<span class='snote' title='1'>And thus Safari browser.<\/span> can&#8217;t close footnotes. Normally, you can click on the little number like this one<span class='snote' title='2'>Hi there!<\/span> to see the text, and then click anywhere outside the popup box to get rid of it. For whatever reason, Safari on mobiles handles this differently from everyone else. The only way to close a footnote is to open a different one. I don&#8217;t have any Apple devices so I can&#8217;t test this, and I really have no idea what to do about it.<\/p>\n<p>If you&#8217;re curious, here&#8217;s the Javascript:<\/p>\n<pre lang=\"java\" line=\"1\">\r\n\/\/call this function once the page has loaded\r\n  window.addEventListener('load', snote_init, false);\r\n  \/\/window.addEventListener('mousedown', snote_hide, false);\r\n  window.addEventListener('mouseup', snote_hide, true);\r\n\r\n  \/\/this function will add a span with snote_tip class where a span with the snote class is used, this reduces the html needed and makes writing notes so much simpler\/cleaner.\r\n  function snote_init() {\r\n      var snote_elements = document.getElementsByClassName('snote');\r\n      for (var i = 0; i < snote_elements.length; i += 1) {\r\n        (function(i)  {\r\n          var snote_element = snote_elements[i];\r\n\r\n          snote_element.innerHTML = '<span class=\"snote_refnum\" title=\"\">[' + snote_element.title + ']<\/span>' + '<span class=\"snote_tip\" id=\"snote_' + i + '\">' + snote_element.innerHTML + '<\/span>';\r\n          snote_element.style.display = 'inline-block';\r\n          snote_element.addEventListener (\"mouseup\", function () {snote_show(i)}, false);\r\n        })(i);\r\n     }\r\n  }\r\n\r\n  function snote_hide (arg)\r\n  {\r\n    var snote_elements = document.getElementsByClassName('snote_tip');\r\n    for (var i = 0; i < snote_elements.length; i += 1) {\r\n      var snote_element = snote_elements[i];\r\n      snote_element.style.visibility = 'hidden';\r\n    }\r\n  }\r\n  \r\n  function snote_show(arg)\r\n  {\r\n      var snote_tip = document.getElementById('snote_' + arg);\r\n\r\n       \r\n      if (snote_tip.style.visibility == 'visible')  {\r\n        snote_tip.style.visibility = 'hidden';\r\n      } else {\r\n        snote_tip.style.visibility = 'visible';\r\n      }\r\n  };\r\n<\/pre>\n<p>This code was provided years ago by a reader. I've poked at it a bit since then. You can see at some point I commented out line 3 and replaced it with line 4, where it responds to mouse UP events rather than mouse down. I'm not sure why I made that change, so I don't know what it's for. <\/p>\n<p>Some other notes:<\/p>\n<p>I wanted to make the sidebar very slightly transparent like some of the other bits of the interface, but the drop-down boxes for the Archives & Category controls apparently can't do that. I found several threads on StackExchange all saying the same thing: You can't change the background of a drop-down box like that. I tried it myself, and it does seem to be immune to anything beyond simple color changes. <\/p>\n<p>I'm sure the more OCD among you have noticed that \"Archives\" is very slightly out of alignment with the other items. (When you're looking at the vertical version of the sidebar.) This is a mystery I can't solve. I forced every single element in that menu (icons and words) to fixed widths, and the mis-alignment remained. You might blame those icons, but shuffling the icons around doesn't change the odd spacing. You might assume I messed up the layout of dropdown boxes, but Categories and Archives are also out of alignment <em>with each other<\/em>. I just... I have no idea. This wasn't a big deal when the menu was a field of whitespace, but now that I've packed the menu together those mystery pixels really stand out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The nightmare of fussing continues. To be totally honest, this is kind of fun. I could do this forever, except I know that having a consistent experience is important and I know how disorienting it is when you show up to a previously familiar site to find everything has been moved around. So I need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[111],"tags":[],"class_list":["post-43949","post","type-post","status-publish","format-standard","hentry","category-notices"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/43949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43949"}],"version-history":[{"count":23,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/43949\/revisions"}],"predecessor-version":[{"id":43987,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/43949\/revisions\/43987"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=43949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=43949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}