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

AnyThing #3

Open
wants to merge 14 commits into
base: backup2
Choose a base branch
from
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
node_modules





68 changes: 1 addition & 67 deletions data/planetinfo.json
Original file line number Diff line number Diff line change
@@ -1,67 +1 @@
{
"planets": [
{
"planet": "Mercury",
"moons": 0,
"diameter": 4879,
"distanceFromSun": 57.9,
"images": "../images/mercury.png"
},
{
"planet": "Venus",
"moons": 0,
"diameter": 12104,
"distanceFromSun": 108.2,
"images": "../images/venus.png"
},
{
"planet": "Earth",
"moons": 1,
"diameter": 12756,
"distanceFromSun": 149.6,
"images": "../images/earth.png"
},
{
"planet": "Mars",
"moons": 80,
"diameter": "6792",
"distanceFromSun": "227.9",
"images": "../images/mars.png"
},
{
"planet": "Jupiter",
"moons": 67,
"diameter": 142984,
"distanceFromSun": 778.6,
"images": "../images/jupiter.png"
},
{
"planet": "Saturn",
"moons": 62,
"diameter": 120536,
"distanceFromSun": 1433.5,
"images": "../images/saturn.png"
},
{
"planet": "Uranus",
"moons": 27,
"diameter": 51118,
"distanceFromSun": 2872.5,
"images": "../images/uranus.png"
},
{
"planet": "Neptune",
"moons": 14,
"diameter": 49528,
"distanceFromSun": 4495.1,
"images": "../images/neptune.png"
},
{
"planet": "Pluto(Dwarf-Planet)",
"moons": 5,
"diameter": 2370,
"distanceFromSun": 5906.4,
"images": "../images/pluto.png"
}
]
}
{"planets":[{"planet":"Mercury","moons":0,"diameter":4879,"distanceFromSun":57.9,"images":"../images/mercury.png"},{"planet":"Venus","moons":0,"diameter":12104,"distanceFromSun":108.2,"images":"../images/venus.png"},{"planet":"Earth","moons":"1","diameter":"12756","distanceFromSun":"149.6","images":"../images/earth.png"},{"planet":"Mars","moons":0,"diameter":6792,"distanceFromSun":227.9,"images":"../images/mars.png"},{"planet":"Jupiter","moons":67,"diameter":142984,"distanceFromSun":778.6,"images":"../images/jupiter.png"},{"planet":"Saturn","moons":62,"diameter":120536,"distanceFromSun":1433.5,"images":"../images/saturn.png"},{"planet":"Uranus","moons":27,"diameter":51118,"distanceFromSun":2872.5,"images":"../images/uranus.png"},{"planet":"Neptune","moons":14,"diameter":49528,"distanceFromSun":4495.1,"images":"../images/neptune.png"},{"planet":"Pluto","moons":5,"diameter":2370,"distanceFromSun":5906.4,"images":"../images/pluto.png"}]}
Binary file added public/images/astronaut.png
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 public/images/bg.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 public/images/earth.png
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 public/images/jupiter.png
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 public/images/mars.png
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 public/images/mercury.png
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 public/images/moon.png
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 public/images/neptune.png
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 public/images/pluto.png
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 public/images/rocket.png
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 public/images/saturn.png
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 public/images/star.gif
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 public/images/star.png
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 public/images/sun.gif
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 public/images/uranus.png
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 public/images/venus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@

html {
cursor: url('./images/rocket.png'), auto;
}
body {
/* font-family: 'Bungee Shade', cursive; */
font-family: 'Press Start 2P', cursive;
background-image: url('./images/bg.jpg');
background-color: black;
}

h1 {
font-size: 50px;
text-align: center;
color: white;
}

h1:hover {
cursor: url('./images/rocket.png'), auto;

}

h4 {
font-size: 20px;
text-align: center;
color: white

}

.footer {
background-color: rgb(43, 226, 171);
padding: 20px;
position: fixed; bottom: 0; right: 0;
}

.planet {
display: inline-block;
margin: 10px;
max-width: 200px;
}
.planet:hover {
cursor: url('./images/astronaut.png'), auto;
}

.sun {
display: inline-block;
margin: 10px;
max-width: 350px;
position: relative; top: 100px;
}

.Mercury {
max-width: 70px;
}

.Venus {
max-width: 100px;
}

.Earth {
max-width: 120px;
}

.Mars {
max-width: 90px;
}


.Jupiter {
max-width: 190px;
position: relative; top: 30px;
}

.Saturn {
max-width: 270px;
position: relative; top: 10px;
}

.Uranus {
max-width: 140px;
}

.Neptune {
max-width: 120px;
}

.Pluto {
max-width: 30px;
position: relative; bottom: 30px;
}

.profilePlanet {
display: inline-block;
max-width: 900px;
position: absolute;
}

.content {
display: inline;
position: absolute; bottom: 400px; left: 900px;
color: white;
font-size:30px;
}

li {
font-size: 20px;
}

button {
display: inline;
position: absolute; bottom: 250px; left: 1150px;
background-color: white;
color: white;
font-family: 'Press Start 2P', cursive;
font-size:30px;
padding: 10px 13px 10px 13px;

}

button:hover{
cursor: url('./images/rocket.png'), auto;
}

form {
color: white;
text-align: center;
margin: 150px;

}

input {
font-size: 16px;
font-family: 'Press Start 2P', cursive;
padding: 10px;
margin: 20px;
}

2 changes: 1 addition & 1 deletion routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ router.post('/planets/edit/:planet', (req, res) => {
let planetDetails = JSON.parse(data)
let single = planetDetails.planets.find((item) => item.planet == Id)

single.planet = newData.planet
// single.planet = newData.planet
single.moons = newData.moons
single.diameter = newData.diameter
single.distanceFromSun = newData.distanceFromSun
Expand Down
17 changes: 17 additions & 0 deletions views/layouts/main.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Planetarium</title>
<link href="https://fonts.googleapis.com/css?family=Bungee+Shade|Press+Start+2P" rel="stylesheet">
<link rel="stylesheet" href="/main.css">
</head>
<body>
{{>header}}
<div>

{{{body}}}
</div>
{{>footer}}
</body>
</html>
6 changes: 6 additions & 0 deletions views/partials/footer.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


<div class = "footer">
<h3>FACT!</h3> <br>
<p>{{facts.1.question}} </p>
</div>
2 changes: 2 additions & 0 deletions views/partials/header.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<a href="/"><h1>PLANETARIUM</h1></a>
<h4>Explore Your Solar System!</h4>
5 changes: 3 additions & 2 deletions views/planets/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{{!-- <input type="submit" value="Submit"> --}}
</label>

<br>


<label for="diameter" class="form-item">
Expand All @@ -17,12 +17,13 @@

{{!-- <input type="submit" value="Submit"> --}}
</label>

<br>

<label for="distanceFromSun" class="form-item">
Distance from sun:
<input type="text" name="distanceFromSun" value="{{distanceFromSun}}">

</label>
<br>
<input type="submit" value="Submit">
</form>
7 changes: 7 additions & 0 deletions views/planets/index.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
<div class = "vertical-center" >
<img src = "../images/sun.gif" alt= "sun-gif" class = "sun">

{{#each planets}}
<a href="/planets/{{planet}}"> <img src = "{{images}}" alt= "planet-img" class = "planet {{planet}}"></a>
{{/each}}
</div>

12 changes: 12 additions & 0 deletions views/planets/planetprofile.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

<span><img src = "{{images}}" alt= "planet-img" class = "profilePlanet"> </span>
<span class = "content">
<h3>{{planet}}</h3>
<ul>
<li>Diameter: {{diameter}}km</li><br>
<li>Moons: {{moons}}</li><br>
<li>Distance from the Sun: {{distanceFromSun}} million km</li>
</ul>
</span>
<button><a href= "/planets/edit/{{planet}}">Edit facts</button>