Skip to content
Merged

Dev #47

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1c9fca8
Merge pull request #35 from IT2810-H26/vitest
halvortf Sep 17, 2026
969e96b
Border at bottom, bigger title, and more
Sep 17, 2026
0cbecb8
Grouped with divs for more css functionality
Sep 17, 2026
920c819
Styling for the team grid, and more
Sep 17, 2026
e4b2e61
Cleaning up .header class
Sep 17, 2026
e92cbcb
Styling footer to fit in with the website
Sep 17, 2026
dd18efe
Changed title from just Link object to h1 object
Sep 17, 2026
30cdff6
Fixes for h1 change to title
Sep 17, 2026
bcc05eb
Margin change in title
Sep 17, 2026
15d6607
Updated old className in @media
ayseza Sep 17, 2026
13500e3
feat: Added About.css and edited about text.
ayseza Sep 17, 2026
17d5c70
feat: Enlarged the textbox and dropdowns
ayseza Sep 17, 2026
e9b1ff1
Merge pull request #38 from IT2810-H26/main
halvortf Sep 17, 2026
ad84336
Merge pull request #39 from IT2810-H26/group_team
halvortf Sep 17, 2026
c944a3b
Merge pull request #40 from IT2810-H26/about_dropdowns
halvortf Sep 17, 2026
10b7d28
Added footer to about page
Sep 17, 2026
0bde36a
Added footer to about page
Sep 17, 2026
e2c9a8c
fix: Made footer stick to bottom
Sep 17, 2026
52b19fe
Added extra divs for App.css file
Sep 17, 2026
15c9ae4
Text update
ayseza Sep 18, 2026
9bc45d2
Merge pull request #42 from IT2810-H26/fix_footer_position
halvortf Sep 18, 2026
04769d2
Improved performance of test
Sep 18, 2026
4cefbe2
Indent change in prettier
Sep 18, 2026
ed32506
Installed prettier and setup to match ESLint
Sep 18, 2026
a13491b
Changes with prettier
Sep 18, 2026
1e97ac0
Merge pull request #44 from IT2810-H26/vitest_performance
halvortf Sep 18, 2026
ea89749
docs: Added a paragraph on how to use the filters.
ayseza Sep 18, 2026
efdfeb4
Merge pull request #45 from IT2810-H26/about_text
halvortf Sep 18, 2026
a6da654
Resizing for devices with max-width <= 600px
Sep 18, 2026
0bc44fb
Reduced typings to exclude stellar
Sep 18, 2026
9df39bd
Merge pull request #46 from IT2810-H26/css_for_mobile
halvortf Sep 18, 2026
5573d48
fix: vitetest feedback
Sep 18, 2026
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
3 changes: 3 additions & 0 deletions PTG/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 4
}
2 changes: 2 additions & 0 deletions PTG/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
import eslintConfigPrettier from "eslint-config-prettier/flat";

export default defineConfig([
globalIgnores(['dist']),
Expand All @@ -19,4 +20,5 @@ export default defineConfig([
globals: globals.browser,
},
},
eslintConfigPrettier,
])
2 changes: 2 additions & 0 deletions PTG/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
"@vitejs/plugin-react": "^6.1.0",
"babel-plugin-react-compiler": "^1.0.0",
"eslint": "^10.9.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.4",
"globals": "^17.11.0",
"jsdom": "^30.0.1",
"prettier": "3.9.8",
"typescript": "~6.0.2",
"typescript-eslint": "^8.67.0",
"vite": "^8.2.2",
Expand Down
23 changes: 23 additions & 0 deletions PTG/pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions PTG/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
minimumReleaseAgeExclude:
- '@tanstack/query-core@5.103.0'
- '@tanstack/react-query@5.103.0'
- prettier@3.9.8
24 changes: 24 additions & 0 deletions PTG/src/About.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.container {
display: flex;
flex-direction: column;
align-items: center;
margin: 0 15vw;
min-height: calc(93.5vh - 60px);
}

.footer-pin {
position: relative;
bottom: 0;
left: 0;
}

p {
text-align: justify;
margin-bottom: 1rem;
}

@media screen and (max-width: 600px) {
.container{
margin: 1rem;
}
}
54 changes: 37 additions & 17 deletions PTG/src/About.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
import Header from "./Header.tsx"
import Header from "./Header.tsx";
import Footer from "./Footer.tsx";
import "./About.css";


export default function About(){
return(
export default function About() {
return (
<>
<Header />
<h1>About</h1>
<p>
This is the result of a group project in IT2810 at NTNU.
Yes, we are aware that each Pokédex takes in National Dex as well, so
it is possible getting, e.g. Charizard when picking HG/SS.
This results in end game Pokémon showing up in the Team Generator.
Please be aware of this when generating a team.
</p>
<p>
This website is made by students, and is made for training reasons,
also for lazy people not wanting to pick a team themselves.
</p>
<div className="container">
<h1>About</h1>
<p>
This is the result of a group project in IT2810 at the
Norwegian University of Science and Technology (NTNU) by
Team-33. Yes, we are aware that each Pokédex takes in
National Dex as well, so it is possible getting, e.g.
Charizard when picking HG/SS. This results in end game
Pokémon showing up in the Team Generator. Please be aware of
this when generating a team.
</p>
<p>
To randomly generate your team simply click the "Generate
Team" button. If you would like to keep a pokémon in the
team click the star icon. Balance your team by choosing
from different types and/or games. This can be done by using
the type and game filters at the top of the home page in combination
with the generate button.
</p>
<p>
This website is made by students, and is made for training
reasons, also for lazy people not wanting to pick a team
themselves. Contact information can be found at the footer
of the home page and this page. Any feedback will be deeply
appreciated, as it will be used as a tool to sharpen our
skills and improve our work in the second project.
</p>
</div>
<div className="footer-pin">
<Footer />
</div>
</>
);
}
}
9 changes: 9 additions & 0 deletions PTG/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.content {
min-height: calc(100vh - 60px);
}

.footer-pin {
position: relative;
bottom: 0;
left: 0;
}
89 changes: 55 additions & 34 deletions PTG/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,66 @@
import { useEffect, useState } from "react";
import Header from "./Header.tsx"
import Footer from "./Footer.tsx"
import Header from "./Header.tsx";
import Footer from "./Footer.tsx";
import "./App.css";
import ChoosePokemon from "./ChoosePokemon.tsx";
import Team from "./Team.tsx";
import PokemonGrid from "./PokemonGrid.tsx";
import { loadStoredFilters, saveStoredFilters } from "./pokemonFilters.ts";
import { usePokemonTeam } from "./usePokemonTeam.ts";

export default function App(){
const [selectedGame, setSelectedGame] = useState(() => loadStoredFilters().selectedGame);
const [selectedType, setSelectedType] = useState(() => loadStoredFilters().selectedType);
const [selectedName, setSelectedName] = useState(() => loadStoredFilters().selectedName);
export default function App() {
const [selectedGame, setSelectedGame] = useState(
() => loadStoredFilters().selectedGame,
);
const [selectedType, setSelectedType] = useState(
() => loadStoredFilters().selectedType,
);
const [selectedName, setSelectedName] = useState(
() => loadStoredFilters().selectedName,
);

useEffect(() => {
saveStoredFilters({ selectedGame, selectedType, selectedName });
}, [selectedGame, selectedType, selectedName]);
useEffect(() => {
saveStoredFilters({ selectedGame, selectedType, selectedName });
}, [selectedGame, selectedType, selectedName]);

const { team, pokemonById, typeMap, allFavourited, generateTeam, toggleFavourite } = usePokemonTeam(selectedGame, selectedType, selectedName);
const {
team,
pokemonById,
typeMap,
allFavourited,
generateTeam,
toggleFavourite,
} = usePokemonTeam(selectedGame, selectedType, selectedName);

return(
<div>
<Header />
<ChoosePokemon
selectedGame={selectedGame}
selectedType={selectedType}
selectedName={selectedName}
onGameChange={setSelectedGame}
onTypeChange={setSelectedType}
onNameChange={setSelectedName}
/>
<Team
team={team}
pokemonById={pokemonById}
typeMap={typeMap}
allFavourited={allFavourited}
generateTeam={generateTeam}
toggleFavourite={toggleFavourite}
/>
<PokemonGrid selectedGame={selectedGame} selectedType={selectedType} selectedName={selectedName} />
<Footer/>
</div>

);
return (
<div>
<div className="content">
<Header />
<ChoosePokemon
selectedGame={selectedGame}
selectedType={selectedType}
selectedName={selectedName}
onGameChange={setSelectedGame}
onTypeChange={setSelectedType}
onNameChange={setSelectedName}
/>
<Team
team={team}
pokemonById={pokemonById}
typeMap={typeMap}
allFavourited={allFavourited}
generateTeam={generateTeam}
toggleFavourite={toggleFavourite}
/>
<PokemonGrid
selectedGame={selectedGame}
selectedType={selectedType}
selectedName={selectedName}
/>
</div>
<div className="footer-pin">
<Footer />
</div>
</div>
);
}
33 changes: 25 additions & 8 deletions PTG/src/ChoosePokemon.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
.chooseType {
field-sizing: content;
width: fit-content;
max-width: 100%;
field-sizing: content;
width: fit-content;
max-width: 100%;
margin-left: 1rem;

min-height: 1.5rem;
border-radius: 0;
height: 20px;
}

.chooseName {
field-sizing: content;
width: fit-content;
max-width: 100%;
margin-left: 1rem;
}
field-sizing: content;
width: fit-content;
max-width: 100%;
min-width: 50px;
margin-left: 1rem;
margin-bottom: 5px;
height: 20px;
}

@media screen and (max-width: 600px){
.chooseName{
margin: 5px;
}
.chooseType{
margin: 5px;
}
}
Loading