-
Notifications
You must be signed in to change notification settings - Fork 1
/
problemset.html
142 lines (131 loc) · 4.33 KB
/
problemset.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Problem Set</title>
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
margin: 0;
font-family: Arial, sans-serif;
background-color: #b1abab;
}
#ptitle {
gap: 10px;
display: flex;
flex-direction: column;
border: 2px solid #ddd;
padding: 40px;
background-color: #d6d2d2;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
[data] {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 100px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 10px;
max-width: 800px;
border-radius: 10px;
box-shadow: 0 2px 2px 0 rgb(0, 0, 0);
border-radius: 10px;
transition: 0.3s;
}
[data]:hover {
box-shadow: 0 8px 16px 0 rgb(0, 0, 0);
}
[data-pid],
[data-ptitle],
[data-diff],
[data-sol] {
flex-basis: calc(33.33% - 20px);
text-align: center;
display: flex;
flex-direction: row;
}
</style>
</head>
<body>
<h2>Problem Set</h2>
<div id="ptitle">
<div data="1">
<div data-pid="1">1</div>
<div data-ptitle=" Sum of Squares"> Sum of Squares</div>
<div data-diff="easy">easy</div>
<div data-sol="sol">solution</div>
</div>
<div data="2">
<div data-pid="2">2</div>
<div data-ptitle="Reverse Array">Reverse Array</div>
<div data-diff="easy">easy</div>
<div data-sol="sol">solution</div>
</div>
<div data="3">
<div data-pid="3">3</div>
<div data-ptitle=" Count Vowels"> Count Vowels</div>
<div data-diff="easy">easy</div>
<div data-sol="sol">solution</div>
</div>
<div data="4">
<div data-pid="4">4</div>
<div data-ptitle="Check Prime Number">Check Prime Number</div>
<div data-diff="medium">medium</div>
<div data-sol="sol">solution</div>
</div>
<div data="5">
<div data-pid="5">5</div>
<div data-ptitle="Find Max. in Array">Find Max. in Array</div>
<div data-diff="easy">easy</div>
<div data-sol="sol">solution</div>
</div>
<div data="6">
<div data-pid="6">6</div>
<div data-ptitle="Reverse Integer">Reverse Integer</div>
<div data-diff="hard">hard</div>
<div data-sol="sol">solution</div>
</div>
<div data="7">
<div data-pid="7">7</div>
<div data-ptitle=" Check Armstrong Number"> Check Armstrong Number</div>
<div data-diff="hard">hard</div>
<div data-sol="sol">solution</div>
</div>
<div data="8">
<div data-pid="8">8</div>
<div data-ptitle=" Check Leap Year"> Check Leap Year</div>
<div data-diff="medium">medium</div>
<div data-sol="sol">solution</div>
</div>
<div data="9">
<div data-pid="9">9</div>
<div data-ptitle="Linear Search">Linear Search</div>
<div data-diff="easy">easy</div>
<div data-sol="sol">solution</div>
</div>
<div data="10">
<div data-pid="10">10</div>
<div data-ptitle=" Calculate Factorial"> Calculate Factorial</div>
<div data-diff="medium">medium</div>
<div data-sol="sol">solution</div>
</div>
</div>
</body>
<script>
document.addEventListener('DOMContentLoaded', function () {
var divs = document.querySelectorAll('div[data]');
divs.forEach(function (div) {
div.addEventListener('click', function () {
var pid = this.querySelector('[data-pid]').getAttribute('data-pid');
window.location.href = '/problemset/' + pid;
});
});
});
</script>
</html>