-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
put in server and initial routes; setup ajax calls to work; more orga…
…nization; setup templates with pug
- Loading branch information
Showing
22 changed files
with
752 additions
and
1,667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dist | ||
node_modules | ||
.idea | ||
.idea | ||
/public/bundle.js |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export function createElementFromString(string) { | ||
const temp = document.createElement('div'); | ||
temp.innerHTML = string; | ||
return temp.firstChild; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { | ||
createElementFromString | ||
} from './helpers/dom'; | ||
|
||
export async function goTo(url) { | ||
const location = window.location.host; | ||
const fullURL = `http://${location}/api${url}`; | ||
|
||
const res = await fetch(fullURL); | ||
const html = await res.text(); | ||
|
||
document.body.appendChild(createElementFromString(html)); | ||
|
||
window.history.pushState({ | ||
html: html, | ||
title: `this is the title` | ||
}, "", url); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { | ||
TweenLite, | ||
TimelineLite, | ||
Strong | ||
} from 'gsap'; | ||
|
||
import fetchUrl from 'fetch-promise'; | ||
|
||
export default async() => { | ||
document.body.classList.add(`home`); | ||
|
||
const tl = new TimelineLite(); | ||
|
||
const navigation = document.querySelector(`.navigation`); | ||
const navLinks = document.querySelectorAll(`.navigation a`); | ||
const blurb = document.querySelector(`.blurb`); | ||
|
||
const homeLogoContainer = document.querySelector(`.home-logo-container`); | ||
const logo = document.querySelector(`.logo`); | ||
|
||
homeLogoContainer.appendChild(logo); | ||
|
||
navLinks.forEach(link => { | ||
link.addEventListener('click', async e => { | ||
e.preventDefault(); | ||
|
||
const location = window.location.host; | ||
const href = link.attributes.href.value; | ||
const url = `http://${location}/api${href}`; | ||
|
||
console.log(url); | ||
|
||
const res = await fetchUrl(url); | ||
|
||
console.log(res); | ||
}); | ||
}); | ||
|
||
tl | ||
.to(logo, .5, { | ||
opacity: 1, | ||
filter: `blur(0)`, | ||
transform: `scale(1)`, | ||
}) | ||
.staggerFromTo(navLinks, .5, { | ||
ease: Strong.easeInOut, | ||
filter: `blur(20px)`, | ||
transform: `translate3d(0, 3vh, 0)`, | ||
opacity: 0 | ||
}, { | ||
transform: `translate3d(0, 0, 0)`, | ||
filter: `blur(0)`, | ||
opacity: 1 | ||
}, .1) | ||
.fromTo(blurb, 1, { | ||
ease: Strong.easeInOut, | ||
filter: `blur(20px)`, | ||
transform: `translate3d(0, 3vh, 0)`, | ||
opacity: 0 | ||
}, { | ||
transform: `translate3d(0, 0, 0)`, | ||
filter: `blur(0)`, | ||
opacity: 1 | ||
}); | ||
}; |
Oops, something went wrong.