Merge pull request #25 from itsscb/feature

fix(frontend): fixes css misconfiguration and index on focus
This commit is contained in:
itsscb 2024-09-03 11:46:46 +02:00 committed by GitHub
commit b1a6c0899e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 13 deletions

View File

@ -13,8 +13,8 @@
<link rel="manifest" href="public/manifest.json" />
</head>
<body class="bg-black text-white">
<div class="h-screen flex justify-center items-center">
<body class="bg-black text-white pt-12">
<div class="h-[90vh] flex flex-col justify-center items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="w-16 h-16 rotate-ease" viewBox="0 -960 960 960" fill="white">
<path
d="M320-160h320v-120q0-66-47-113t-113-47q-66 0-113 47t-47 113v120Zm160-360q66 0 113-47t47-113v-120H320v120q0 66 47 113t113 47ZM160-80v-80h80v-120q0-61 28.5-114.5T348-480q-51-32-79.5-85.5T240-680v-120h-80v-80h640v80h-80v120q0 61-28.5 114.5T612-480q51 32 79.5 85.5T720-280v120h80v80H160Zm320-80Zm0-640Z" />

View File

@ -362,8 +362,8 @@ pub fn Home() -> Html {
"flex",
"flex-col",
"items-center",
"justify-center",
"h-[90vh]",
"pt-12",
)
}
>
@ -475,7 +475,7 @@ pub fn Home() -> Html {
Callback::from(move |e: FocusEvent| {
let target = e.target_unchecked_into::<web_sys::HtmlElement>();
if let Some(index) = target.get_attribute("tabindex") {
if let Ok(i) = index.parse::<usize>() {
if let Ok(i) = index.replace('-', "").parse::<usize>() {
curr_index.set(i);
}
}
@ -488,15 +488,7 @@ pub fn Home() -> Html {
};
html! {
<input
aria-label={format!("letter-{}", match index {
0 => "one",
1 => "two",
2 => "three",
3 => "four",
4 => "five",
_ => "",
})}
aria-label={format!("letter-{index}")}
onkeyup={on_enter.clone()}
oninput={on_input.clone()}
tabindex={ format!("{prefix}{index}")}