Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
75 changes: 69 additions & 6 deletions client/app/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ h2 {
margin-top: var(--margin_top);
}

p {
font-size: 1.25em;
letter-spacing: .05em;
margin: calc(var(--margin_top) / 2) 0 calc(var(--margin_bottom) * 2)
}


.explore-form-row {
align-items: stretch;
Expand Down Expand Up @@ -185,6 +181,72 @@ button.btn:hover {
position: relative;
}

.arrow-right,
.arrow-left {
background: var(--theme_color);
display: inline-flex;
height: 2px;
position: relative;
vertical-align: middle;
width: 24px;
}

.arrow-right {
margin-left: 4px;
}

.arrow-left {
margin-right: 4px;
}

.arrow-right::before,
.arrow-right::after,
.arrow-left::before,
.arrow-left::after {
background: var(--theme_color);
content: "";
height: 2px;
position: absolute;
transform-origin: 50% 50%;
width: 10px;
}

.arrow-right::before,
.arrow-right::after {
right: -3px;
}

.arrow-left::before,
.arrow-left::after {
left: -3px;
}

.arrow-right::before,
.arrow-left::before {
top: -3px;
}

.arrow-right::before {
transform: rotate(45deg);
}

.arrow-left::before {
transform: rotate(-45deg);
}

.arrow-right::after,
.arrow-left::after {
bottom: -3px;
}

.arrow-right::after {
transform: rotate(-45deg);
}

.arrow-left::after {
transform: rotate(45deg);
}

button.btn .arrow-right,
button.btn .arrow-right::before,
button.btn .arrow-right::after {
Expand Down Expand Up @@ -225,6 +287,7 @@ button.btn:hover .arrow-right::after {
padding-left: 40%;
text-transform: uppercase;
text-align: left;
margin: var(--margin_top) auto;
}

@media (min-width: 64em) {
Expand All @@ -241,7 +304,7 @@ button.btn:hover .arrow-right::after {
margin: 0;
}

main.content-wrapper div.container {
main.content-wrapper div.welcome-container {
min-width: 100vw;
max-width: 100vw;
margin: 0;
Expand Down
35 changes: 35 additions & 0 deletions client/app/components/checkbox.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.checkbox-control {
display: inline-block;
position: relative;
}

.checkbox-input {
height: 16px;
left: 0;
margin: 0;
opacity: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 16px;
z-index: 1;
}

.checkbox-input:checked ~ label {
background-color: var(--secondary_a);
}

.checkbox-input:focus-visible + .checkbox-label {
outline: 2px solid var(--secondary_a);
outline-offset: 2px;
}

.checkbox-label {
background: var(--white);
border: 2px solid var(--secondary_a);
display: inline-block;
margin-bottom: 2px;
margin-right: 4px;
padding: 6px;
vertical-align: middle;
}
10 changes: 7 additions & 3 deletions client/app/components/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './checkbox.css';

const Checkbox = ({
label,
onChange,
Expand All @@ -8,15 +10,17 @@ const Checkbox = ({
checked: boolean;
}) => {
return (
<div className="col-lg-2 col-xl-2" role="category-group">
<span className="checkbox-control">
<input
type="checkbox"
onChange={() => onChange()}
checked={checked}
aria-label={label}
id={`check-${label.toLowerCase()}`}
className="checkbox-input"
/>
<label htmlFor={`check-${label.toLowerCase()}`}></label> {label}
</div>
<label htmlFor={`check-${label.toLowerCase()}`} className="checkbox-label"></label> {label}
</span>
);
};

Expand Down
3 changes: 2 additions & 1 deletion client/app/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from "react";
import { Link } from "react-router";
import LoginModal from "./login-modal";
import "./header.css";
import { useLogin } from "../context/loginContext";

import "./header.css";

export type HeaderProps = {
projIcons: {
logo: string;
Expand Down
44 changes: 44 additions & 0 deletions client/app/components/search-input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.query-input-group {
position: relative;
}

.query-input-group.has-submit-button::after {
background: var(--secondary_a);
content: "";
height: 2em;
position: absolute;
right: 6em;
top: 0.625em;
width: 1px;
}

#query-form-submit {
height: 100%;
opacity: 0;
pointer-events: all;
position: absolute;
right: 0;
top: 0;
width: 5em;
z-index: 9;
}

.query-input-group:has(#query-form-submit:focus-visible) {
outline: 2px solid var(--secondary_a);
outline-offset: 2px;
border-radius: 2em;
}

#search-icon-label {
border-color: var(--secondary_a);
border-radius: 2em 0 0 2em;
border-right: none;
border-width: 2px;
background: var(--white);
padding: 0.375rem 1.125rem;
}

#search-text {
border-radius: 0 2em 2em 0;
border-left: none;
}
59 changes: 59 additions & 0 deletions client/app/components/search-input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import './search-input.css';

type SearchInputProps = {
onInputChange: (query: string) => void;
placeholder: string;
submitValue: string;
showSubmitButton: boolean;
value?: string;
};

const SearchInput: React.FC<SearchInputProps> = ({
onInputChange,
placeholder,
submitValue,
showSubmitButton,
value,
}) => {
return (
<div className={`input-group query-input-group${showSubmitButton ? " has-submit-button" : ""}`}>
<span className="input-group-text" id="search-icon-label">
<svg
id="Symbol_62_2"
data-name="Symbol 62 – 2"
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 16 16"
>
<rect
id="Rectangle_176"
data-name="Rectangle 176"
width="16"
height="16"
fill="none"
/>
<path
id="Path_99"
data-name="Path 99"
d="M15.9,14.5l-3.3-3.3A6.847,6.847,0,0,0,14,7,6.957,6.957,0,0,0,7,0,6.957,6.957,0,0,0,0,7a6.957,6.957,0,0,0,7,7,6.847,6.847,0,0,0,4.2-1.4l3.3,3.3ZM2,7A4.951,4.951,0,0,1,7,2a4.951,4.951,0,0,1,5,5,4.951,4.951,0,0,1-5,5A4.951,4.951,0,0,1,2,7Z"
/>
</svg>
</span>
<input
type="text"
className="form-control"
id="search-text"
name="query"
placeholder={placeholder}
aria-describedby="search-icon-label"
onChange={(e) => onInputChange(e.target.value)}
value={value}
/>
{showSubmitButton && <span className="search-arrow arrow-right"></span>}
<input type="submit" id="query-form-submit" value={submitValue} />
</div>
);
};

export default SearchInput;
3 changes: 2 additions & 1 deletion client/app/context/action.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios from "axios";
import { primeCsrf, tekdbApi } from "../api/tekdbApi";
import type { FilterCategories } from "../types";

export type LoginState = {
success?: boolean;
Expand Down Expand Up @@ -56,7 +57,7 @@ export const submitLoginAction = async (
}
};

export const submitSearchAction = async ({ categories, query }: { categories: string[], query: string }) => {
export const submitSearchAction = async ({ categories, query }: { categories: FilterCategories[], query: string }) => {
const params = new URLSearchParams({ query });
categories.forEach((category) => params.append("category", category));

Expand Down
Loading