-
Notifications
You must be signed in to change notification settings - Fork 0
Part one answer #1
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
Draft
orbitalbitmap
wants to merge
9
commits into
master
Choose a base branch
from
part-one-answer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e7e2f3f
Added the eslint and pug-lint rules to master
orbitalbitmap c01f9b7
Actually added the pug-lint rules.
orbitalbitmap 6063543
Initial commit for branch part-one-answer.
orbitalbitmap ed460ce
Set up some of the documentatin site and some of the styling.
orbitalbitmap 860fc4c
Added some more styling and added the functionality to show and hide …
orbitalbitmap d9e11ec
Split the index.pug into partials, added a javascript folder in publi…
orbitalbitmap 8da6bb6
Adjusted styles.css to be sorted and adjusted some styling.
orbitalbitmap 088fc2c
Took out some code that wasn't doing anything in styles.css.
orbitalbitmap 332c07c
Minor styling changes.
orbitalbitmap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,62 @@ | ||
| module.exports = { | ||
| "env": { | ||
| "es6": true, | ||
| "node": true, | ||
| }, | ||
| "extends": "eslint:recommended", | ||
| "parserOptions": { | ||
| "ecmaVersion": 2018, | ||
| "sourceType": "module" | ||
| }, | ||
| "rules": { | ||
| "array-bracket-spacing": ["error", "never"], | ||
| "array-element-newline": ["error", "consistent"], | ||
| "arrow-spacing": ["error", { "before": true, "after": true }], | ||
| "block-spacing": "error", | ||
| "camelcase": 0, | ||
| "comma-spacing": ["error", { "before": false, "after": true }], | ||
| "computed-property-spacing": ["error", "never"], | ||
| "dot-location": ["error", "property"], | ||
| "eol-last": ["error", "always"], | ||
| "func-call-spacing": ["error", "never"], | ||
| "function-paren-newline": ["error", "never"], | ||
| "implicit-arrow-linebreak": ["error", "beside"], | ||
| "indent": ["error", 2, { "SwitchCase": 1 }], | ||
| "key-spacing": ["error", { "afterColon": true }], | ||
| "keyword-spacing": ["error", { "before": true, "after": true }], | ||
| "linebreak-style": ["error", "unix"], | ||
| "max-len": ["error", { "code": 120, "ignoreComments": true, "ignoreTrailingComments": true }], | ||
| "no-console": "error", | ||
| "no-case-declarations": 0, | ||
| "no-mixed-spaces-and-tabs": "error", | ||
| "no-multi-spaces": "error", | ||
| "no-spaced-func": "error", | ||
| "no-trailing-spaces": ["error", { "ignoreComments": true }], | ||
| "no-whitespace-before-property": "error", | ||
| "nonblock-statement-body-position": ["error", "beside"], | ||
| "object-curly-newline": ["error", { "multiline": true, "minProperties": 5, "consistent": true }], | ||
| "object-curly-spacing": ["error", "always", { "arraysInObjects": true, "objectsInObjects": true }], | ||
| "object-property-newline": ["error", { "allowAllPropertiesOnSameLine": true }], | ||
| "one-var": ["error", "never"], | ||
| "operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" } }], | ||
| "padded-blocks": ["error", "never"], | ||
| "padding-line-between-statements": [ | ||
| "error", | ||
| { blankLine: "always", prev: "*", next: "return" }, | ||
| { blankLine: "always", prev: ["const", "let", "var"], next: "*" }, | ||
| { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"] }, | ||
| ], | ||
| "quotes": ["error", "single"], | ||
| "rest-spread-spacing": ["error", "never"], | ||
| "space-before-blocks": "error", | ||
| "space-before-function-paren": ["error", { "anonymous": "always", "named": "never", "asyncArrow": "always" }], | ||
| "space-in-parens": ["error", "never"], | ||
| "space-infix-ops": "error", | ||
| "space-unary-ops": "error", | ||
| "spaced-comment": ["error", "always"], | ||
| "semi": ["error", "never"], | ||
| "semi-spacing": ["error", { "before": false, "after": true }], | ||
| "switch-colon-spacing": "error", | ||
| "template-tag-spacing": ["error", "always"], | ||
| } | ||
| }; |
This file contains hidden or 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,24 @@ | ||
| module.exports = { | ||
| disallowAttributeConcatenation: true, | ||
| disallowBlockExpansion: true, | ||
| disallowClassLiterals: true, | ||
| disallowDuplicateAttributes: true, | ||
| disallowHtmlText: true, | ||
| disallowIdLiterals: true, | ||
| disallowLegacyMixinCall: true, | ||
| disallowMultipleLineBreaks: true, | ||
| disallowSpacesInsideAttributeBrackets: true, | ||
| disallowStringConcatenation: 'aggressive', | ||
| disallowTagInterpolation: true, | ||
| disallowTrailingSpaces: true, | ||
| requireLineFeedAtFileEnd: true, | ||
| requireLowerCaseAttributes: true, | ||
| requireLowerCaseTags: true, | ||
| requireSpaceAfterCodeOperator: true, | ||
| requireStrictEqualityOperators: true, | ||
| validateAttributeQuoteMarks: '"', | ||
| validateExtensions: true, | ||
| validateIndentation: 2, | ||
| validateLineBreaks: 'LF', | ||
| validateTemplateString: true | ||
| } |
This file contains hidden or 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 @@ | ||
| const express = require('express') | ||
|
|
||
| const app = express() | ||
|
|
||
| app.set('view engine', 'pug') | ||
| app.use(express.static('public')) | ||
|
|
||
| app.get('/', (request, response) => { | ||
| return response.status(200).render('index') | ||
| }) | ||
|
|
||
| app.all('*', (request, response) => { | ||
| return response.status(404).send('Looks like you found nothing in the pokedex.') | ||
| }) | ||
|
|
||
| app.listen(1337, () => { | ||
| console.log('Listening on 1337...')// eslint-disable-line no-console | ||
| }) |
This file contains hidden or 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 hidden or 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,83 @@ | ||
| body{ | ||
| margin-top: 150px; | ||
| } | ||
|
|
||
| h2{ | ||
| text-align: center; | ||
| } | ||
|
|
||
| h3{ | ||
| margin-bottom: 5px; | ||
| } | ||
|
|
||
| .delete{ | ||
| color: crimson; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .delete, .get, .post{ | ||
| padding-right: 10px; | ||
| } | ||
|
|
||
| .get{ | ||
| color: green; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .hidden{ | ||
| display: none; | ||
| } | ||
|
|
||
| .highlighted{ | ||
| background-color: lightgray; | ||
| position: relative; | ||
| width: 320px; | ||
| } | ||
|
|
||
| .highlighted:after { | ||
| bottom: 0; | ||
| border-bottom: 15px solid transparent; | ||
| border-left: 15px solid lightgray; | ||
| border-top: 15px solid transparent; | ||
| content: ""; | ||
| position: absolute; | ||
| right: -15px; | ||
| width: 0; | ||
| } | ||
|
|
||
| .left-container{ | ||
| margin: 0px 30px; | ||
| width: 320px; | ||
| } | ||
|
|
||
| .main-container{ | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .post{ | ||
| color: darkorange; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .right-container{ | ||
| margin: 0px 20px; | ||
| position: relative; | ||
| width: 440px; | ||
| } | ||
|
|
||
| .spacing{ | ||
| margin: 20px 0px; | ||
| padding-left: 20px; | ||
| } | ||
|
|
||
| .tabs{ | ||
| cursor: pointer; | ||
| font-size: 20px; | ||
| letter-spacing: 1px; | ||
| margin: 30px 0; | ||
| padding-top: 4px; | ||
| padding-left: 5px; | ||
| padding-bottom: 3px; | ||
| } |
This file contains hidden or 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 @@ | ||
| /* eslint-disable no-undef */ | ||
| // eslint-disable-next-line no-unused-vars | ||
| const updateSelected = (id) => { | ||
| const tabs = document.getElementsByClassName('tabs') | ||
| const methods = document.getElementsByClassName('method') | ||
|
|
||
| for (let i = 0; i < tabs.length; i++) { | ||
| tabs[i].id === id | ||
| ? tabs[i].classList.add('highlighted') | ||
| : tabs[i].classList.remove('highlighted') | ||
| } | ||
|
|
||
| for (let i = 0; i < methods.length; i++) { | ||
| methods[i].id === id | ||
| ? methods[i].classList.remove('hidden') | ||
| : methods[i].classList.add('hidden') | ||
| } | ||
| } |
This file contains hidden or 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,13 @@ | ||
| html | ||
| head | ||
| title Pokemon API | ||
| link(rel="stylesheet" href="/css/styles.css") | ||
| script(src="/javascripts/indexPugInteraction.js") | ||
|
|
||
| body | ||
| h2 Welcome to the Pokemon API | ||
| div(class="main-container") | ||
|
|
||
| include partials/leftSideDocumentation.pug | ||
|
|
||
| include partials/rightSideDocumentaion.pug |
This file contains hidden or 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,19 @@ | ||
| div(class="left-container") | ||
|
Collaborator
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 design looks familiar 😂 |
||
| div(class="tabs highlighted" id="getAll" onclick="updateSelected('getAll')") | ||
| span(class="get") GET | ||
| span /pokemon | ||
| div(class="tabs" id="getGeneration" onclick="updateSelected('getGeneration')") | ||
| span(class="get") GET | ||
| span /generation/{genId} | ||
|
|
||
| div(class="tabs" id="getPokemonById" onclick="updateSelected('getPokemonById')") | ||
| span(class="get") GET | ||
| span /pokemon/{pokemonId} | ||
|
|
||
| div(class="tabs" id="postPokemon" onclick="updateSelected('postPokemon')") | ||
| span(class="post") POST | ||
| span /pokemon | ||
|
|
||
| div(class="tabs" id="deletePokemonById" onclick="updateSelected('deletePokemonById')") | ||
| span(class="delete") DELETE | ||
| span /pokemon/{pokemonId} | ||
This file contains hidden or 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,52 @@ | ||
| div(class="right-container") | ||
| div(class="method" id="getAll") | ||
| h3 Method | ||
| div(class="get spacing") GET | ||
| h3 Route | ||
| div(class="spacing") http://localhost:1337/pokemon | ||
| h3 Headers | ||
| div(class="spacing") None needed | ||
| h3 Decription | ||
| div(class="spacing") Returns a list all of the pokemon in the databse. | ||
|
|
||
| div(class="method hidden" id="getGeneration") | ||
| h3 Method | ||
| div(class="spacing get") GET | ||
| h3 Route | ||
| div(class="spacing") http://localhost:1337/pokemon/generations/{genId} | ||
| h3 Headers | ||
| div(class="spacing") None needed | ||
| h3 Decription | ||
| div(class="spacing") Returns the generation list of all pokemon associated with {genId}. | ||
|
|
||
| div(class="method hidden" id="getPokemonById") | ||
| h3 Method | ||
| div(class="spacing get") GET | ||
| h3 Route | ||
| div(class="spacing") http://localhost:1337/pokemon/pokemon/{pokemonId} | ||
| h3 Headers | ||
| div(class="spacing") None needed | ||
| h3 Decription | ||
| div(class="spacing") Returns the pokemon associated with the {id} (Id's are also the pokemon's pokedex number). | ||
|
|
||
| div(class="method hidden" id="postPokemon") | ||
| h3 Method | ||
| div(class="spacing post") POST | ||
| h3 Route | ||
| div(class="spacing") http://localhost:1337/pokemon | ||
| h3 Headers | ||
| div(class="spacing") Content-Type: application/json | ||
| h3 Body | ||
| div(class="spacing") { "gen": "1", "name": "Bulbasaur", "Types": "['grass', 'poison']" } | ||
| h3 Decription | ||
| div(class="spacing") Returns a list all of the pokemon in the databse. | ||
|
|
||
| div(class="method hidden" id="deletePokemonById") | ||
| h3 Method | ||
| div(class="spacing delete") DELETE | ||
| h3 Route | ||
| div(class="spacing") http://localhost:1337/pokemon/pokemon/{pokemonId} | ||
| h3 Headers | ||
| div(class="spacing") None needed | ||
| h3 Decription | ||
| div(class="spacing") Deletes the pokemon associated with the {id} (Id's are also the pokemon's pokedex number). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
"lint": "npm run lint:puglint && npm run lint:eslint",Someone didn't use this command