Skip to content

Commit

Permalink
version1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
warwickbuilds committed May 29, 2020
1 parent 457941d commit 07b33a7
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 69 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

* Fonts: Google Fonts: Open Sans

* Browser Support: Any Modern Browser (not Internet Explorer at all)

#### Design & Development

Full Page Image inspiration from Brad Traversy: https://www.youtube.com/watch?v=Gx_7GQtSdpc
Expand All @@ -22,6 +24,9 @@ Easing - http://gizma.com/easing/
Font-Awesome - https://cdnjs.com/libraries/font-awesome
Google-Font -
https://htmlhead.dev/
Sitemaps - https://ahrefs.com/blog/how-to-create-a-sitemap/
robots.txt - https://moz.com/learn/seo/robotstxt
noscript - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript

Optimisation Tools
TinyPNG.com -
Expand Down Expand Up @@ -90,7 +95,19 @@ npm run deploy
* Switch to using GraphQL API
* Switch to a framework Vue or React

#### Version 1.0
#### Version 1.2

* Features
* Sitemap.xml
* robots.txt
* Scrollbar styling
* Noscript notice

* Fixes
* Keywords
* Single SpaceX-API call rather than 2 as upcoming also contains next launch

#### Version 1.1

* Features
* Mobile optimisted layout
Expand All @@ -107,9 +124,6 @@ npm run deploy
* Deployment to gh-pages
* Custom URL https://whenisthenextspacexlaunch.com


* Fixes

## References

* https://www.flickr.com/photos/spacex/
Expand Down
67 changes: 11 additions & 56 deletions dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ const storage = new Storage();
const ui = new UI();
const http = new HTTP();

// //Init Weather using Storage Locations if avialable
// const weatherLocation = storage.getLocationData();
// const weather = new Weather(weatherLocation.city, weatherLocation.state);
// //Get sored location data


// Get Weather on DOM Loan
document.addEventListener('DOMContentLoaded', () => {
getNextLaunch();
//getNextLaunch();
getUpcomingLaunches();
});

Expand All @@ -20,65 +14,26 @@ document.querySelector('.down-arrow').addEventListener('click', () => {
ui.smoothScroll('.upcoming', 1000);
});


// Get next launch details
function getNextLaunch() {
//call http api
http.get('https://api.spacexdata.com/v3/launches/next')
.then(response => {
//log response
//console.log(response);

// Add launch details to UI
ui.paintNextLaunchDetails(response);

// Update Launch Countdown
ui.updateLaunchCountdown(response.launch_date_local);
})
.catch(err => console.error(err));
}

// Get upcoming launches
function getUpcomingLaunches() {
// call http apo
http.get('https://api.spacexdata.com/v3/launches/upcoming')
.then(response => {
//log response
//console.log(response);

// Add next launch details to UI
ui.paintNextLaunchDetails(response[0]);

// Update next Launch Countdown
ui.updateLaunchCountdown(response[0].launch_date_local);

// Add each upcoming launch to list
response.forEach(element => {
//console.log(element);

// Add launch to list
ui.addUpcomingLaunchToList(element);

});

})
.catch(err => console.log(err));
}

// // Change Location event
// document.getElementById('w-change-btn').addEventListener('click', (e) => {
// const city = document.getElementById('city').value;
// const state = document.getElementById('state').value;

// //change location
// weather.changeLocation(city, state);

// // set location in local storage
// storage.setLocationData(city, state);

// getWeather();

// $('#locModal').modal('hide');
// })

// //weather.changeLocation('Miami', 'FL');

// function getWeather() {
// weather.getWeather()
// .then(data => {
// console.log(data)
// ui.paint(data);
// })
// .catch(err => console.log(err))
// }
}
13 changes: 7 additions & 6 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

gtag('config', 'UA-123153435-3');
</script>
<title>whenisthenextspacexlaunch.com</title>
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML, CSS, XML, JavaScript">
<meta name="author" content="John Doe">
<title>when is the next spacex launch</title>
<meta name="description" content="Latest details on the upcoming SpaceX rocket launch to space!">
<meta name="keywords"
content="SpaceX, Launch, Rocket, Falcon 9, Starship, BFR, Falcom Heavy, SuperHeavy, Dragon, Dragon Crew, IIS, Nasa, LEO, Moon, Mars,">
<meta name="author" content="Award Digital - Warwick Ward">
<meta property="og:image" content="https://whenisthenextspacexlaunch.com/img/awarddigital-logo_black.png">
<meta property="og:description" content="If you want to know when is the next SpaceX launch of a rocket into space this is the site.
Next launch detailed along with the target dates for all upcoming launches.">
Next launch detailed along with the target dates for all upcoming launches">
<meta property="og:title" content="When is the next SpaceX Launch">
<meta name="twitter:title" content="When is the next SpaceX Launch">
<meta name="robots" content="index,follow">
Expand All @@ -43,6 +44,7 @@ <h1>when is the next spacex launch</h1>
<div class="image"></div>
</div>
<div class="launch-container">
<noscript>THIS PAGE REQUIRES SCRIPTING ENABLED - DON'T WORRY NOTHING SUSS GOING ON :)</noscript>
<div class="launch-top">
<div class="launch-stats">
<div class="launch-countdown">
Expand All @@ -60,7 +62,6 @@ <h1>when is the next spacex launch</h1>
<div>MINS</div>
<div>SECS</div>
</div>
</h1>
</div>
</div>
<div class="launch-image"></div>
Expand Down
4 changes: 4 additions & 0 deletions dist/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://whenisthenextspacexlaunch.com/sitemap.xml
9 changes: 9 additions & 0 deletions dist/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://whenisthenextspacexlaunch.com/</loc>
<lastmod>2020-05-28T10:00:58+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>
</urlset>
23 changes: 21 additions & 2 deletions dist/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,36 @@
padding: 0;
}

html {
scroll-behavior: smooth;
--scrollbarBG: rgb(22, 22, 22);
--thumbBG: rgb(63, 63, 63);
}

body {
font-family: 'Open Sans', sans-serif;
line-height: 1.5;
font-weight: 300;
letter-spacing: 1px;
scrollbar-width: thin;
scrollbar-color: var(--thumbBG) var(--scrollbarBG);
}

html {
scroll-behavior: smooth;
body::-webkit-scrollbar {
width: 11px;
}

body::-webkit-scrollbar-track {
background: var(--scrollbarBG);
}

body::-webkit-scrollbar-thumb {
background-color: var(--thumbBG);
border-radius: 6px;
border: 3px solid var(--scrollbarBG);
}


a {
text-decoration: none;
color: var(--primary-color);
Expand Down
Submodule github.com!warwickofthegh!whenisthenextspacexlaunch.com.git updated from 44898f to 607f07
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 07b33a7

Please sign in to comment.