UI enhancements
This commit is contained in:
parent
19affa2f1f
commit
9747cd809d
19
README.md
19
README.md
@ -2,21 +2,4 @@
|
|||||||
|
|
||||||
[![Netlify Status](https://api.netlify.com/api/v1/badges/8128893c-9426-4869-9858-731f3abc96c3/deploy-status)](https://app.netlify.com/sites/lambdapaul/deploys)
|
[![Netlify Status](https://api.netlify.com/api/v1/badges/8128893c-9426-4869-9858-731f3abc96c3/deploy-status)](https://app.netlify.com/sites/lambdapaul/deploys)
|
||||||
|
|
||||||
## Design Rationale Draft
|
This is a rather simple [Next.js](https://nextjs.com) website that mainly involves generating content out of a bunch of markdown files contained in `notes/` and `posts/` which contain rough, unorganized yet useful information and thought-out articles respectively.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
### Page Categorization
|
|
||||||
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.
|
|
||||||
|
|
||||||
### Design Principles
|
|
||||||
The goal of my home page's design is to keep this minimal. There is no need for unnecessary content to waste people's time. The rule is simple: only waste one's time if they willingly do so.
|
|
||||||
|
|
||||||
Modern webpages tend to be bulky. This entire site should retain the modern design while being as minimal and static as possible.
|
|
||||||
- minimal: a page should not overly rely on programming logic unless the focus is programming logic
|
|
||||||
- static: informational pages should not be dynamically changing as the focus is on the content itself
|
|
||||||
|
|
||||||
#### Design Problems
|
|
||||||
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 "ease-of-use" which is why I have not done it yet.
|
|
@ -27,9 +27,12 @@ function Title({ name, title, ancestors }: propsObj) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h1 className={style.container}>
|
<div className={style.container}>
|
||||||
{title || name}
|
<h1 className={style.title}>
|
||||||
</h1>
|
{title || name}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={`${style.nav} h1`}>
|
<div className={`${style.nav} h1`}>
|
||||||
{name
|
{name
|
||||||
? <><Link href='/'><a>PaulW.XYZ</a></Link> / {pathElements}{name}</>
|
? <><Link href='/'><a>PaulW.XYZ</a></Link> / {pathElements}{name}</>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Layout from '../../components/layout';
|
import Layout from '../../components/layout';
|
||||||
import { getAllNotes, getNote } from '../../util/slug';
|
import { getAllNotes, getNote } from '../../util/slug';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import { Prism } from 'react-syntax-highlighter';
|
import SyntaxHighlighter from 'react-syntax-highlighter';
|
||||||
import dark from 'react-syntax-highlighter/dist/cjs/styles/prism/material-oceanic';
|
import { monokaiSublime } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
|
||||||
import remarkGfm from 'remark-gfm';
|
import remarkGfm from 'remark-gfm';
|
||||||
|
|
||||||
function Note({ note }: any) {
|
function Note({ note }: any) {
|
||||||
@ -14,16 +14,22 @@ function Note({ note }: any) {
|
|||||||
components={{
|
components={{
|
||||||
code({ node, inline, className, children, ...props }) {
|
code({ node, inline, className, children, ...props }) {
|
||||||
const match = /language-(\w+)/.exec(className || '')
|
const match = /language-(\w+)/.exec(className || '')
|
||||||
return !inline && match ? (
|
return !inline && match
|
||||||
<Prism
|
? (
|
||||||
language={match[1]}
|
<SyntaxHighlighter
|
||||||
style={dark}
|
showLineNumbers={true}
|
||||||
PreTag='div'
|
language={match[1]}
|
||||||
{...props}
|
style={monokaiSublime}
|
||||||
>{String(children).replace(/\n$/, '')}</Prism>
|
wrapLongLines={true}
|
||||||
) : <code className={className} {...props}>
|
PreTag='div'
|
||||||
{children}
|
codeTagProps={{style: {display: 'block'}}}
|
||||||
</code>
|
customStyle={{padding:'0', borderRadius: '1rem', maxHeight: '400px'}}
|
||||||
|
{...props}
|
||||||
|
>{children}</SyntaxHighlighter>
|
||||||
|
)
|
||||||
|
: <code className={className} {...props}>
|
||||||
|
{children}
|
||||||
|
</code>
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>{note.content}</ReactMarkdown>
|
>{note.content}</ReactMarkdown>
|
||||||
|
@ -5,13 +5,15 @@ import { getNotesMeta, NoteMeta } from '../../util/slug';
|
|||||||
function NotesPage({ notesMeta }: { notesMeta: NoteMeta[] }) {
|
function NotesPage({ notesMeta }: { notesMeta: NoteMeta[] }) {
|
||||||
return (
|
return (
|
||||||
<Layout name='Notes'>
|
<Layout name='Notes'>
|
||||||
{notesMeta && notesMeta.map((note: NoteMeta, i) => {
|
<div className='text center block'>
|
||||||
return <section key={i} className='h5 block'>
|
{notesMeta && notesMeta.map((note: NoteMeta, i) => {
|
||||||
<Link href={`/notes/${note.slug}`}>
|
return <div key={i} className='h5'>
|
||||||
{note.title}
|
<Link href={`/notes/${note.slug}`}>
|
||||||
</Link>
|
{note.title}
|
||||||
</section>
|
</Link>
|
||||||
})}
|
</div>
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -4,27 +4,38 @@ import date from '../../util/date';
|
|||||||
import { getPostsMeta, PostMeta } from '../../util/slug';
|
import { getPostsMeta, PostMeta } from '../../util/slug';
|
||||||
|
|
||||||
function PostsPage({ postsMeta }: { postsMeta: PostMeta[] }) {
|
function PostsPage({ postsMeta }: { postsMeta: PostMeta[] }) {
|
||||||
// todo: create a table-like user interface
|
return (
|
||||||
return ( // wow this is horrible
|
|
||||||
<Layout name='Posts'>
|
<Layout name='Posts'>
|
||||||
<section className='h4 block'>
|
<table className='h5'>
|
||||||
Post Name
|
<thead>
|
||||||
<span style={{ float: 'right', margin: 'auto 1rem' }}> Created on </span>
|
<tr>
|
||||||
<span style={{ float: 'right', margin: 'auto 1rem' }}>Last Updated </span>
|
<th style={{flex: '1 0 30%'}}>Name</th>
|
||||||
</section>
|
<th>Created on</th>
|
||||||
{postsMeta.map((post: PostMeta, i) => {
|
<th>Last Updated</th>
|
||||||
return <section key={i} className='h5 block'>
|
</tr>
|
||||||
<Link href={`/posts/${post.slug}`}>
|
</thead>
|
||||||
{post.title}
|
<tbody>
|
||||||
</Link>
|
{postsMeta.map((post: PostMeta, i) => {
|
||||||
<span className='h6' style={{ float: 'right', margin: 'auto 1rem' }}>
|
return <tr key={i}>
|
||||||
{date.prettyPrint(new Date(post.created_at))}
|
<td style={{flex: '1 0 30%'}}>
|
||||||
</span>
|
<Link href={`/posts/${post.slug}`}>
|
||||||
{post.last_updated && <span className='h6' style={{ float: 'right', margin: 'auto 1rem' }}>
|
{post.title}
|
||||||
{date.prettyPrint(new Date(post.last_updated))}
|
</Link>
|
||||||
</span>}
|
</td>
|
||||||
</section>
|
<td>
|
||||||
})}
|
{date.prettyPrint(new Date(post.created_at))}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{
|
||||||
|
post.last_updated
|
||||||
|
? date.prettyPrint(new Date(post.last_updated))
|
||||||
|
: '-'
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
})}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</Layout>
|
</Layout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -161,14 +161,15 @@ pre {
|
|||||||
table {
|
table {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border: 1px solid var(--main-border-color);
|
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
table thead {
|
table thead {
|
||||||
background: var(--secondary-green);
|
background: var(--secondary-green);
|
||||||
border-top-left-radius: 1rem;
|
z-index: -1;
|
||||||
border-top-right-radius: 1rem;
|
border-bottom: 1px solid #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
table thead tr,
|
table thead tr,
|
||||||
@ -177,7 +178,7 @@ table tbody tr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table tbody tr+tr {
|
table tbody tr+tr {
|
||||||
border-top: 1px solid var(--main-border-color);
|
border-top: 1px solid #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
table thead tr th,
|
table thead tr th,
|
||||||
@ -187,6 +188,11 @@ table tbody tr td {
|
|||||||
padding: .5em;
|
padding: .5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table th+th,
|
||||||
|
table td+td {
|
||||||
|
border-left: 1px solid #999999;
|
||||||
|
}
|
||||||
|
|
||||||
.lambda-logo {
|
.lambda-logo {
|
||||||
width: 256px;
|
width: 256px;
|
||||||
height: 256px;
|
height: 256px;
|
||||||
@ -203,24 +209,11 @@ table tbody tr td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
|
display: block;
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin: 0 0.25rem;
|
margin: 1rem 0.25rem;
|
||||||
border: 1px solid var(--main-border-color);
|
border-radius: 1rem;
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block:first-of-type {
|
|
||||||
border-top-right-radius: 1rem;
|
|
||||||
border-top-left-radius: 1rem;
|
|
||||||
margin-top: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block:last-of-type {
|
|
||||||
border-bottom: 1px solid var(--main-border-color);
|
|
||||||
border-bottom-right-radius: 1rem;
|
|
||||||
border-bottom-left-radius: 1rem;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
|
@ -20,7 +20,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.block .block {
|
.block .block {
|
||||||
margin: 0 ;
|
margin: 0;
|
||||||
|
margin-left: 0.5rem;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
z-index: -1;
|
z-index: -1;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
.container {
|
.container {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
max-width: 95%;
|
background-color: var(--main-background-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container .title {
|
||||||
border-bottom: 1px solid #FFFFFF;
|
border-bottom: 1px solid #FFFFFF;
|
||||||
|
max-width: 95%;
|
||||||
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
|
Loading…
Reference in New Issue
Block a user