Skip to content
Open

End #29

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
eb7f988
getting values from user selections and putting into an object
heicj Dec 17, 2017
d54abc1
can use search dropdowns to get images to page
heicj Dec 17, 2017
ab5ef71
Merge pull request #11 from code301-nitrogen/submit
crperezchica Dec 18, 2017
36f1328
updates readme with steps to do a sql dump and connect local db to he…
LizabethPetersen Dec 18, 2017
f416968
added api url heroku
crperezchica Dec 18, 2017
8afa3f9
modified camera name based on nasa api camera data
crperezchica Dec 18, 2017
2f61cea
updates submit username form
LizabethPetersen Dec 19, 2017
7fac874
Merge pull request #12 from code301-nitrogen/add-username
LizabethPetersen Dec 19, 2017
a682cec
adding untracked package-lock.json
katlyn75 Dec 19, 2017
327be86
Merge pull request #13 from code301-nitrogen/submit
LizabethPetersen Dec 19, 2017
d99945e
adds base stylesheets and images folder
LizabethPetersen Dec 19, 2017
38a1058
Merge pull request #14 from code301-nitrogen/add-username
LizabethPetersen Dec 19, 2017
bcf7e36
getting image info when save button is clicked in order to send to se…
heicj Dec 19, 2017
d304c49
getting all info when user clicks save to send to server
heicj Dec 19, 2017
f7bb84a
added all questions and answers to LEARN page, added copyright footer
katlyn75 Dec 19, 2017
10fc098
changed info on one answer to be clearer and more accurate
katlyn75 Dec 19, 2017
bcf396f
oops
katlyn75 Dec 19, 2017
0f02cc1
started work on creating object to send to server in post request
heicj Dec 19, 2017
3261a82
Merge pull request #15 from code301-nitrogen/saveUser
heicj Dec 19, 2017
ba3e33f
Merge pull request #16 from code301-nitrogen/submit
heicj Dec 19, 2017
369e606
adds first styling code
LizabethPetersen Dec 19, 2017
8c5ee45
Merge branch 'master' into css
heicj Dec 19, 2017
5c8ff2a
Merge pull request #17 from code301-nitrogen/css
heicj Dec 19, 2017
7645871
adds background image and overlay box for content
LizabethPetersen Dec 20, 2017
7c82c75
Merge branch 'css' of https://github.com/code301-nitrogen/client into…
LizabethPetersen Dec 20, 2017
13646ab
added bios, bio avatars to about page and 2 videos to learn page
katlyn75 Dec 20, 2017
0b9f392
Merge pull request #18 from code301-nitrogen/css
LizabethPetersen Dec 20, 2017
f83c7d4
Merge pull request #19 from code301-nitrogen/submit
LizabethPetersen Dec 20, 2017
878a42f
front side post request is sent when hit submit button
heicj Dec 20, 2017
9ae5c92
added css styling to home page
katlyn75 Dec 20, 2017
8e65f97
Merge pull request #20 from code301-nitrogen/saveUser
heicj Dec 20, 2017
1657658
Merge pull request #21 from code301-nitrogen/submit
heicj Dec 20, 2017
2e1b1da
can stay on page and do multiple seaches and image saves
heicj Dec 20, 2017
a575e52
started front side request to api for favorites
heicj Dec 20, 2017
aa74512
can pull images from database and append
heicj Dec 20, 2017
48895ef
Merge pull request #22 from code301-nitrogen/saveUser
heicj Dec 20, 2017
34be206
adds images wrapper to favorites page
LizabethPetersen Dec 20, 2017
dc9a56a
Merge pull request #23 from code301-nitrogen/css
LizabethPetersen Dec 20, 2017
6336fd6
appending favorite images to page but wrong page
heicj Dec 20, 2017
efc2e66
Merge pull request #24 from code301-nitrogen/saveUser
heicj Dec 20, 2017
2d5dd50
getting favorites to append to favorites html section but with hard c…
heicj Dec 20, 2017
04d8820
sending user name with query to server to return user faves
heicj Dec 20, 2017
e377a1a
Merge pull request #25 from code301-nitrogen/saveUser
heicj Dec 20, 2017
5a686bf
finished css styling for about page
katlyn75 Dec 20, 2017
44bc02e
Merge branch 'master' into submit
heicj Dec 20, 2017
41de519
Merge pull request #26 from code301-nitrogen/submit
heicj Dec 20, 2017
922ffd6
added css styling for favorites page
katlyn75 Dec 20, 2017
76e2ccb
finished css for about/learn/faves page
katlyn75 Dec 20, 2017
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
Binary file added .DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,16 @@ As developers, we wish to utilize a third-party API.
– The ability to randomize the favorite images or turn them into a slideshow of the user and/or the general favorites.
– Add a small grid calendar to our inputs for user to select a date for filtering images.


#### STEPS
To add the tables to another local repo:
- Do a sql:dump from the locally created database (create a text file with the data)
- Then sql:load into the other local repo

Create a Heroku app (this will store the persistent data for our users):
– Create a new app
– Add a databse
– Do this: heroku pg:push mylocaldb (name) DATABASE_URL --app your-app-name
– Connect heroku with postgres: heroku pg:psql --app your-app-name
– Use postgresql commands to check tables and data

Binary file added images/1200px-OSIRIS_Mars_true_color.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cote-dazur.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 95 additions & 56 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,54 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Carter+One|Roboto" rel="stylesheet">
<link rel="stylesheet" href="styles/vendor/normalize.css">
<link rel="stylesheet" href="styles/base.css">
<link rel="stylesheet" href="styles/layout.css">
<link rel="stylesheet" href="styles/module.css">
<link rel="stylesheet" href="styles/state.css">
<link rel="stylesheet" href="styles/theme.css">

<title>Mars Rover Photo App</title>

<script id = "image-template" type="text/x-handlebars-template">

<form class= "favImage">
<article class="clearfix" data-image="{{id}}">
<img src="{{url}}" alt="image of mars">
<input id="I{{id}}" type="checkbox">
<img id="I{{id}}" src="{{url}}" alt="image of mars">
<input class = "saveImage" type="submit">
</article>
</form>
</script>

</head>
<body>
<nav>
<div class="nav">
<ul>
<li><a href = "/client">HOME</a></li>
<li><a href = "/client/discover">DISCOVER</a></li>
<li><a href = "/client/faves">FAVES</a></li>
<li><a href = "/client/learn">LEARN</a></li>
<li><a href = "/client/about">ABOUT</a></li>
<li class="home"><a href="/client">HOME</a></li>
<li class="discover"><a href="/client/discover">DISCOVER</a></li>
<li class="faves"><a href="/client/faves">FAVORITES</a></li>
<li class="learn"><a href="/client/learn">LEARN</a></li>
<li class="about"><a href="/client/about">ABOUT</a></li>
</ul>

</nav>

<main>

<section id="home">
<p>This is a test, this is ONLY a test....</p>

<aside style ="background-color:#000">
<iframe src="https://giphy.com/embed/EA4tMPoqsE6pq" width="1000" height="1000" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><a href="https://giphy.com/gifs/mars-EA4tMPoqsE6pq" alt="gif of Mars, via GIPHY"></a>
</aside>

</section>


<section id="photos">

<div id="searchHowTo"></div>
<p>This is a test, this is ONLY a test....</p>
<!--This is a test, this is ONLY a test.... -->
<fieldset>
<form id="dropDowns">
<form id="dropdowns">
<div id= "rovers">
<label>Rovers</label>
<select id="rover">
Expand All @@ -59,73 +72,99 @@

<div id= "dates">
<label>Date(yyyy-mm-dd)</label>
<input type="text" name ="dateInput" required>
<input id="date" type="text" name ="dateInput" required>
</div>

<button id ="searchButton" type="submit">SEARCH</button>
</form>
</fieldset>

<div id="gallery"><!-- this is where images will be appended--></div>
<div id="gallery-wrapper" class="imageBlock"> <!-- this is where images will be appended--> </div>

<form>
<label for="userName">Create Name</label>
<input type="text" name="userName" required>
<button id="saveFavs" type= "submit">SAVE</button>
</form>

<label for="username">Create a username to save your favorite images.</label>
<input id = "user" type="text" name="username" required>


</section>

<section id="favePhotos">
<div id="userFaves">
<p>This is a test, this is ONLY a test....</p>

<form id="getFaves">
<label for="userName">Your Name</label>
<button id="view" type="submit">View</button>
</form>
</div>
<div id="topImages">
<form>
<label for="topUserImages">Top Images</label>
<button id="viewTopImages" type="submit">View Top Images</button>
</form>
<div id="userFaves">
<form id="getFaves">
<label for="userName">Enter Your Name</label>
<input id="userInput" type="text">
<button id="view" type="submit">View</button>
</form>
</div>

<div id="favorites-wrapper"> <!-- this is where images will be appended--> </div>

</section>

<section id="learn">
<h1>All About MARS</h1>
<!-- <img src=http://id="timeline"/> -->
<h1>Facts about Mars and the Mars Rover</h1>
<div class="faq_container">
<div class="faq">
<div class="faq_question">Question goes here</div>
<div class="faq_answer">Answer goes here</div>
<div class="faq_question">Question goes here</div>
<div class="faq_answer">Answer goes here</div>
<div class="faq_question">Question goes here</div>
<div class="faq_answer">Answer goes here</div>
<div class="faq_question">Question goes here</div>
<div class="faq_answer">Answer goes here</div>
<div class="faq_question">Question goes here</div>
<div class="faq_answer">Answer goes here</div>
<p id="question">How long is one Mars year?</p>
<p id="answer">A Mars DAY is called a sol. One Mars sol is 24 hrs, 39 min and 35.244 seconds. One Mars YEAR is 687 Earth days or 1.9 Earth years.</p>
<p id="question">What is the temperature on Mars?</p>
<p id="answer">The surface temperature of Mars is -153 to 20 degrees Celsius</p>
<p id="question">Does Mars have a moon?</p>
<p id="answer">Earth has one moon, but Mars has two. Their names are Phobos and Deimos.</p>
<p id="question">Does Mars have mountains?</p>
<p id="answer">Yes! Mars is the home of the tallest mountain in the Solar System, Olympus Mons.</p>
<p id="question">When was Mars first discovered?</p>
<p id="answer">Mars was first discovered by Egyptian astronomers in 2nd millineum BC. (Between 2000BC and 1001 BC).</p>
<p id="question">How many missions have there been to Mars?</p>
<p id="answer">There have been over 40 missions to Mars. Only 18 have been successful.</p>
<p id="question">What's something that is unique about the Mars rover?</p>
<p id="answer">Lasers! On top of Curiosity’s “neck and head” is the ChemCam, which contains a laser capable of vaporizing items found on the Martian landscape — like rocks, soil, solids (or Martians) — from a distance of up to 23 feet. The vaporized substance is then analyzed to see if it is worth further study. ChemCam will help NASA “characterize” the geology of Mars, check for evidence of past habitability, assess the “biological potential” of parts of Mars, and determine whether or not the soil of Mars is toxic to Earthlings.</p>
<p id="question">Is the Mars rover as fast as a jet?</p>
<p id="answer">Nooooooo. Curiosity will have an average speed of between 0.00018 mph and 0.00073 mph. (1 1/2 to 6 miles a YEAR.) Even on a long day, Curiosity will only travel about 600 ft.</p>
<p id="question">Is Curiosity powerful?</p>
<p id="answer">Yes and no. The iPhone in your pocket has at least 4 times the computing power of Curiosity, which packs a mere 200MHz CPU, to iPhones 800MHz CPU. Further, Curiosity packs just 256MB of RAM, and 2GB of on-board storage space. The iPhone has 512MB of RAM and up to 64GB of storage. However, Curiosity has multiple computers in case one breaks, all of which are capable of withstanding massive amounts of radiation an iPhone would not survive.</p>
<p id="question">"How did Curiosity get to Mars in the first place?"></p>
<p id="answer">Curiosity has a rough journey to get to Mars and there is no guarantee it will arrive. Below is a video of it's hard journey to Mars.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/uxVVgBAosqg" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
<p id="question">Does Curiosity have a birthday?</p>
<p id="answer">Yes. Its birthday is on August 5, 2012. For it's 1st Birthday, it sang itself a lonely birthday song. Millions of Earthlings were sad Curiosity was all alone. However, Curiosity runs on a nuclear battery that turns heat into electricity and it will eventually die. In the scientific world, there is no value in songs, so it's vibration unit has been reprogrammed for scientific data collection. If you would like to hear it sing Happy Birthday, watch the video below.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/h2I8AoB1xgU" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
</div>
</section>
<section id="about">
<h1>"About Team Nitrogen"</h1>
<div class="team">
<p id="Charlie">Charlie</p>
<img src=/>
<p id="Liz">Liz</p>
<img src=/>
<p id="Carmen">Carmen</p>
<img src=/>
<p id="Katlyn">Katlyn</p>
<img src=/>
</div>
<div class="bio"></div>
<h2>Team Nitrogen</h1>
<div class="bio-wrapper">
<h3>Charlie Heiner</h2>
<img src="https://media-exp2.licdn.com/mpr/mpr/AAEAAQAAAAAAAArIAAAAJDQ1ZWRkMTU1LTQ5NjEtNGUxMi05ZTA5LTE0MjQ4N2FhYWVjYg.jpg" alt = "black and white alien image"/>
<p id="bio">I appreciate the Universe most by getting away from the city and into nature with my camera. It's not as easy these days while learning to code with a new one at home, but my supportive, beautiful wife and two amazing children make it very worthwhile. The eclipse this year was such an incredible reminder of how vast the Universe really is.</p>
</div>

<div class="bio-wrapper">
<h3>Liz Petersen</h2>
<img src="https://i.pinimg.com/474x/f8/29/03/f82903b0aa0debc29bbbf75dcdec094d--mars-attacks-alien-art.jpg" alt = "cute alien holding cat"/>
<p id="bio">When I was 11, I wanted to be an astronaut. That dream quickly changed with the onset of the teen years and a driver’s license. A graphic and web designer by training, I am currently studying software development at Alchemy Code Lab in Portland, OR. Hobbies include riding my motorcycle to beautiful places, nature photography, hiking, and camping. I'm a plant nerd, parent of one, and practitioner of mindful communication. The farthest reaches of space have continued to hold my interest, and I have been totally excited working on this project.</p>
</div>

<div class="bio-wrapper">
<h3>Carmen Perezchica</h2>
<img src="https://vignette.wikia.nocookie.net/phineasandferb/images/7/7a/Martians_and_rover.png/revision/latest?cb=20120102080004" alt = "Martians pointing at Mars rover"/>
<p id="bio">Mars lover and enthusiast who has dreamed of blasting off planet Earth to Mars since the age of 3. If they open up applications to Elon Musk's Tesla trip to Mars, I will be the first to sign up myself, my husband and two stellar kids. My coding breaks often involve viewing photos of Mars.</p>
</div>

<div class="bio-wrapper">
<h3>Katlyn Tucker</h2>
<img src="http://wwwcdn.skyandtelescope.com/wp-content/uploads/mars_rover_journey_480px.jpg" alt = "Mars rover leaves a message in the Mars sand which spells out Mars"/>
<p id="bio">I enjoy warping time and space while learning to speak in code. Although not an astronaut, I watched two space shuttle launches in person. I almost applied to the program to colonize Mars, but leaving behind my two teens, friends and family and never returning to Earth was the dealbreaker. In my free time, I take photos, make jewelry and hang out with my kids, where we often sit and watch the Universe.</p>
</div>

</section>

<footer>
<p>&copy 2017 | All Rights Reserved | Team Nitrogen | Mars app</p>
</footer>



</main>
Expand Down
54 changes: 47 additions & 7 deletions models/image.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,74 @@
'use strict';
var app = app || {};

// const API_URL = 'heroku route';
// const API_URL = 'https://code-301-mars.herokuapp.com/';
const API_URL = 'http://localhost:3000/api/v1';

(function (module) {
function Image (obj) {
this.id = obj.id;
this.rover = obj.rover;
this.camera = obj.camera;
this.url = obj.url;
this.url = obj.url;
}
Image.all = [];
Image.faves = [];

Image.fetchImages = (cb) => {
let camShort = '';
if($('#camera option:selected').text() == 'Navigation') {
camShort = "NAVCAM";
}else if($('#camera option:selected').text() == 'Front Hazard') {
camShort = "FHAZ";
}else{
camShort = "RHAZ";
}

const options = {
rover: 'curiosity',
camera: 'fhaz',
date: '2015-12-13'
rover: $('#rover option:selected').text(),
camera: camShort,
date: $('#date').val()
}
$.get(`${API_URL}/nasa`, options)
.then(Image.loadAll)
.then(cb)
.fail(console.error);
}

Image.fetchFaves = () =>{

Image.all = [];
const user = {
user: $('#userInput').val()
}
$.get(`${API_URL}/favorites`, user)
.then(Image.loadFaves)
.fail(console.error);

console.log("this is in fetchFaves", Image.all);


$('#favorites-wrapper').show();

}
Image.loadFaves = (data) => {
Image.all = data.map(obj => new Image(obj));
console.log('this is in loadFaves', data);
console.log('this is image.all in loadFaves', Image.all)
$('#favorites-wrapper').empty();
app.Image.all.map(image => $('#favorites-wrapper').append(image.toHtml()));

}

Image.loadAll = (data) => {
Image.all = data.map(obj => new Image(obj));
console.log(Image.all);
//app.imageView.initDiscoverPage();
console.log('this is in loadAll', Image.all);
app.imageView.append();
Image.all = [];
}

Image.saveImage = (image) =>{
$.post(`${API_URL}/favorites`, image)
}

Image.prototype.toHtml = function () {
Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added styles/.DS_Store
Binary file not shown.
53 changes: 53 additions & 0 deletions styles/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
body {
margin: 0;
padding: 0;
background-color: #000000;

}

h1 {

font-family: 'Carter One',cursive;

font-size: 2.3em;
color: rgb(228, 53, 9);
margin: 0;
padding-top: 50px;
padding-left: 100px;
position: absolute;
z-index: 1;
}

h2 {

font-family: 'Carter One', cursive;

font-size: 1.7em;
}

h3 {

font-family: 'Carter One', cursive;
font-size: 1.3em;

}

p {
font-family: 'Roboto', sans-serif;
font-size: 1em;
}

a {
text-decoration: none;
color: rgb(251, 153, 76);
display: block;
}

a:hover {
color: rgb(228, 53, 9);
}

a.active {
color: rgb(251, 153, 76);
cursor: default;
}
16 changes: 16 additions & 0 deletions styles/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#home {
background-color: #000000;

}

#learn {
background-image: url('https://www.nasa.gov/sites/default/files/thumbnails/image/hubble_friday_05292015.jpg');
background-position: center top;
background-repeat: repeat;
}

footer{
width: 100%;
margin: 0 auto;
}

Loading