Merge branch 'master' into simon-game · ishika1501/30DaysOfJavaScript@a399988 · GitHub
Skip to content

Commit a399988

Browse files
Merge branch 'master' into simon-game
2 parents 4c07924 + e6c08a3 commit a399988

14 files changed

Lines changed: 676 additions & 0 deletions

File tree

‎30DaysOfJavaScript/assets/49.png‎

-445 KB
Loading

‎30DaysOfJavaScript/assets/53.png‎

-39.4 KB
Binary file not shown.

‎30DaysOfJavaScript/assets/57.png‎

51 KB
Loading

‎57 - Quiz App/css/quiz.css‎

Lines changed: 91 additions & 0 deletions

‎57 - Quiz App/css/result.css‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
body{
2+
background-color: #f5f5f5;
3+
font-family: 'Roboto', sans-serif;
4+
color: #1d1d1f;
5+
}
6+
7+
section{
8+
width: 100%;
9+
height: 100vh;
10+
display: flex;
11+
align-items: center;
12+
justify-content: center;
13+
}
14+
15+
section div{
16+
background-color: #fff;
17+
border-radius: 28px;
18+
border: 1px solid hsla(0,0%,51.4%,.16);
19+
padding: 20px;
20+
width: 200px;
21+
height: 200px;
22+
display: flex;
23+
flex-direction: column;
24+
justify-content: center;
25+
align-items: center;
26+
text-align: center;
27+
}
28+
29+
section div h1{
30+
display: contents;
31+
}

‎57 - Quiz App/css/styles.css‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
body{
2+
background-color: #f5f5f5;
3+
font-family: 'Roboto', sans-serif;
4+
color: #1d1d1f;
5+
}
6+
7+
section{
8+
width: 100%;
9+
height: 100vh;
10+
display: flex;
11+
justify-content: center;
12+
align-items: center;
13+
}
14+
15+
section div{
16+
background-color: #fff;
17+
border-radius: 28px;
18+
border: 1px solid hsla(0,0%,51.4%,.16);
19+
text-align: center;
20+
padding: 20px;
21+
}
22+
23+
section div h1{
24+
margin-bottom: 20px;
25+
font-weight: bold;
26+
}
27+
28+
.select-quiz{
29+
margin-right: 10px;
30+
}

‎57 - Quiz App/index.html‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
8+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
10+
<link rel="stylesheet" href="css/styles.css">
11+
12+
<title>quiz app</title>
13+
</head>
14+
<body>
15+
<section>
16+
<div>
17+
<h1>Select the quiz</h1>
18+
<button class="select-quiz btn btn-dark" value="quizOne">Quiz 1</button>
19+
<button class="select-quiz btn btn-primary" value="quizTwo">Quiz 2</button>
20+
<button class="select-quiz btn btn-warning" value="quizThree">Quiz 3</button>
21+
</div>
22+
</section>
23+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
24+
<script src="javaScript/index.js"></script>
25+
</body>
26+
</html>

‎57 - Quiz App/javaScript/index.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
let id = (id)=> document.getElementById(id);
2+
let classes = (classes)=> document.getElementsByClassName(classes);
3+
4+
let quizSelected = classes("select-quiz");
5+
6+
for(let i=0; i<quizSelected.length;i++){
7+
quizSelected[i].addEventListener("click",()=>{
8+
// redirecting to next page with parameter
9+
window.location = `quiz.html?quiz=${quizSelected[i].value}`
10+
});
11+
}
Lines changed: 185 additions & 0 deletions

0 commit comments

Comments
 (0)