Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev to master #42

Merged
merged 26 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a20ffe3
Refactor the sidebar browser code to be part of the sidebar react com…
eyalroth Jul 3, 2019
53f0a57
Add a back profile image revealed when mousing-over / touching (depen…
eyalroth Jul 4, 2019
df4ea1b
Fix the profile image reveal so it won't "hide" the buttons bellow it…
eyalroth Jul 4, 2019
1e8435a
Make the back profile image reveal only with mouse drag (instead of j…
eyalroth Jul 5, 2019
86c1b88
Re-design the posts lists for non-mobile (with very little effect on …
eyalroth Jul 5, 2019
7aa363e
Slightly adjust the site sign to larger screens (mostly decrease its …
eyalroth Jul 8, 2019
4a532bc
Change the contact button icon to "info" icon
eyalroth Jul 8, 2019
718b917
Fix alignment of the vertical lines in the posts lists
eyalroth Jul 8, 2019
ac8eb21
Fix bug with the sidebar menu transitioning when clicking on same pag…
eyalroth Jul 8, 2019
a34e92f
Fix alignment of the vertical lines in the posts lists yet again
eyalroth Jul 10, 2019
e65571d
Initial work on category-menu in the posts list #1 (site is currently…
eyalroth Jul 10, 2019
10b742e
Fix resolving of current page path in the new category menu (it faile…
eyalroth Jul 11, 2019
107854f
Add the global navigation links to the constants file
eyalroth Jul 11, 2019
0de6fd2
Make the navigation menus rely on hardcoded values instead of current…
eyalroth Jul 11, 2019
72eedb3
Add correct redirect of '/blog' to '/blog/software'
eyalroth Jul 11, 2019
54360b8
Adjust category menu for mobile as well
eyalroth Jul 11, 2019
6a00eec
Make the footer full width of screen (yet again)
eyalroth Jul 11, 2019
50e7139
Add icons to the categories menu
eyalroth Jul 11, 2019
d41c266
Make the nav menus transition nicer (width transition with position)
eyalroth Jul 14, 2019
dff78af
Remove tags and categories pages
eyalroth Jul 14, 2019
5b173e9
Re-factor the post-list "details" section (change to list, add bullet…
eyalroth Jul 14, 2019
8edc6e6
Merge the post-list react component into the post list template
eyalroth Jul 14, 2019
9fe7380
Fix line break of posts lists "footer"
eyalroth Jul 14, 2019
eece98a
Make the top "sidebar" disappear when scrolling down on mobile
eyalroth Jul 15, 2019
bb7a508
Make the re-appearance of the top bar on mobile a bit less sensitive
eyalroth Jul 16, 2019
7d21af5
Fix sidebar position on non-mobile (after breaking it in the last com…
eyalroth Jul 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 0 additions & 144 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import littlefoot from 'littlefoot'
import 'littlefoot/dist/littlefoot.css'
import './src/assets/scss/_progress.scss'

var sidebarState = "main"
var lastUnderlineLink = null

export const onServiceWorkerUpdateReady = () => {
const answer = window.confirm(
`This application has been updated. ` +
Expand All @@ -21,7 +18,6 @@ export const onServiceWorkerUpdateReady = () => {

export function onRouteUpdate({ location }) {
addLittlefoot()
addSidebarCollapse(location)
}

function addLittlefoot() {
Expand All @@ -39,144 +35,4 @@ function addLittlefoot() {
</button>
`
littlefoot({buttonTemplate: bt})
}

function addSidebarCollapse(location) {

if (location.pathname == "/") {
sidebarState = "main"
lastUnderlineLink = null
}

if (document.getElementById("sidebar")) {
const menu = document.getElementById("sidebar__menu")
const menuButton = document.getElementById("sidebar__menu-button")
const menuLinks = document.getElementsByClassName("sidebar__menu-list-item-link")
const menuUnderline = document.getElementById("sidebar__menu-underline")

const contact = document.getElementById("sidebar__contact")
const contactButton = document.getElementById("sidebar__contact-button")

const profileImage = document.getElementById("sidebar__author-img")
const authorTitle = document.getElementById("sidebar__author-title")

setSidebarState(sidebarState)
setupUnderline(location)

menuButton.addEventListener("click", () => toggle("menu-button"))
contactButton.addEventListener("click", () => toggle("contact-button"))

function toggle(buttonClicked) {
if (buttonClicked == "menu-button") {
if (sidebarState == "menu") {
setSidebarState("main")
} else {
setSidebarState("menu")
}
} else if (buttonClicked == "contact-button") {
if (sidebarState == "contact") {
setSidebarState("main")
} else {
setSidebarState("contact")
}
}
}

function setSidebarState(state) {

sidebarState = state

if (state == "main") {
enable(profileImage)
enable(authorTitle)
disable(menu)
disable(menuButton)
disable(contact)
disable(contactButton)
} else if (state == "menu") {
disable(profileImage)
disable(authorTitle)
enable(menu)
enable(menuButton)
disable(contact)
disable(contactButton)
} else if (state == "contact") {
enable(profileImage)
disable(authorTitle)
disable(menu)
disable(menuButton)
enable(contact)
enable(contactButton)
}
}

function setupUnderline(location) {

const lastLink = findMatchingLink(lastUnderlineLink)
const currentLink = findMatchingLink(location)

if (currentLink) {
if (lastLink) {
setUnderline(lastLink)
shiftUnderline({from: lastLink, to: currentLink})
} else {
if (menu.getBoundingClientRect().width > 0) {
setUnderline(currentLink)
} else {
menuButton.addEventListener('click', () => {
menu.addEventListener('transitionend', () => {
setUnderline(currentLink)
}, {once: true})
}, {once: true})
}
}
lastUnderlineLink = currentLink
} else {
lastUnderlineLink = null
}

function setUnderline(link) {
const { left, width } = link.getBoundingClientRect()
menuUnderline.style.left = `${left}px`
menuUnderline.style.width = `${width}px`
}

function shiftUnderline({from, to}) {
const { left: fromX } = from.getBoundingClientRect()
const { left: toX, width } = to.getBoundingClientRect()
menuUnderline.style.transform = `translateX(${toX - fromX}px)`
menuUnderline.style.width = `${width}px`
}
}

function enable(item) {
item.classList.add(`${item.id}-enabled`)
item.classList.remove(`${item.id}-disabled`)
}

function disable(item) {
item.classList.add(`${item.id}-disabled`)
item.classList.remove(`${item.id}-enabled`)
}

function findMatchingLink(location) {

if (location == null) {
return null
}

for (let i = 0; i < menuLinks.length; i++) {
let link = menuLinks[i]
if (noTrailingSlash(link.pathname) == noTrailingSlash(location.pathname)) {
return link
}
}

return null

function noTrailingSlash(pathname) {
return pathname.replace(/\/$/, "")
}
}
}
}
73 changes: 22 additions & 51 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,33 @@ const path = require('path')
const slash = require('slash')
const moment = require('moment')

const menuLinks = require('./src/consts/menuLinks.jsx')

exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions
const { createPage, createRedirect } = actions
const { CategoryLinks } = menuLinks

createRedirect({
fromPath: '/blog',
toPath: '/blog/software',
redirectInBrowser: true,
})

return new Promise((resolve, reject) => {
const postTemplate = path.resolve('./src/templates/PostTemplate/index.jsx')
const pageTemplate = path.resolve('./src/templates/PageTemplate/index.jsx')
const tagTemplate = path.resolve('./src/templates/TagTemplate/index.jsx')
const categoryTemplate = path.resolve(
'./src/templates/CategoryTemplate/index.jsx'
)
const postListTemplate = path.resolve('./src/templates/PostListTemplate/index.jsx')

_.each(CategoryLinks, categoryLink => {
createPage({
path: `/blog/${_.kebabCase(categoryLink.id)}`,
component: postListTemplate,
context: {
categoryId: categoryLink.id,
categoryLabel: categoryLink.label
},
})
})

graphql(`
{
Expand All @@ -27,9 +44,7 @@ exports.createPages = ({ graphql, actions }) => {
slug
}
frontmatter {
tags
layout
category
}
}
}
Expand All @@ -54,36 +69,6 @@ exports.createPages = ({ graphql, actions }) => {
component: slash(postTemplate),
context: { slug: edge.node.fields.slug },
})

let tags = []
if (_.get(edge, 'node.frontmatter.tags')) {
tags = tags.concat(edge.node.frontmatter.tags)
}

tags = _.uniq(tags)
_.each(tags, tag => {
const tagPath = `/blog/tags/${_.kebabCase(tag)}/`
createPage({
path: tagPath,
component: tagTemplate,
context: { tag },
})
})

let categories = []
if (_.get(edge, 'node.frontmatter.category')) {
categories = categories.concat(edge.node.frontmatter.category)
}

categories = _.uniq(categories)
_.each(categories, category => {
const categoryPath = `/blog/categories/${_.kebabCase(category)}/`
createPage({
path: categoryPath,
component: categoryTemplate,
context: { category },
})
})
}
})

Expand Down Expand Up @@ -120,19 +105,5 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
name: 'slug',
value: slug,
})

if (node.frontmatter.tags) {
const tagSlugs = node.frontmatter.tags.map(
tag => `/blog/tags/${_.kebabCase(tag)}/`
)
createNodeField({ node, name: 'tagSlugs', value: tagSlugs })
}

if (typeof node.frontmatter.category !== 'undefined') {
const categorySlug = `/blog/categories/${_.kebabCase(
node.frontmatter.category
)}/`
createNodeField({ node, name: 'categorySlug', value: categorySlug })
}
}
}
12 changes: 0 additions & 12 deletions src/assets/fonts/fontello-41f8de9d/LICENSE.txt

This file was deleted.

70 changes: 0 additions & 70 deletions src/assets/fonts/fontello-41f8de9d/css/fontello-embedded.css

This file was deleted.

Binary file not shown.
Binary file not shown.
39 changes: 39 additions & 0 deletions src/assets/fonts/fontello/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Font license info


## Font Awesome

Copyright (C) 2016 by Dave Gandy

Author: Dave Gandy
License: SIL ()
Homepage: http://fortawesome.github.com/Font-Awesome/


## Elusive

Copyright (C) 2013 by Aristeides Stathopoulos

Author: Aristeides Stathopoulos
License: SIL (http://scripts.sil.org/OFL)
Homepage: http://aristeides.com/


## Entypo

Copyright (C) 2012 by Daniel Bruce

Author: Daniel Bruce
License: SIL (http://scripts.sil.org/OFL)
Homepage: http://www.entypo.com


## Linecons

Copyright (C) 2013 by Designmodo

Author: Designmodo for Smashing Magazine
License: CC BY ()
Homepage: http://designmodo.com/linecons-free/


Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
"code": 59392,
"src": "fontawesome"
},
{
"uid": "ccc2329632396dc096bb638d4b46fb98",
"css": "mail-alt",
"code": 61664,
"src": "fontawesome"
},
{
"uid": "bf09b1c6561dc0ced707476e2cd83d29",
"css": "medium",
Expand Down Expand Up @@ -78,12 +72,6 @@
"code": 61598,
"src": "fontawesome"
},
{
"uid": "de5f0a564ccf8816325330e292e11533",
"css": "rss-squared",
"code": 61763,
"src": "fontawesome"
},
{
"uid": "e1597911f34fea0a188ae51fe4a2d9a9",
"css": "stackoverflow",
Expand All @@ -97,10 +85,28 @@
"src": "fontawesome"
},
{
"uid": "9f7e588c66cfd6891f6f507cf6f6596b",
"css": "phone",
"code": 59393,
"uid": "7e4164950ffa4990961958b2d6318658",
"css": "info-circled",
"code": 59394,
"src": "entypo"
},
{
"uid": "0133387f2069a1b3168942b84d81dd3a",
"css": "gamepad",
"code": 61723,
"src": "fontawesome"
},
{
"uid": "e36d581e4f2844db345bddc205d15dda",
"css": "group",
"code": 59393,
"src": "elusive"
},
{
"uid": "52cde78d270e411ccf22c9ec02910d69",
"css": "cd",
"code": 59396,
"src": "linecons"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

.icon-mail:before { content: '\e800'; } /* '' */
.icon-phone:before { content: '\e801'; } /* '' */
.icon-group:before { content: '\e801'; } /* '' */
.icon-info-circled:before { content: '\e802'; } /* '' */
.icon-cd:before { content: '\e804'; } /* '' */
.icon-twitter:before { content: '\f099'; } /* '' */
.icon-github-circled:before { content: '\f09b'; } /* '' */
.icon-rss:before { content: '\f09e'; } /* '' */
.icon-menu:before { content: '\f0c9'; } /* '' */
.icon-mail-alt:before { content: '\f0e0'; } /* '' */
.icon-linkedin:before { content: '\f0e1'; } /* '' */
.icon-rss-squared:before { content: '\f143'; } /* '' */
.icon-gamepad:before { content: '\f11b'; } /* '' */
.icon-stackoverflow:before { content: '\f16c'; } /* '' */
.icon-instagram:before { content: '\f16d'; } /* '' */
.icon-facebook-official:before { content: '\f230'; } /* '' */
Expand Down
Loading