Skip to content

Commit

Permalink
Added some types
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominux committed May 9, 2023
1 parent 3aabbf6 commit ad3c635
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 42 deletions.
31 changes: 1 addition & 30 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Approaching tiles</title>
<style>
:root {
--tile-gap: 0.5rem;
}

.playground {
display: flex;
justify-content: center;
gap: var(--tile-gap);
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
<link data-trunk rel="css" href="./styles.css" />

.tiles_column {
display: flex;
flex-direction: column;
gap: var(--tile-gap);
}

.tile {
padding: 0.5rem;
font-size: 2rem;
background: lightcyan;
border: 0.3rem transparent solid;
border-radius: 15%;
}

.selected {
border-color: orange;
}
</style>
</head>

<body>
Expand Down
26 changes: 14 additions & 12 deletions src/components/Playground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,20 @@ pub fn Playground(cx: Scope) -> impl IntoView {

let view = view! { cx,
<h1>{"Score: "}{score}</h1>
<div class="playground">
{
cols.iter()
.map(|(is_add_row, _)| view! {cx,
<TilesColumn
is_add_row=*is_add_row
selected_keys
set_selected_keys
checking_result
/>})
.collect::<Vec<_>>()
}
<div class="playground_wrapper">
<div class="playground">
{
cols.iter()
.map(|(is_add_row, _)| view! {cx,
<TilesColumn
is_add_row=*is_add_row
selected_keys
set_selected_keys
checking_result
/>})
.collect::<Vec<_>>()
}
</div>
</div>
};

Expand Down
38 changes: 38 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--tile-gap: 0.3rem;
}

.playground_wrapper {
margin: 0 auto;
padding: 0.2rem 0.5rem;
height: 50rem;
border: 0.3rem red solid;
width: fit-content;
}

.playground {
display: flex;
justify-content: center;
gap: var(--tile-gap);
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
}

.tiles_column {
display: flex;
flex-direction: column;
gap: var(--tile-gap);
}

.tile {
padding: 0.5rem;
font-size: 2rem;
background: lightcyan;
border: 0.3rem transparent solid;
border-radius: 15%;
}

.selected {
border-color: orange;
}

0 comments on commit ad3c635

Please sign in to comment.