Skip to content

Commit e4be132

Browse files
committed
added more filter stuff (incomplete) on the TODO
1 parent ee8c6fb commit e4be132

File tree

5 files changed

+139
-57
lines changed

5 files changed

+139
-57
lines changed

src/components/Content.astro

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,50 @@
22
import '../styles/styles.scss';
33
import '../styles/globals.scss';
44
import Filter from "./ui/Filter.astro";
5+
import Placeholder from "./Placeholder.astro";
56
---
67

78

89
<section>
9-
<div>
10+
<div id="filterList">
1011
<Filter/>
1112
</div>
12-
ContentGrid
13+
<div id="favorites">
14+
<Placeholder />
15+
<Placeholder />
16+
<Placeholder />
17+
<Placeholder />
18+
</div>
19+
<div id="content">
20+
<Placeholder />
21+
<Placeholder />
22+
<Placeholder />
23+
</div>
1324
</section>
1425

1526

1627
<style>
17-
28+
#content {
29+
display: flex;
30+
flex-direction: row;
31+
justify-content: space-between;
32+
flex-wrap: wrap;
33+
margin-inline: 4%;
34+
}
35+
#favorites {
36+
display: flex;
37+
flex-direction: row;
38+
justify-content: space-between;
39+
flex-wrap: wrap;
40+
margin-inline: 4%;
41+
}
1842
section {
1943
display: flex;
2044
flex-direction: column;
2145
align-items: center;
2246
}
2347

24-
div {
48+
#filterList {
2549
top: 2rem;
2650
position: sticky;
2751
margin:auto;

src/components/Placeholder.astro

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
3+
---
4+
5+
6+
<div class="wrapper">
7+
<div class="blocky animate">
8+
9+
</div>
10+
<div class="texty">
11+
<div class="text animate"></div>
12+
<div class="text animate"></div>
13+
<div class="text animate"></div>
14+
</div>
15+
</div>
16+
17+
<style>
18+
.wrapper {
19+
width: 24rem;
20+
height: 12rem;
21+
padding: 1rem;
22+
23+
display: flex;
24+
flex-direction: row;
25+
gap: 0.33rem;
26+
}
27+
.blocky {
28+
background-color: #9ca3af;
29+
height: 100%;
30+
width: 100%;
31+
@apply rounded-lg;
32+
}
33+
.animate {
34+
animation: waves 3s infinite;
35+
}
36+
.texty {
37+
width: 100%;
38+
display: flex;
39+
flex-direction: column;
40+
gap: 0.33rem;
41+
}
42+
.text {
43+
width: 100%;
44+
height: 1.5rem;
45+
background-color: #9ca3af;
46+
@apply rounded-md;
47+
}
48+
49+
@keyframes waves {
50+
0% {background-color: rgba(156, 163, 175, 0.6);}
51+
50% {background-color: rgba(156, 163, 175, 0.2);}
52+
100% {background-color: rgba(156, 163, 175, 0.6);}
53+
}
54+
</style>
Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,19 @@
11
---
22
import '../../styles/styles.scss'
33
import '../../styles/globals.scss'
4-
const {buttonText, label, filterChecked} = Astro.props;
4+
const {buttonText, label, className} = Astro.props;
55
---
66
<script>
7-
const button = document.getElementById('filterButton');
8-
9-
button.addEventListener('click', () => {
10-
console.log('buttonStatus');
11-
switch (buttonStatus) {
12-
case 'filterEnabled':
13-
button.classList.add('filterDisabled');
14-
button.classList.remove('filterEnabled');
15-
console.log('yippie!');
16-
break;
17-
case 'filterDisabled':
18-
button.classList.add('filterEnabled');
19-
button.classList.remove('filterDisabled');
20-
console.log('wahoo');
21-
break;
22-
}
23-
})
247

258
</script>
269

27-
<button class="filterDisabled" id=filterButton aria-label={label}>
10+
<button class={className} aria-label={label}>
2811
<a>
2912
{buttonText}
3013
</a>
3114
</button>
3215

3316
<style>
34-
35-
[data-enabled='enabled'] body {
36-
color: red;
37-
}
38-
3917
button {
4018
display: flex;
4119
}
@@ -48,19 +26,20 @@ const {buttonText, label, filterChecked} = Astro.props;
4826
@apply duration-100;
4927

5028
font-size: 0.9rem;
29+
font-weight: 500;
30+
color: rgb(9, 32, 128);
5131
border: 1px transparent solid;
5232
}
5333

5434
a:hover {
55-
border: 1px rgba(87, 90, 102, 0.2) solid;
35+
border: 1px #3574F0 solid;
5636
}
5737

5838
a:active {
59-
60-
}
61-
62-
span:enabled {
63-
color: red;
39+
color: #F0F1F2;
40+
font-weight: 500;
41+
background-color: #3574F0;
42+
border: 1px transparent solid;
6443
}
6544

6645
</style>

src/components/buttons/SignUpButton.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ const { target, label } = Astro.props;
4040
outline: 2px transparent solid;
4141

4242
}
43+
@keyframes border-anim {
44+
0% {outline: 4px rgba(150, 174, 224, 0.25) dotted;}
45+
100% {outline: 2px #96aee0 solid;}
46+
}
47+
4348
a:hover {
4449
background: #3574F0;
4550
outline: 2px #96aee0 solid;
51+
animation: border-anim 0.2s 1 ease-out;
4652
}
4753
a:active {
4854
background: #3574F0;

src/components/ui/Filter.astro

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,37 @@ import FilterButton from "../buttons/FilterButton.astro";
55
import Searchbox from "./Searchbox.astro";
66
---
77

8-
<section>
9-
<h3>Filter</h3>
10-
<div id="filterButtons">
11-
<FilterButton buttonText='About'
12-
label='Aria Label'/>
13-
<FilterButton buttonText='About'
14-
label='Aria Label'/>
15-
<FilterButton buttonText='About'
16-
label='Aria Label'/>
17-
<FilterButton buttonText='About'
18-
label='Aria Label'/>
19-
<FilterButton buttonText='About'
20-
label='Aria Label'/>
21-
</div>
22-
<Searchbox/>
23-
</section>
8+
<div>
9+
<section>
10+
<h3>Filter</h3>
11+
12+
<svg data-slot="icon" aria-hidden="true" fill="currentColor" viewBox="0 0 24 24"
13+
xmlns="http://www.w3.org/2000/svg">
14+
<path clip-rule="evenodd"
15+
d="M3.792 2.938A49.069 49.069 0 0 1 12 2.25c2.797 0 5.54.236 8.209.688a1.857 1.857 0 0 1 1.541 1.836v1.044a3 3 0 0 1-.879 2.121l-6.182 6.182a1.5 1.5 0 0 0-.439 1.061v2.927a3 3 0 0 1-1.658 2.684l-1.757.878A.75.75 0 0 1 9.75 21v-5.818a1.5 1.5 0 0 0-.44-1.06L3.13 7.938a3 3 0 0 1-.879-2.121V4.774c0-.897.64-1.683 1.542-1.836Z"
16+
fill-rule="evenodd"></path>
17+
</svg>
18+
<div id="filterButtonList">
19+
<FilterButton class='filterButton' buttonText='All' label='All content'/>
20+
<FilterButton class='filterButton' buttonText='Inspiration' label='Inspiration content'/>
21+
<FilterButton class='filterButton' buttonText='Personal' label='Personal websites and portfolios'/>
22+
<FilterButton class='filterButton' buttonText='Commerce' label='Commerce website'/>
23+
<FilterButton class='filterButton' buttonText='Resources' label='Resource websites'/>
24+
<FilterButton class='filterButton' buttonText='Free' label='Free resources'/>
25+
</div>
26+
</section>
27+
</div>
2428

2529
<style>
26-
#filterButtons {
30+
#filterButtonList {
2731
align-items: center;
2832
display: flex;
2933
flex-direction: row;
30-
gap: 0.25rem;
34+
gap: 0.5rem;
35+
flex-wrap: wrap;
3136
}
37+
38+
3239
section {
3340
min-height: 50px;
3441
width: 100%;
@@ -37,23 +44,35 @@ import Searchbox from "./Searchbox.astro";
3744
position: sticky;
3845
flex-direction: row;
3946
justify-content: space-between;
40-
gap: 6rem;
41-
background-color: rgba(213, 220, 242, 0.5);
42-
border: rgba(213, 220, 242, 1) 1px solid;
47+
background-color: #d1def6;
48+
border: #3574F0 1px solid;
4349
@apply rounded-lg;
4450
padding: 0 1rem;
51+
gap: 0.5rem;
52+
overflow-x: clip;
53+
}
54+
55+
.filterButton {
56+
57+
}
58+
59+
svg {
60+
height: 1.5rem;
61+
color: #3574F0;
4562
}
4663

4764
h3 {
4865
display: none;
4966
font-size: 1rem !important;
5067
}
68+
5169
@media screen and (max-width: 800px) {
5270
section {
53-
flex-direction: column-reverse;
54-
gap: 1rem;
71+
flex-direction: row;
5572
padding: 1rem;
73+
border-radius: 0;
5674
}
75+
5776
}
5877

5978

0 commit comments

Comments
 (0)