Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
d293634
add html skeleton for start page
gabriellaberko Oct 28, 2025
f84416f
add html skeleton for quiz page + some minor styling to position elem…
gabriellaberko Oct 29, 2025
ab78557
install Tailwind
gabriellaberko Oct 29, 2025
8fad25c
add function for fetching API quiz data
gabriellaberko Oct 29, 2025
aade19d
add array of new mapped objects from fetch + add interfaces + tailwin…
gabriellaberko Oct 29, 2025
74a4317
add variables in API url + save questionArray to local storage for te…
gabriellaberko Oct 30, 2025
15e7c09
added logic to collect user and set to storage
daniellauding Oct 30, 2025
6e69c91
added logic to collect user and set to storage
daniellauding Oct 30, 2025
1ad9b37
add to-do comments for logic + and add function for inserting questio…
gabriellaberko Oct 30, 2025
e2d0051
add merge changes
gabriellaberko Oct 30, 2025
7279988
get filter values from local storage
gabriellaberko Oct 30, 2025
88226ac
mmm
daniellauding Oct 30, 2025
6eed605
remove doublets of code and clean code
gabriellaberko Oct 30, 2025
1658bff
clean code
gabriellaberko Oct 30, 2025
1316c8f
shuffle the answers so correct answer is not always last + insert que…
gabriellaberko Oct 30, 2025
d0c2d73
merged with main and setup scoreboard functionality
daniellauding Oct 30, 2025
d1153ab
merged with main and setup scoreboard functionality
daniellauding Oct 30, 2025
098bdab
fixed posting to scoreboard
daniellauding Oct 30, 2025
daab95d
fixed last button
daniellauding Oct 31, 2025
d90ba2b
Merge pull request #1 from gabriellaberko/scoreboard
gabriellaberko Oct 31, 2025
b75f8c8
add event listeners for quiz buttons + add a function that increments…
gabriellaberko Oct 31, 2025
ed56176
fix error
gabriellaberko Oct 31, 2025
80cc3f0
refactor incrementIndex function
gabriellaberko Oct 31, 2025
6938dea
adding name property to raido buttons so only one can be chosen
gabriellaberko Oct 31, 2025
83bd5f1
add validation to form and type submit to its button + refactor event…
gabriellaberko Oct 31, 2025
57463c0
clean code + fix issue with empty h1 in HTML code
gabriellaberko Oct 31, 2025
0000981
add function for checking if user choice match answer and add styling…
gabriellaberko Nov 3, 2025
8c37476
add button styling in checkAnswer
gabriellaberko Nov 3, 2025
897fb41
add div and message for displaying correct/incorrect answer
gabriellaberko Nov 3, 2025
e4bce7f
add function for counting score and saving it to quizSettings in loca…
gabriellaberko Nov 3, 2025
f207451
fix bug with message of right/wrong answer
gabriellaberko Nov 3, 2025
52e1180
change conclusion messages
gabriellaberko Nov 3, 2025
214226b
fix TypeScript errors + add styling on conclusion message and answer …
gabriellaberko Nov 3, 2025
7640745
add styling to conclusion message
gabriellaberko Nov 3, 2025
42185e8
added stepper functionality
daniellauding Nov 3, 2025
ee42bfa
added stepper functionality
daniellauding Nov 3, 2025
2d1798d
added stepper functionality
daniellauding Nov 3, 2025
3f4823e
fix styling on footer elements + conclusion message
gabriellaberko Nov 3, 2025
62dfe42
add some minor styling
gabriellaberko Nov 3, 2025
817ef43
fix border-radius
gabriellaberko Nov 3, 2025
4591695
adding styling to scoreboard.html
marinalendt-png Nov 3, 2025
6fb9315
Merge pull request #3 from gabriellaberko/quiz-page-styling
marinalendt-png Nov 4, 2025
7f1fc06
Merge branch 'main' into quizStepper
marinalendt-png Nov 4, 2025
422a7aa
Merge pull request #2 from gabriellaberko/quizStepper
marinalendt-png Nov 4, 2025
594e6ff
fix bug with comparison due to special characters with a decoding fun…
gabriellaberko Nov 4, 2025
f0dc043
merging style
daniellauding Nov 4, 2025
a88e790
merging style
daniellauding Nov 4, 2025
578a94a
modal for celebration done
daniellauding Nov 4, 2025
baddfc2
center question on quiz page
gabriellaberko Nov 4, 2025
747e2ac
fixing more styling
marinalendt-png Nov 4, 2025
194421e
Style startpage
LeonEkelund Nov 4, 2025
22545e3
Merge pull request #6 from gabriellaberko/startpage-styling
gabriellaberko Nov 4, 2025
4c9d2af
Merge branch 'main' into styling-scoreboard
gabriellaberko Nov 4, 2025
747778f
Merge pull request #5 from gabriellaberko/styling-scoreboard
gabriellaberko Nov 4, 2025
3f960ab
Merge branch 'main' into celebrationModal
gabriellaberko Nov 4, 2025
816e94f
Merge pull request #4 from gabriellaberko/celebrationModal
gabriellaberko Nov 4, 2025
5644857
add event listeners on buttons on quiz page with keyboard navigation
gabriellaberko Nov 4, 2025
9ec0d8d
fix full width only on wrapper on quiz page
gabriellaberko Nov 4, 2025
d4ee981
enable tab navigation + focus management on start page
gabriellaberko Nov 5, 2025
a458a10
make start page more accessible with landmarks, adjusting semantic e…
gabriellaberko Nov 5, 2025
333a71b
adjust text size
gabriellaberko Nov 5, 2025
7d04da9
remove position functionality in scoreboard
gabriellaberko Nov 5, 2025
ab013f7
add outline on svg on start page
gabriellaberko Nov 5, 2025
394cd41
improve accessibility with landmarks on all pages
gabriellaberko Nov 5, 2025
678653f
make play again button work + accessibility on scoreboard page
gabriellaberko Nov 5, 2025
5b3e066
add outline on svg on scoreboard page to make tabbing work on it
gabriellaberko Nov 5, 2025
3f27d5a
make keyboard navigation work on filter form on scoreboard page
gabriellaberko Nov 5, 2025
9cad12a
update h-screen to h-[100dvh] for better mobile optimization
daniellauding Nov 5, 2025
f9b60b7
make keydown space do a click on play again button on scoreboard page
gabriellaberko Nov 5, 2025
c1f816f
merge
gabriellaberko Nov 5, 2025
eda04f5
make keyboard navigation work on celebration dialog
gabriellaberko Nov 6, 2025
e32be03
structuring scoreboard-table
marinalendt-png Nov 6, 2025
d22728f
removed console.log
daniellauding Nov 6, 2025
e05fd0f
fixed errors
daniellauding Nov 6, 2025
a6418a7
Merge branch 'main' into scoreboard-table
LeonEkelund Nov 6, 2025
40c6f83
Merge pull request #7 from gabriellaberko/scoreboard-table
LeonEkelund Nov 6, 2025
4f884ea
removing border scoreboard
marinalendt-png Nov 6, 2025
8070ca4
making scoreboard table tabable
marinalendt-png Nov 6, 2025
6678165
fixed errors
daniellauding Nov 6, 2025
f6a6222
fixed errors
daniellauding Nov 6, 2025
9ccf66e
adding accessibility to celebration pop-up-site
marinalendt-png Nov 6, 2025
ae28cef
fixed logic for scoreboard
daniellauding Nov 6, 2025
86fa66e
fixed timer
daniellauding Nov 6, 2025
56d67ae
fixed timer
daniellauding Nov 6, 2025
6283f38
Merge branch 'main' into accessibility-celebration
marinalendt-png Nov 6, 2025
80ff318
fixing more bugs in celebration-pop-up
marinalendt-png Nov 6, 2025
b7a97a8
fixing small typos i js
marinalendt-png Nov 6, 2025
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
Binary file added .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
./dist
71 changes: 67 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,72 @@
# Web Accessibility Project

A basic web server template focused on web accessibility practices.
# What?
- Show quiz from API based on user preferences (filter/etc)
- When in chosen quiz view, show questions and answers
- Show score after finished a quiz

### Installation
- Scorelist (stretch ev)

1. Fork this repository by clicking the "Fork" button at the top right of the GitHub repository page.
# Views
#### Landing page/start

2. Clone your forked repository
# Welcome message
- Show a navigation of filters
- Start game
- Enter player name
- See top list (?)

# A quiz page
- Question
- Answers
- Show correct/incorrect answer when chosen submitting an answer
- Next question button
- Show total quiz time
- Remaining time on the question?
- Navigation back to welcome page
- Stop?

# Results page
- Final score
- Restart game/back to homepage
- Leaderboard

# Functionality
- Choose a category/other filter (?)
- Fetch data based on chosen filters
- List of questions
- Choose instant feedback during the quiz (correct/incorrect answer)
- Enter player name
- Player score
- Timer (?)
- Start / Stop game
-

# Tech
- Tailwind
- Typescript
- API
- CSS + HTML

# Requirement
- Accessible
- Keyboard, focus, ARIA, Color contrast etc (check scope)

### TODO
1)
- Setup HTML
- Set up Tailwind
- Setup API
- Fetch based on user input
- Put to Github issues/Project

2)
- JS to render quiz
- JS to render questions
- JS to respond on user choose correct or wrong
- JS to show timer
- JS to start stop
- Setup Postgres for user + topscore


? - Design as we go?
10 changes: 0 additions & 10 deletions about.html

This file was deleted.

49 changes: 49 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@import url('https://fonts.googleapis.com/css2?family=Chivo:ital,wght@0,100..900;1,100..900&display=swap');

html {
}

body {
font-family: "Chivo", sans-serif;
font-optical-sizing: auto;
font-style: normal;
margin: 0;
box-sizing: border-box;
background-color: rgba(16, 22, 38, 1);
color: white;
}

* {
margin: 0;
padding: 0;
outline: none;
box-sizing: border-box;
border: 0 solid;
}

header {

}

/*------ Celebration Modal ------*/

#celebration-modal {
border: none;
background: rgba(16, 22, 38, 0.9);
border-radius: 16px;
color: white;
padding: 2rem;
max-width: 400px;
width: 100%;
}

#celebration-modal::backdrop {
backdrop-filter: blur(8px);
background-color: rgba(0, 0, 0, 0.45);
}

/* TO DO: differentiate from regular click focus */
:focus {
outline: 3px solid rgba(110,157,231,1);
outline-offset: 2px;
}
56 changes: 56 additions & 0 deletions dist/script.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
interface fetchedObjectFormat {
category: string;
correct_answer: string;
difficulty: string;
incorrect_answers: string[];
question: string;
type: string;
}
interface questionObjectFormat {
question: string;
category: string;
difficulty: string;
allAnswers: string[];
correctAnswer: string;
}
interface quizSettingsFormat {
amount: number;
category: number;
difficulty: string;
player: string;
}
declare const questionArray: questionObjectFormat[];
declare let storedQuestionArray: questionObjectFormat[];
declare let index: number;
declare let chosenAnswer: string;
declare let accumulatedScore: number;
declare const filterForm: HTMLElement;
declare const quizContainer: HTMLElement;
declare const question: HTMLElement;
declare const answers: HTMLElement;
declare const conclusionDiv: HTMLElement;
declare const startButton: HTMLElement;
declare const submitAnswerButton: HTMLElement;
declare const nextQuestionBtn: HTMLElement;
declare const finishQuizBtn: HTMLElement;
declare const playAgainBtn: HTMLElement;
declare const scoreboardSection: HTMLElement;
declare const celebrationDialog: HTMLElement;
declare const fetchQuizAPI: () => Promise<void>;
declare const celebrationModal: () => void;
declare const decodeString: (string: string) => string;
declare const incrementIndex: () => void;
declare const renderStepper: () => void;
declare const shuffleAnswers: (array: string[]) => void;
declare const insertQuestionsAndAnswers: (array: questionObjectFormat, index: number) => void;
declare const checkAnswer: (chosenAnswer: string, index: number) => void;
declare const countAndSaveScore: () => void;
declare const SCORE_API_URL = "https://postgres.daniellauding.se/quiz_scores";
declare const fetchScores: () => Promise<void>;
declare let allScores: any[];
declare function initScoreFilters(): Promise<void>;
declare const postScore: (username: string, category: number, score: number, difficulty: string, amount: number) => Promise<any>;
declare let timerId: number | null;
declare function stopQuestionTimer(): void;
declare function startQuestionTimer(durationMs?: number): void;
//# sourceMappingURL=script.d.ts.map
1 change: 1 addition & 0 deletions dist/script.d.ts.map

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

Loading