diff --git a/assets/css/detail.css b/assets/css/detail.css new file mode 100644 index 000000000..cafa5967e --- /dev/null +++ b/assets/css/detail.css @@ -0,0 +1,170 @@ +/* botao de sair */ +#pokemonDetail{ + padding: 0; + margin: 0; +} + +.detailCont{ + width: 100%; + height: 100%; +} + +.colorType{ + background: #11c711; +} +.paginacao2{ + display: flex; + flex-direction: row; + justify-content: left; + align-items: center; + width: 100%; + padding: 0.2rem; + } + + .paginacao2 button{ + background: #db6c6c; + border: none; + border-radius: 1rem; + color: #ffffff; + padding: .25rem .5rem; + font-size: .825rem; + } + + .paginacao2 button a{ + color: #fff; + text-decoration: none; + } + + /* imagem */ + + .imageDeteil{ + text-align: center; + margin: auto; + } + .imageDeteil img{ + display: block; + max-width: 40%; + min-width: 10%; + margin: auto; + } + + /* cabecalho */ + +.header{ + padding: 10px; + +} + +.name{ + color: #ffffff; + display: block; + font-size: 1.5rem; + margin: 10px; + text-transform: capitalize; + +} + +/* conteudo aba */ + +.detail{ + flex-direction: column; +} +.detail .types{ + list-style:none; + padding: 0px 0px; + margin: 20px 0px; + background: none; +} + +.detail .types .type{ + display: inline-block; + margin: 0.25rem 0; + border-radius: 1rem; + padding: 0.25rem 0.5rem; + margin: 0; + font-size: 0.675rem; + filter: brightness(1.1); +} + +.nunber{ + color: #696969; + display: block; + text-align: right; + padding: 0 20px; + margin: -60px 0 0 0; +} + +/* abas de detalhe */ +.contentDetail{ + background: #f3f1f1; + border-radius: 1rem; + padding: 1%; + width: 90%; + height: 100%; + margin: auto; +} + +.contentDetail .contentlist{ + list-style: none; + margin: 5%; + padding: 5% 0; + color: #00000062; +} + +.contentDetail .contentlist li{ + padding: 2% 0; + text-transform: capitalize; +} + +.contentDetail .contentlist span{ + padding: 10px; + color: #000000; + text-transform: capitalize; + font-size: 90%; +} + +.contentDetail h3{ + padding: 0.5rem; + margin: -0.9rem 0; +} + +/*----------------------------abas----------------------------*/ + +.abaContent{ + display: none; +} + +.abaContent.show{ + display: flex; +} + +.abaConteudo{ + background: #fdfcfc; + border-radius: 1rem; + margin: auto; + width: 22rem; + height: 25rem; +} + +.tabBtns{ + display: flex; + gap: 6px; + padding: 1rem; +} + +.tabBtn{ + margin: auto; + padding-bottom: 3%; + border: none; + color: #00000062; + background-color: #00000000; + cursor: pointer; + text-transform: capitalize; +} + +.active{ + border-bottom: #aaaaaa solid 5px; + border-radius: 5px; + font-weight:700; + color: #000000; +} \ No newline at end of file diff --git a/assets/css/global.css b/assets/css/global.css index 980e87861..da703b66c 100644 --- a/assets/css/global.css +++ b/assets/css/global.css @@ -1,24 +1,34 @@ -* { - font-family: 'Roboto', sans-serif; + +*{ + font-family: system-ui, 'Segoe UI', 'Open Sans', 'Helvetica Neue', sans-serif; box-sizing: border-box; } +.content{ + padding: 1rem; + background: #c94848 no-repeat fixed; +} + +.content h1{ + margin: 0; + text-align: center; + margin: .5rem 0; +} -body { +body{ background-color: #f6f8fc; } -.content { - width: 100vw; - height: 100vh; - padding: 1rem; - background-color: #fff; +a{ + list-style: none; + text-decoration: none; } @media screen and (min-width: 992px) { .content { - max-width: 992px; - height: auto; - margin: 1rem auto; - border-radius: 1rem; + max-width: 992px; + height: auto; + margin: 1rem auto; + border-radius: 1rem; } -} \ No newline at end of file +} + diff --git a/assets/css/nomalize.css b/assets/css/nomalize.css new file mode 100644 index 000000000..c45a85f89 --- /dev/null +++ b/assets/css/nomalize.css @@ -0,0 +1,349 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + + html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + } + + /* Sections + ========================================================================== */ + + /** + * Remove the margin in all browsers. + */ + + body { + margin: 0; + } + + /** + * Render the `main` element consistently in IE. + */ + + main { + display: block; + } + + /** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + + h1 { + font-size: 2em; + margin: 0.67em 0; + } + + /* Grouping content + ========================================================================== */ + + /** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + + hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ + } + + /** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + + pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ + } + + /* Text-level semantics + ========================================================================== */ + + /** + * Remove the gray background on active links in IE 10. + */ + + a { + background-color: transparent; + } + + /** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + + abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ + } + + /** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + + b, + strong { + font-weight: bolder; + } + + /** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + + code, + kbd, + samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ + } + + /** + * Add the correct font size in all browsers. + */ + + small { + font-size: 80%; + } + + /** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + + sub, + sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + sub { + bottom: -0.25em; + } + + sup { + top: -0.5em; + } + + /* Embedded content + ========================================================================== */ + + /** + * Remove the border on images inside links in IE 10. + */ + + img { + border-style: none; + } + + /* Forms + ========================================================================== */ + + /** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + + button, + input, + optgroup, + select, + textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ + } + + /** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + + button, + input { /* 1 */ + overflow: visible; + } + + /** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + + button, + select { /* 1 */ + text-transform: none; + } + + /** + * Correct the inability to style clickable types in iOS and Safari. + */ + + button, + [type="button"], + [type="reset"], + [type="submit"] { + -webkit-appearance: button; + } + + /** + * Remove the inner border and padding in Firefox. + */ + + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; + } + + /** + * Restore the focus styles unset by the previous rule. + */ + + button:-moz-focusring, + [type="button"]:-moz-focusring, + [type="reset"]:-moz-focusring, + [type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; + } + + /** + * Correct the padding in Firefox. + */ + + fieldset { + padding: 0.35em 0.75em 0.625em; + } + + /** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + + legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ + } + + /** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + + progress { + vertical-align: baseline; + } + + /** + * Remove the default vertical scrollbar in IE 10+. + */ + + textarea { + overflow: auto; + } + + /** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + + [type="checkbox"], + [type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + } + + /** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + + [type="number"]::-webkit-inner-spin-button, + [type="number"]::-webkit-outer-spin-button { + height: auto; + } + + /** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + + [type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ + } + + /** + * Remove the inner padding in Chrome and Safari on macOS. + */ + + [type="search"]::-webkit-search-decoration { + -webkit-appearance: none; + } + + /** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + + ::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ + } + + /* Interactive + ========================================================================== */ + + /* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + + details { + display: block; + } + + /* + * Add the correct display in all browsers. + */ + + summary { + display: list-item; + } + + /* Misc + ========================================================================== */ + + /** + * Add the correct display in IE 10+. + */ + + template { + display: none; + } + + /** + * Add the correct display in IE 10. + */ + + [hidden] { + display: none; + } \ No newline at end of file diff --git a/assets/css/pokedex.css b/assets/css/pokedex.css index 59eef2bde..815364dcb 100644 --- a/assets/css/pokedex.css +++ b/assets/css/pokedex.css @@ -1,165 +1,143 @@ -.pokemons { - display: grid; - grid-template-columns: 1fr; +.pokemons{ + list-style: none; margin: 0; padding: 0; - list-style: none; -} - -.normal { - background-color: #a6a877; -} - -.grass { - background-color: #77c850; -} - -.fire { - background-color: #ee7f30; -} - -.water { - background-color: #678fee; -} - -.electric { - background-color: #f7cf2e; -} - -.ice { - background-color: #98d5d7; -} - -.ground { - background-color: #dfbf69; -} - -.flying { - background-color: #a98ff0; -} - -.poison { - background-color: #a040a0; -} - -.fighting { - background-color: #bf3029; -} - -.psychic { - background-color: #f65687; -} - -.dark { - background-color: #725847; -} - -.rock { - background-color: #b8a137; -} - -.bug { - background-color: #a8b720; -} - -.ghost { - background-color: #6e5896; -} - -.steel { - background-color: #b9b7cf; -} - -.dragon { - background-color: #6f38f6; -} - -.fairy { - background-color: #f9aec7; + display: grid; + grid-template-columns: 1fr 1fr; } -.pokemon { - display: flex; - flex-direction: column; +.pokemon{ margin: .5rem; - padding: 1rem; + padding: 0 0.5rem; + color: white; border-radius: 1rem; + display: flex; + flex-direction: column; } -.pokemon .number { - color: #000; - opacity: .3; +.pokemon .number{ + color: #00000077; text-align: right; + padding: .25rem 1rem; font-size: .625rem; + display: flex; + flex-direction: column; } -.pokemon .name { - text-transform: capitalize; +.pokemon .name{ color: #fff; - margin-bottom: .25rem; + margin: .5rem 0; + margin-bottom: 0; + padding: 0 .25rem; + text-transform: capitalize; } -.pokemon .detail { +.pokemon .detail{ display: flex; flex-direction: row; align-items: center; justify-content: space-between; } -.pokemon .detail .types { - padding: 0; +.pokemon .detail .types{ + padding: 0 0.25rem; margin: 0; list-style: none; } -.pokemon .detail .types .type { - color: #fff; + +.pokemon .detail .types .type{ + color: white; padding: .25rem .5rem; - margin: .25rem 0; font-size: .625rem; + margin: .25rem 0; border-radius: 1rem; filter: brightness(1.1); text-align: center; } -.pokemon .detail img { - max-width: 100%; - height: 70px; -} - -.pagination { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - width: 100%; - padding: 1rem; -} - -.pagination button { - padding: .25rem .5rem; - margin: .25rem 0; - font-size: .625rem; - color: #fff; - background-color: #6c79db; - border: none; - border-radius: 1rem; -} - -@media screen and (min-width: 380px) { +.pokemon .detail img{ + max-width: 70%; + height: 7rem; + padding: 0.3em; +} + +.pagination{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + width: 100%; + padding: 1rem; +} + +.pagination #loadMoreButton{ + background: #6c79db; + border: none; + border-radius: 1rem; + color: white; + padding: .25rem .5rem; + font-size: .625rem; +} + +.normal{ + background-color: #a6a877;} +.grass{ + background-color: #77c850;} +.fire{ + background-color: #ee7f30;} +.water{ + background-color: #678fee;} +.electric{ + background-color: #f7cf2e;} +.ice{ + background-color: #98d5d7;} +.ground{ + background-color: #dfbf69;} +.flying{ + background-color: #a98ff0;} +.poison{ + background-color: #a040a0;} +.fighting{ + background-color: #bf3029;} +.psychic{ + background-color: #f65687;} +.dark{ + background-color: #725847;} +.rock{ + background-color: #b8a137;} +.bug{ + background-color: #a8b720;} +.ghost{ + background-color: #6e5896;} +.steel{ + background-color: #b9b7cf;} +.dragon{ + background-color: #6f38f6;} +.fairy{ + background-color: #f9aec7;} + + +@media screen and (min-width: 300px) { .pokemons { - grid-template-columns: 1fr 1fr; + grid-template-columns: 1fr; } -} + } + + @media screen and (min-width: 450px) { + .pokemons { + grid-template-columns: 1fr 1fr; + } + } @media screen and (min-width: 576px) { .pokemons { grid-template-columns: 1fr 1fr 1fr; } -} + } @media screen and (min-width: 992px) { .pokemons { grid-template-columns: 1fr 1fr 1fr 1fr; } -} \ No newline at end of file + } diff --git a/assets/js/poke-api.js b/assets/js/poke-api.js deleted file mode 100644 index 38fbfd465..000000000 --- a/assets/js/poke-api.js +++ /dev/null @@ -1,35 +0,0 @@ - -const pokeApi = {} - -function convertPokeApiDetailToPokemon(pokeDetail) { - const pokemon = new Pokemon() - pokemon.number = pokeDetail.id - pokemon.name = pokeDetail.name - - const types = pokeDetail.types.map((typeSlot) => typeSlot.type.name) - const [type] = types - - pokemon.types = types - pokemon.type = type - - pokemon.photo = pokeDetail.sprites.other.dream_world.front_default - - return pokemon -} - -pokeApi.getPokemonDetail = (pokemon) => { - return fetch(pokemon.url) - .then((response) => response.json()) - .then(convertPokeApiDetailToPokemon) -} - -pokeApi.getPokemons = (offset = 0, limit = 5) => { - const url = `https://pokeapi.co/api/v2/pokemon?offset=${offset}&limit=${limit}` - - return fetch(url) - .then((response) => response.json()) - .then((jsonBody) => jsonBody.results) - .then((pokemons) => pokemons.map(pokeApi.getPokemonDetail)) - .then((detailRequests) => Promise.all(detailRequests)) - .then((pokemonsDetails) => pokemonsDetails) -} diff --git a/assets/js/pokemon-model.js b/assets/js/pokemon-model.js deleted file mode 100644 index b0d17bb90..000000000 --- a/assets/js/pokemon-model.js +++ /dev/null @@ -1,8 +0,0 @@ - -class Pokemon { - number; - name; - type; - types = []; - photo; -} diff --git a/assets/script/detailJS.js b/assets/script/detailJS.js new file mode 100644 index 000000000..cc626d7d4 --- /dev/null +++ b/assets/script/detailJS.js @@ -0,0 +1,111 @@ +const pokemonDetail = document.getElementById("pokemonDetail"); +const abaAbaut = document.getElementById("about") +const abaBase = document.getElementById("base") +const abaEvolution = document.getElementById("evolution") +const abaMoves = document.getElementById("moves") + +function convertPokemonToPage(pokemon) { // manimula a dom e ecrementa informações da api + return ` +