Add readme to home, fuzzy search instruction and make UI a tad bit better

This commit is contained in:
Paul 2021-09-22 23:53:57 -04:00
parent 9d0d4a4953
commit e2cfd0f266
6 changed files with 60 additions and 21 deletions

View File

@ -72,8 +72,24 @@
<h1 class="title">PaulW.XYZ</h1>
<div class="fuzzynav">
<input class="search" type="text" id="search" placeholder="Navigate to ...">
<div id="results" class="results"></div>
<input class="search" type="text" id="search" placeholder="Go to ... (Try typing `help` or `?`)">
<div id="results" class="results">
<p><strong>Using the search bar will clear this message and list responses based on your query.</strong></p>
<p>This is a draft of the rationale behind writing pages the way I have. I do not like the traditional web conventions so this is where I experiment the most with interfacing elements. The navigation pane-based design works when they are simple and easy to understand. When they get too complex, people rely on using search bars to get where they want. My goal is to find a method to eliminate the visual noise of the complex navigation panes and find a reasonable alternative them while being easy to use. </p>
<h2 id="page-categorization">Page Categorization</h2>
<p>The home page or the index page solely acts as a gateway to all the other pages on the site.
The accessible pages are categorized on a need-based system. Since I currently do not have multiple pages, I have them all under a single directory.</p>
<h2 id="design-principles">Design Principles</h2>
<p>The goal of my home page&rsquo;s design is to keep this minimal. There is no need for unnecessary content to waste people&rsquo;s time. The rule is simple: only waste one&rsquo;s time if they willingly do so.</p>
<p>Modern webpages tend to be bulky. This entire site should retain the modern design while being as minimal and static as possible.</p>
<ul>
<li>minimal: a page should not overly rely on programming logic unless the focus is programming logic</li>
<li>static: informational pages should not be dynamically changing as the focus is on the content itself</li>
</ul>
<h3 id="design-problems">Design Problems</h3>
<p>A new user would never understand how this site works.
My ideal navigation system would involve having as few navigation elements as possible. This is the reason why I chose to add solely the fuzzy-search bar. However, I have not been able to find a good way to give users of my pages a good way to interact in case they do not use the search bar. I previously used to list them all but it was not easy on the eyes and looked lazy. Maybe a command system that does not use symbols (considering touch devices do not support non-Latin character insertions easily). Maybe something similar to *nix commands. The site somewhat vaguely follows the basic file-system structure. However, this goes against my goal of &ldquo;ease-of-use&rdquo; which is why I have not done it yet.</p>
</div>
</div>
</nav>

View File

@ -45,6 +45,7 @@
<body>
<h1 class="title"><a href="/">PaulW.XYZ</a> / <a href="/pages/">Pages</a> / Grade Calculator</h1>
<div class="block">
<div class="about-container">
<h2>About</h2>
Check out the <a href="https://github.com/lambdapaul/www/blob/master/pages/grade-calc/README.md">README.md</a> file
@ -74,6 +75,7 @@
</div>
<div class="calculator-container">
</div><span class="clear"></span>
</div>
<script type="text/javascript" src="gc_client.js"></script>
<script>

View File

@ -9,7 +9,7 @@
<body>
<!-- This page is really for me to not forget/revisit the good things I have read, seen, heard, and/or experienced. This list may change, just as my opinions. -->
<h1 class="title"><a href="/">PaulW.XYZ</a> / <a href="/pages/">Pages</a> / Recommended</h1>
<section>
<section class="block">
<p>If the one you're looking for is not on this list, it is most likely I haven't had the chance to read it yet or I may have put it on the Resources page, if it is freely available.</p>
<hr>
<h2>Books</h2>

View File

@ -8,7 +8,7 @@
</head>
<body>
<h1 class="title"><a href="/">PaulW.XYZ</a> / <a href="/pages/">Pages</a> / Resources</h1>
<section>
<section class="block">
<h2>Programming</h2>
<ul>
<li><a href="http://aggregate.org/MAGIC/">The Aggregate Magic Algorithms</a></li>

View File

@ -1,3 +1,4 @@
// good luck reading through this
(function () {
var client = new XMLHttpRequest();
client.open("GET", "/pages.json");
@ -6,6 +7,7 @@
fuzzyInit(client.responseText);
}
client.send();
document.querySelector("#search").focus();
})();
function fuzzyInit(pagesFileName) {
@ -39,11 +41,18 @@ function fuzzyInit(pagesFileName) {
break;
}
if (document.querySelector("#search").value === ""){
document.querySelector("#results").innerHTML = "";
// help
if (document.querySelector("#search").value === "?" || document.querySelector("#search").value == "help") {
document.querySelector("#results").innerHTML = "Enter a page or directory name. If do not know any, clear the search field to list everything. Using the <code>Enter</code> key would take you to the first page in list, if it is not empty."
return;
}
// if (document.querySelector("#search").value === ""){
// document.querySelector("#results").innerHTML = "Try entering something into the input field...";
// return;
// }
let results = [];
for (const [i, [title, page]] of pages.entries()) {
ret = fuzzySearch(title, document.querySelector("#search").value);

View File

@ -7,9 +7,6 @@ html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
background: linear-gradient(to bottom right, #64a95a, #388c73) no-repeat
center center fixed;
background-size: cover;
height: 100%;
}
@ -35,7 +32,11 @@ body {
color: #fff;
text-align: left;
height: 100%;
background-color: transparent;
background: linear-gradient(to bottom right, #64a95a, #388c73) no-repeat
center center fixed;
background-color: #539c65;
background-size: cover;
margin-bottom: 1rem;
}
[tabindex="-1"]:focus {
@ -94,7 +95,7 @@ p {
}
a {
color: #002bff;
color: #009dff;
text-decoration: underline;
background-color: transparent;
outline: none;
@ -148,7 +149,7 @@ section {
padding: 0.25rem 0.5rem;
font-size: 3rem;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
background: rgba(0,0,0,.3);
background-color: rgba(0,0,0,0.5);
}
.input {
@ -161,7 +162,9 @@ section {
.nav-list {
margin: 1rem;
padding: 0;
padding: 1rem;
box-shadow: inset 0 4px 8px 0 rgba(0,0,0,0.2);
background-color: rgba(0,0,0,0.5);
}
.fuzzynav {
@ -187,23 +190,31 @@ section {
font-style: italic;
}
.block,
.fuzzynav div.results {
margin: 1rem;
padding-bottom: 2rem;
padding: 1rem;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
background-color: rgba(0,0,0,0.5);
}
span.clear {
clear: both;
display: block;
}
.nav-list a,
.fuzzynav div.results .hyperlink {
color: #009dff;
background-color: rgba(34, 34, 34, 0.616);
background-color: #539c65;
display: block;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
padding: 0.5rem;
width: 100%;
margin: 0.5rem auto;
font-size: 1.4rem;
transition: 300ms cubic-bezier(0.075, 0.82, 0.165, 1);
text-decoration: none;
background: linear-gradient(to bottom right, #64a95a, #388c73) no-repeat
center center fixed;
}
.nav-list a:hover,
@ -222,21 +233,22 @@ section {
}
.fuzzynav div.results .hyperlink .link {
color: #0000FE;
text-align: right;
font-size: 1.1rem;
}
.fuzzynav div.results .hyperlink .highlight {
color: rgb(175, 175, 175)
text-decoration: underline;
}
footer {
position: fixed;
color: #fff;
background: rgb(0,0,0);
padding: 0.25rem;
bottom: 0;
right: 0;
color: #fff;
background: transparent;
padding: 0.25rem;
position: fixed;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 3px 0 rgba(0, 0, 0, 0.1);
}