Skip to content

Commit b39a724

Browse files
Merge pull request #124 from Speedrunyourknowledge/develop
update: add css grid for topics
2 parents 88e370c + 848d65c commit b39a724

6 files changed

Lines changed: 51 additions & 29 deletions

File tree

calc-frontend/package-lock.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

calc-frontend/src/App/app.css

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,35 @@ body {
2828
font-size:1.5rem;
2929
}
3030

31-
.link-box{
32-
@apply h-20 flex w-full items-center justify-center
33-
bg-amber-300 rounded-lg hover:bg-amber-400 transition transform hover:scale-103
34-
duration-200 border-2 border-solid;
35-
}
36-
3731
.topic-header{
3832
margin-bottom:1.125rem;
3933
}
4034

4135
.topic-list{
42-
width:50%;
36+
@apply items-center justify-center;
37+
4338
max-width: 100%;
4439
margin:auto;
40+
padding-right:20px;
41+
padding-left:20px;
42+
43+
display:grid;
44+
grid-template-columns: 1fr 1fr 1fr 1fr;
45+
grid-template-rows: auto;
46+
column-gap: 20px;
47+
row-gap:20px;
4548
}
4649

47-
.home-list{
48-
width:50%;
49-
max-width: 100%;
50-
margin:auto;
50+
.topic-list-3{
51+
grid-template-columns: 1fr 1fr 1fr;
52+
width:75%;
5153
}
5254

5355
.topic-box{
54-
@apply h-20 flex w-full items-center justify-center
56+
@apply h-20 flex items-center justify-center
5557
bg-amber-300 rounded-lg hover:bg-amber-400 transition transform hover:scale-103
5658
duration-200 border-2 border-solid;
59+
5760
}
5861

5962
.back-button{
@@ -102,13 +105,11 @@ body {
102105
@media (max-width: 999px) {
103106

104107
.topic-list{
105-
@apply gap-4;
106-
width: 70%;
108+
grid-template-columns: 1fr 1fr 1fr;
107109
}
108110

109-
.home-list{
110-
@apply gap-4;
111-
width: 70%;
111+
.topic-list-3{
112+
width:100%;
112113
}
113114

114115
}
@@ -124,13 +125,12 @@ body {
124125
@media (max-width: 599px) {
125126

126127
.topic-list{
127-
width: 100%;
128+
grid-template-columns: 1fr 1fr;
128129
}
129130

130-
.home-list{
131-
width: 100%;
131+
.topic-list-3{
132+
grid-template-columns: 1fr 1fr;
132133
}
133-
134134
}
135135

136136
@media (min-width: 800px) {

calc-frontend/src/pages/Derivatives.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function Derivatives() {
1111
</Link>
1212

1313
<h2 className="topic-header m-auto w-fit">The Derivative of Common Functions</h2>
14-
<div className="flex flex-col gap-6 items-center topic-list">
14+
<div className="topic-list">
1515

1616
<Link to="/derivatives/custom" className="topic-box">
1717
<button className="px-10 text-2xl cursor-pointer">Custom</button>

calc-frontend/src/pages/Home.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Home() {
66
<div>
77
<h2 className = "topic-header m-auto w-fit">Topics</h2>
88

9-
<div className="flex flex-col gap-6 m-auto home-list">
9+
<div className="topic-list topic-list-3" style={{marginBottom:'1rem'}}>
1010
{
1111
/*
1212
<Link to="/limits" className = "link-box">
@@ -15,20 +15,21 @@ function Home() {
1515
*/
1616
}
1717

18-
<Link to="/derivatives" className = "link-box">
18+
<Link to="/derivatives" className = "topic-box">
1919
<div className="link-title">Derivatives</div>
2020
</Link>
2121

22-
<Link to="/integrals" className = "link-box">
22+
<Link to="/integrals" className = "topic-box">
2323
<div className="link-title">Integrals</div>
2424
</Link>
2525

26-
<Link to="/unit-circle" className = "link-box">
26+
<Link to="/unit-circle" className = "topic-box">
2727
<div className="link-title">Unit Circle</div>
2828
</Link>
2929

30-
<h3 className = "topic-header m-auto w-fit">More topics coming soon...</h3>
3130
</div>
31+
32+
<h3 className = "topic-header m-auto w-fit">More topics coming soon...</h3>
3233

3334
</div>
3435
)

calc-frontend/src/pages/Integrals.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function Integrals() {
1111
</Link>
1212

1313
<h2 className="topic-header m-auto w-fit">The Integral of Common Functions</h2>
14-
<div className="flex flex-col gap-6 items-center topic-list">
14+
<div className="topic-list">
1515

1616
<Link to="/integrals/custom" className="topic-box">
1717
<button className="px-10 text-2xl cursor-pointer">Custom</button>

calc-frontend/src/pages/UnitCircle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function UnitCircle() {
1111
</Link>
1212

1313
<h2 className="topic-header m-auto w-fit">Interpreting the Unit Circle</h2>
14-
<div className="flex flex-col gap-6 items-center topic-list">
14+
<div className="topic-list topic-list-3">
1515

1616
<Link to="/unit-circle/sine" className="topic-box">
1717
<button className="px-10 text-2xl cursor-pointer">Sine</button>

0 commit comments

Comments
 (0)