-
Notifications
You must be signed in to change notification settings - Fork 22
first commit #22
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
base: main
Are you sure you want to change the base?
first commit #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| let mysql = require(‘mysql’); | ||
| let con = mysql = mysql.createConnection({ | ||
| host: “localhost”, | ||
| user: “root”, | ||
| password: Jordan2017, | ||
| database: “Pokemon” | ||
| }); | ||
| con.connect(err => { | ||
| if (err) { | ||
| throw err; | ||
| } | ||
| con.query(“SELECT * FROM pokemon”, (err, result, fields) => { | ||
| if (err) { | ||
| throw err; | ||
| } | ||
| console.log(result); | ||
| }); | ||
| }); | ||
| let pokemon_id = 1; | ||
| let name = “Bulbasaur”; | ||
| let color = “Green”; | ||
| //console.log(`INSERT into pokemon (pokemon_id, name, color) VALUES (${pokemon_id}, ${name}, ${color});`); | ||
| con.query(`INSERT into pokemon (pokemon_id, name, color) VALUES (${pokemon_id}, ${name}, ${color});`, (err, result, fields) => { | ||
| if (err) { | ||
| throw err; | ||
| } | ||
| }); | ||
| -- 9:00 | ||
| -- ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’; | ||
| -- 9:00 | ||
| -- FLUSH PRIVILEGES; | ||
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| const express = require('express') | ||
| const app = express() | ||
| const port = 3000 | ||
|
|
||
| app.get('/', (req, res) => { | ||
| res.send('Hello World!') | ||
| }) | ||
|
|
||
| app.listen(port, () => { | ||
| console.log(`Example app listening at http://localhost:${port}`) | ||
| }) | ||
| console.log(hello); | ||
|
|
||
| let pokedex = document.getElementById("pokedex"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is generating an express app running on node. The |
||
| console.log(pokedex); | ||
| let url = "https://pokeapi.co/api/v2/pokemon/"; | ||
| let fetchPokemon = () => { | ||
| const promises = []; | ||
| for (let i = 1; i <= 139; i++, status == 200) { | ||
| // console.log(url + i); | ||
|
|
||
| promises.push(fetch(url + i).then((res) => { | ||
| return res.json(); | ||
|
|
||
| })); | ||
| } | ||
|
|
||
| Promise.all(promises).then(results => { | ||
| const pokemon = results.map((data) => ({ | ||
| name: data.name, | ||
| id: data.id, | ||
| image: data.sprites['front_shiny'], | ||
| type: data.types[0].type.name | ||
| })); | ||
| displayPokemon(pokemon); | ||
| }); | ||
| }; | ||
| let thisPokemon; | ||
| let displayPokemon = (pokemon) => { | ||
| // console.log(pokemon.type); | ||
| const pokemonHTMLString = pokemon.map( | ||
| (pokeman) => ` | ||
| <div class = "card ${pokeman.type}"> | ||
| <img src= "${pokeman.image}" /> | ||
| <h2> ${pokeman.id}. ${pokeman.name}</h2> | ||
| <p>Type: ${pokeman.type}</p> | ||
| </div> | ||
| `).join(''); | ||
| pokedex.innerHTML = pokemonHTMLString; | ||
| // return cardColor(); | ||
| }; | ||
| // card.classList.add('card', `${pokeman.types[0].type.name}`, 'font-weight-bold'); | ||
| function cardColor() { | ||
| if (pokeman.type === 'grass') { | ||
| document.getElementsByClassName("card")[0].style.backgroundColor = "blue"; | ||
| } | ||
| }; | ||
| fetchPokemon(); | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,23 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Document</title> | ||
| <!-- <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> --> | ||
| <title>JAF's Pokedex</title> | ||
| <link rel="stylesheet" href="styles.css" /> | ||
| <!-- <link href="https://fonts.googleapis.com/css?family=Rubik&display=swap" rel="stylesheet" /> --> | ||
| </head> | ||
|
|
||
| <body> | ||
| <p>Hello Pokemon!</p> | ||
| <div class="container"> | ||
| <h1>JAF's Pokedex</h1> | ||
| <h2>Gotta catch'em all!</h2> | ||
| <ol id="pokedex"> </ol> | ||
|
|
||
| </div> | ||
| <script src="../rest/app.js"></script> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once you move the code above to |
||
| </body> | ||
|
|
||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| /*PokedexJAF.css*/ | ||
| /* testiing testing testing */ | ||
| body { | ||
| background-color: orangered; | ||
| color: white; | ||
| margin: 0; | ||
| font-family: rubik; | ||
| } | ||
|
|
||
| .container { | ||
| padding: 40px; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| h1 { | ||
| text-transform: uppercase; | ||
| text-align: center; | ||
| font-size: 20px; | ||
| font-style: pokemon; | ||
| } | ||
| h2{ | ||
| font-style: andybold; | ||
| text-align: center; | ||
| } | ||
|
|
||
| /* pokedex { | ||
| display: grid; | ||
| grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); | ||
| grid-gap: 20px; | ||
| padding-inline-start: 0; | ||
| } */ | ||
|
|
||
| .card { | ||
| height: 200px; | ||
| width: 180px; | ||
| list-style: none; | ||
| padding: 40px; | ||
| background-color: #f4f4f4; | ||
| color: #222; | ||
| text-align: center; | ||
| display: inline-block; | ||
| margin: 1%; | ||
| } | ||
|
|
||
| .card:hover { | ||
| animation: bounce 0.5s linear; | ||
| } | ||
|
|
||
| .card-title { | ||
| text-transform: capitalize; | ||
| margin-bottom: 0px; | ||
| font-size: 32px; | ||
| font-weight: normal; | ||
| } | ||
| .card-subtitle { | ||
| margin-top: 5px; | ||
| color: #666; | ||
| font-weight: lighter; | ||
| } | ||
|
|
||
| .card-image { | ||
| height: 180px; | ||
| } | ||
| /* text wrap */ | ||
| .fire { | ||
| background-color: firebrick; | ||
| } | ||
|
|
||
| .bug { | ||
| background-color: greenyellow; | ||
| } | ||
|
|
||
| .grass { | ||
| background-color: green; | ||
| } | ||
|
|
||
| .water { | ||
| background-color: aqua; | ||
| } | ||
|
|
||
| .normal { | ||
| background-color: burlywood; | ||
| } | ||
|
|
||
| .electric { | ||
| background-color: yellow; | ||
| } | ||
|
|
||
| .poison { | ||
| background-color: slateblue; | ||
| } | ||
|
|
||
| .ground { | ||
| background-color: chocolate; | ||
| } | ||
|
|
||
| .fairy { | ||
| background-color: pink; | ||
| } | ||
|
|
||
| .psychic { | ||
| background-color: rebeccapurple; | ||
| } | ||
|
|
||
| .rock { | ||
| background-color: grey; | ||
| } | ||
|
|
||
| .fighting { | ||
| background-color: crimson; | ||
| } | ||
|
|
||
| .ghost { | ||
| background-color: darkmagenta; | ||
| } | ||
|
|
||
| .ice { | ||
| background-color: darkturquoise; | ||
| } | ||
|
|
||
| .dragon { | ||
| background-color: olive; | ||
| } | ||
|
|
||
| .steel { | ||
| background-color: steelblue; | ||
| } | ||
|
|
||
| .dark { | ||
| background-color: darkslategrey; | ||
| } | ||
|
|
||
| .flying { | ||
| background-color: lightskyblue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to stick this logic in a javascript file. Your sql to create your database and tables should go here