Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 44 additions & 10 deletions project2/package-lock.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably keep the package lock as is, but it's not a problem

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

62 changes: 50 additions & 12 deletions project2/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,54 @@
function App() {
return <>
<header>
<h1>PokeDOX</h1>
<input type="search" placeholder="Search"></input>
</header>
<main>
// Mock data until we have a backend: 12 pokemon with id, name and placeholder url
const mockNames = [
'Bulbasaur',
'Ivysaur',
'Venusaur',
'Charmander',
'Charmeleon',
'Charizard',
'Squirtle',
'Wartortle',
'Blastoise',
'Caterpie',
'Metapod',
'Butterfree',
];

const mockPokemon = mockNames.map((name, i) => ({
id: i + 1,
name,
url: '#',
}));

</main>
<footer>
<span>Doxing all your favourite pokemon since 2026</span>
</footer>
</>;
function App() {
return (
<>
<header>
<h1>PokeDOX</h1>
<input
type="search"
placeholder="Search"
aria-label="Search pokemon"
></input>
</header>
<main>
<ul className="pokemon-grid">
{mockPokemon.map((pokemon) => (
<li key={pokemon.id} className="pokemon-card">
<div className="pokemon-image">
<img src={pokemon.url} alt={pokemon.name} />
</div>
<h2>{pokemon.name}</h2>
<span>#{String(pokemon.id).padStart(4, '0')}</span>
</li>
))}
</ul>
</main>
<footer>
<span>Doxing all your favourite pokemon since 2026</span>
</footer>
</>
);
}

export default App;
61 changes: 57 additions & 4 deletions project2/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
--bg: #fff;
--accent: #8888ff;

--card-bg: #f4f4f5;
--card-border: #e4e4e7;
--image-bg: #fff;

--sans: system-ui, 'Segoe UI', Roboto, sans-serif;
--heading: system-ui, 'Segoe UI', Roboto, sans-serif;
--mono: ui-monospace, Consolas, monospace;
Expand All @@ -29,6 +33,10 @@
--text-h: #f3f4f6;
--bg: #16171d;
--accent: #444488;

--card-bg: #161616;
--card-border: #2a2a2e;
--image-bg: #080808;
}
}

Expand All @@ -50,7 +58,7 @@ body {
margin: 0;
}

header{
header {
display: flex;
/*width: 100%;*/
color: var(--text-h);
Expand All @@ -59,16 +67,61 @@ header{
align-items: center;
justify-content: space-between;
}
footer{
footer {
padding: 1rem 2rem;
}

input{
input {
outline: none;
border: none;
border-radius: 1rem;
padding: 0.5rem 0.75rem;
width: 12rem;
min-width: 0;
}
input:focus, input:hover {

input:focus,
input:hover {
background: var(--bg);
}

.pokemon-grid {
list-style: none;
margin: 0;
padding: 1.5rem 2rem;
display: grid;
grid-template-columns: repeat(auto-fill, 14rem);
justify-content: center;
gap: 1.5rem;
}

.pokemon-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 1.75rem 1.75rem 2rem;
background: var(--card-bg);
border: 1px solid var(--card-border);
border-radius: 1.5rem;
}

.pokemon-image {
width: 100%;
aspect-ratio: 1;
display: grid;
place-items: center;
background: var(--image-bg);
border-radius: 1.25rem;
}

.pokemon-image img {
width: 75%;
height: auto;
image-rendering: pixelated;
}

.pokemon-card h2 {
margin: 1.25rem 0 0.25rem;
font-size: 1.4rem;
color: var(--text-h);
}