469 lines
15 KiB
HTML
469 lines
15 KiB
HTML
---
|
|
title: Go-Fed Site Redesign
|
|
summary: Taking Go-Fed's website from "yep, it has color" to "woo, looking super nice! :D"
|
|
author: "Abdullah Tarawneh"
|
|
date: "2020-12-27"
|
|
start: "Dec 2020"
|
|
end: "Dec 2020"
|
|
at: "Go-Fed"
|
|
position: "Website Remake"
|
|
tags: ["go-fed", "redesign", "website", "web", "responsive"]
|
|
category: "Work"
|
|
cover: "/images/cover/go-fed.png"
|
|
---
|
|
|
|
|
|
|
|
<main id="go-fed">
|
|
<header class="page-header section">
|
|
<div class="container">
|
|
<img src="/images/logos/go-fed.png" alt="Go-Fed logo">
|
|
<h1 class="title">I remade and simplifed Go-Fed's website on both the frontend and backend.</h1>
|
|
</div>
|
|
</header>
|
|
<section class="section" id="about" style="background: #0e2333">
|
|
<div class="container">
|
|
<h2 class="title">about the client</h2>
|
|
<div class="conversation">
|
|
<!--iframe src="https://mastodon.technology/@cj/105345893037769051/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe-->
|
|
<article style="padding: 1em; background: #122e43; color: #fff;">
|
|
<a target="_blank" href="https://mastodon.technology/@cj" style="color: inherit; text-decoration: none; display: flex; margin-bottom: 15px;">
|
|
<img src="/images/people/cj.jpg" width=48 height=48 alt="cj's avatar" style="border-radius: 4px; margin-right: 10px; width: 48px; height: 48px;">
|
|
<div style="line-height: 1.5">
|
|
<div style="font-weight: 500;">cj🇺🇸🇨🇭</div>
|
|
<div>@cj@mastodon.technology</div>
|
|
</div>
|
|
</a>
|
|
<div style="font-size: 19px; line-height: 24px;">
|
|
<p style="margin-bottom: 20px; font-size: 22px; font-weight: 700;">Get Fedi Hired: Go-Fed Site Redesign</p>
|
|
<p>
|
|
I'm looking to pay from the Go-Fed OpenCollective to update the go-fed website.<br><br>
|
|
|
|
Both frontend & backend.<br><br>
|
|
|
|
<a target="_blank" href="https://go-fed.org/" style="color: #e4e6da">go-fed.org</a> design is "yep it has color". The backend is similarly a gigantic single golang template, a nightmare.<br><br>
|
|
|
|
The only real constraint is "preserve the existing content". Site design color scheme may need to reflect logo rework.<br><br>
|
|
|
|
DMs OK.<br><br>
|
|
|
|
The Open Collective
|
|
<a target="_blank" style="color: #e4e6da" href="https://opencollective.com/go-fed-activitypub-labs">https://opencollective.com/go-fed-activitypub-labs</a> <br><br>
|
|
|
|
The Work Tracker
|
|
<a target="_blank" style="color: #e4e6da" href="https://socialhub.activitypub.rocks/t/go-fed-work-tracker-megathread/1170">https://socialhub.activitypub.rocks/t/go-fed-work-tracker-megathread/1170</a> <br><br>
|
|
|
|
Boosts welcome. <a target="_blank" style="color: #e4e6da" href="https://mastodon.technology/tags/hirefedi">#hirefedi</a>
|
|
</p>
|
|
<a target="_blank" href="https://mastodon.technology/@cj/105345893037769051" style="font-size: 14px; line-height: 18px; margin-top: 25px; color: inherit; display: block;">December 8, 2020, 12:06 PM</a>
|
|
</div>
|
|
</article>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="section" id="before">
|
|
<div class="container">
|
|
<h2 class="title">analyzing the old design</h2>
|
|
<blockquote class="quote">[The current] design is "yep, it has color".</blockquote>
|
|
<div class="attribution">
|
|
<img src="/images/people/cj.jpg" alt="CJ's avatar" width=32 height=32>
|
|
<cite><em>CJ Slep</em><br>Go-Fed<br>author</cite>
|
|
</div>
|
|
<div class="mobile device-gallery pswp-gallery">
|
|
<figure>
|
|
<a class="smartphone" href="old-320-home.png" data-size="320x480">
|
|
<img src="old-320-home.png" alt="The old homepage layout at mobile widths">
|
|
</a>
|
|
<figcaption>Padding and margins were not well-defined, as can be seen by the title and the navigation menu.</figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="smartphone" href="old-320-margins.png" data-size="320x480">
|
|
<img src="old-320-margins.png" alt="A narrow column of content with too-wide margins">
|
|
</a>
|
|
<figcaption>Percentage widths meant that there was too little space used on mobile by actual content.</figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="smartphone" href="old-320-overflow.png" data-size="320x480">
|
|
<img src="old-320-overflow.png" alt="An overflowing footer and video player">
|
|
</a>
|
|
<figcaption>Many elements would overflow out of their containers, such as the video player and the footer text.</figcaption>
|
|
</figure>
|
|
</div>
|
|
<div class="desktop device-gallery pswp-gallery">
|
|
<figure>
|
|
<a class="laptop" href="old-1280-home.png" data-size="1280x720">
|
|
<img src="old-1280-home.png" alt="">
|
|
</a>
|
|
<figcaption>The </figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="laptop" href="old-1280-lineheight.png" data-size="1280x720">
|
|
<img src="old-1280-lineheight.png" alt="">
|
|
</a>
|
|
<figcaption>Line height was set too tightly, causing lines with padding to overlap each other.</figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="laptop" href="old-1280-nosidebar.png" data-size="1280x720">
|
|
<img src="old-1280-nosidebar.png" alt="">
|
|
</a>
|
|
<figcaption>Even though there is extra width to work with, the layout uses only one column.</figcaption>
|
|
</figure>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="section" id="after">
|
|
<div class="container">
|
|
<h2 class="title">after the redesign</h2>
|
|
<div class="mobile device-gallery pswp-gallery">
|
|
<figure>
|
|
<a class="smartphone" href="new-320-backtotop.png" data-size="320x480">
|
|
<img src="new-320-backtotop.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="smartphone" href="new-320-fluid.png" data-size="320x480">
|
|
<img src="new-320-fluid.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="smartphone" href="new-320-footer.png" data-size="320x480">
|
|
<img src="new-320-footer.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
</div>
|
|
<div class="desktop device-gallery pswp-gallery">
|
|
<figure>
|
|
<a class="laptop" href="new-1280-home1.png" data-size="1280x720">
|
|
<img src="new-1280-home1.png" alt="">
|
|
</a>
|
|
<figcaption>The new homepage immediately informs the visitor exactly what the project is and what they can do with it.</figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="laptop" href="new-1280-home2.png" data-size="1280x720">
|
|
<img src="new-1280-home2.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="laptop" href="new-1280-home3.png" data-size="1280x720">
|
|
<img src="new-1280-home3.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="laptop" href="new-1280-home4.png" data-size="1280x720">
|
|
<img src="new-1280-home4.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="laptop" href="new-1280-page1.png" data-size="1280x720">
|
|
<img src="new-1280-page1.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
<figure>
|
|
<a class="laptop" href="new-1280-sidebar.png" data-size="1280x720">
|
|
<img src="new-1280-sidebar.png" alt="">
|
|
</a>
|
|
<figcaption></figcaption>
|
|
</figure>
|
|
</div>
|
|
<blockquote class="quote">Woo, looking super nice! :D Looks amazing! :D</blockquote>
|
|
<div class="attribution">
|
|
<img src="/images/people/cj.jpg" alt="CJ's avatar" width=32 height=32>
|
|
<cite><em>CJ Slep</em><br>Go-Fed<br>author</cite>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="section" id="hugo">
|
|
<div class="container">
|
|
<h2 class="title">rebuilding on a more manageable tech stack</h2>
|
|
<blockquote class="quote">The backend is similarly a gigantic single golang template, a nightmare.</blockquote>
|
|
<div class="attribution">
|
|
<img src="/images/people/cj.jpg" alt="CJ's avatar" width=32 height=32>
|
|
<cite><em>CJ Slep</em><br>Go-Fed<br>author</cite>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
<script defer src="/lib/pswp4/photoswipe.min.js"></script>
|
|
<script defer src="/lib/pswp4/photoswipe-ui-default.min.js"></script>
|
|
|
|
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
|
|
|
|
<!-- Background of PhotoSwipe.
|
|
It's a separate element as animating opacity is faster than rgba(). -->
|
|
<div class="pswp__bg"></div>
|
|
|
|
<!-- Slides wrapper with overflow:hidden. -->
|
|
<div class="pswp__scroll-wrap">
|
|
|
|
<!-- Container that holds slides.
|
|
PhotoSwipe keeps only 3 of them in the DOM to save memory.
|
|
Don't modify these 3 pswp__item elements, data is added later on. -->
|
|
<div class="pswp__container">
|
|
<div class="pswp__item"></div>
|
|
<div class="pswp__item"></div>
|
|
<div class="pswp__item"></div>
|
|
</div>
|
|
|
|
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
|
|
<div class="pswp__ui pswp__ui--hidden">
|
|
|
|
<div class="pswp__top-bar">
|
|
|
|
<!-- Controls are self-explanatory. Order can be changed. -->
|
|
|
|
<div class="pswp__counter"></div>
|
|
|
|
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
|
|
|
|
<button class="pswp__button pswp__button--share" title="Share"></button>
|
|
|
|
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
|
|
|
|
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
|
|
|
|
<!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
|
|
<!-- element will get class pswp__preloader--active when preloader is running -->
|
|
<div class="pswp__preloader">
|
|
<div class="pswp__preloader__icn">
|
|
<div class="pswp__preloader__cut">
|
|
<div class="pswp__preloader__donut"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
|
|
<div class="pswp__share-tooltip"></div>
|
|
</div>
|
|
|
|
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
|
|
</button>
|
|
|
|
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
|
|
</button>
|
|
|
|
<div class="pswp__caption">
|
|
<div class="pswp__caption__center"></div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script defer type="text/javascript">
|
|
var initPhotoSwipeFromDOM = function(gallerySelector) {
|
|
|
|
// parse slide data (url, title, size ...) from DOM elements
|
|
// (children of gallerySelector)
|
|
var parseThumbnailElements = function(el) {
|
|
var thumbElements = el.childNodes,
|
|
numNodes = thumbElements.length,
|
|
items = [],
|
|
figureEl,
|
|
linkEl,
|
|
size,
|
|
item;
|
|
|
|
for(var i = 0; i < numNodes; i++) {
|
|
|
|
figureEl = thumbElements[i]; // <figure> element
|
|
|
|
// include only element nodes
|
|
if(figureEl.nodeType !== 1) {
|
|
continue;
|
|
}
|
|
|
|
linkEl = figureEl.children[0]; // <a> element
|
|
size = linkEl.getAttribute('data-size').split('x');
|
|
|
|
// create slide object
|
|
item = {
|
|
src: linkEl.getAttribute('href'),
|
|
w: parseInt(size[0], 10),
|
|
h: parseInt(size[1], 10)
|
|
};
|
|
|
|
|
|
|
|
if(figureEl.children.length > 1) {
|
|
// <figcaption> content
|
|
item.title = figureEl.children[1].innerHTML;
|
|
}
|
|
|
|
if(linkEl.children.length > 0) {
|
|
// <img> thumbnail element, retrieving thumbnail url
|
|
item.msrc = linkEl.children[0].getAttribute('src');
|
|
}
|
|
|
|
item.el = figureEl; // save link to element for getThumbBoundsFn
|
|
items.push(item);
|
|
}
|
|
|
|
return items;
|
|
};
|
|
|
|
// find nearest parent element
|
|
var closest = function closest(el, fn) {
|
|
return el && ( fn(el) ? el : closest(el.parentNode, fn) );
|
|
};
|
|
|
|
// triggers when user clicks on thumbnail
|
|
var onThumbnailsClick = function(e) {
|
|
e = e || window.event;
|
|
e.preventDefault ? e.preventDefault() : e.returnValue = false;
|
|
|
|
var eTarget = e.target || e.srcElement;
|
|
|
|
// find root element of slide
|
|
var clickedListItem = closest(eTarget, function(el) {
|
|
return (el.tagName && el.tagName.toUpperCase() === 'FIGURE');
|
|
});
|
|
|
|
if(!clickedListItem) {
|
|
return;
|
|
}
|
|
|
|
// find index of clicked item by looping through all child nodes
|
|
// alternatively, you may define index via data- attribute
|
|
var clickedGallery = clickedListItem.parentNode,
|
|
childNodes = clickedListItem.parentNode.childNodes,
|
|
numChildNodes = childNodes.length,
|
|
nodeIndex = 0,
|
|
index;
|
|
|
|
for (var i = 0; i < numChildNodes; i++) {
|
|
if(childNodes[i].nodeType !== 1) {
|
|
continue;
|
|
}
|
|
|
|
if(childNodes[i] === clickedListItem) {
|
|
index = nodeIndex;
|
|
break;
|
|
}
|
|
nodeIndex++;
|
|
}
|
|
|
|
|
|
|
|
if(index >= 0) {
|
|
// open PhotoSwipe if valid index found
|
|
openPhotoSwipe( index, clickedGallery );
|
|
}
|
|
return false;
|
|
};
|
|
|
|
// parse picture index and gallery index from URL (#&pid=1&gid=2)
|
|
var photoswipeParseHash = function() {
|
|
var hash = window.location.hash.substring(1),
|
|
params = {};
|
|
|
|
if(hash.length < 5) {
|
|
return params;
|
|
}
|
|
|
|
var vars = hash.split('&');
|
|
for (var i = 0; i < vars.length; i++) {
|
|
if(!vars[i]) {
|
|
continue;
|
|
}
|
|
var pair = vars[i].split('=');
|
|
if(pair.length < 2) {
|
|
continue;
|
|
}
|
|
params[pair[0]] = pair[1];
|
|
}
|
|
|
|
if(params.gid) {
|
|
params.gid = parseInt(params.gid, 10);
|
|
}
|
|
|
|
return params;
|
|
};
|
|
|
|
var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) {
|
|
var pswpElement = document.querySelectorAll('.pswp')[0],
|
|
gallery,
|
|
options,
|
|
items;
|
|
|
|
items = parseThumbnailElements(galleryElement);
|
|
|
|
// define options (if needed)
|
|
options = {
|
|
|
|
// define gallery index (for URL)
|
|
galleryUID: galleryElement.getAttribute('data-pswp-uid'),
|
|
|
|
getThumbBoundsFn: function(index) {
|
|
// See Options -> getThumbBoundsFn section of documentation for more info
|
|
var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail
|
|
pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
|
|
rect = thumbnail.getBoundingClientRect();
|
|
|
|
return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
|
|
}
|
|
|
|
};
|
|
|
|
// PhotoSwipe opened from URL
|
|
if(fromURL) {
|
|
if(options.galleryPIDs) {
|
|
// parse real index when custom PIDs are used
|
|
// http://photoswipe.com/documentation/faq.html#custom-pid-in-url
|
|
for(var j = 0; j < items.length; j++) {
|
|
if(items[j].pid == index) {
|
|
options.index = j;
|
|
break;
|
|
}
|
|
}
|
|
} else {
|
|
// in URL indexes start from 1
|
|
options.index = parseInt(index, 10) - 1;
|
|
}
|
|
} else {
|
|
options.index = parseInt(index, 10);
|
|
}
|
|
|
|
// exit if index not found
|
|
if( isNaN(options.index) ) {
|
|
return;
|
|
}
|
|
|
|
if(disableAnimation) {
|
|
options.showAnimationDuration = 0;
|
|
}
|
|
|
|
// Pass data to PhotoSwipe and initialize it
|
|
gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
|
|
gallery.init();
|
|
};
|
|
|
|
// loop through all gallery elements and bind events
|
|
var galleryElements = document.querySelectorAll( gallerySelector );
|
|
|
|
for(var i = 0, l = galleryElements.length; i < l; i++) {
|
|
galleryElements[i].setAttribute('data-pswp-uid', i+1);
|
|
galleryElements[i].onclick = onThumbnailsClick;
|
|
}
|
|
|
|
// Parse URL and open gallery if it contains #&pid=3&gid=1
|
|
var hashData = photoswipeParseHash();
|
|
if(hashData.pid && hashData.gid) {
|
|
openPhotoSwipe( hashData.pid , galleryElements[ hashData.gid - 1 ], true, true );
|
|
}
|
|
};
|
|
|
|
// execute above function
|
|
initPhotoSwipeFromDOM('.pswp-gallery');
|
|
|
|
</script> |