Basic page
This commit is contained in:
parent
b97e6ed468
commit
21c43715ce
@ -2,7 +2,11 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Trunk Template</title>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||
<title>Personal Tracker</title>
|
||||
<link data-trunk href="index.scss" rel="scss">
|
||||
</head>
|
||||
<body></body>
|
||||
<body>
|
||||
<noscript>Javascript is required to use this website.</noscript>
|
||||
</body>
|
||||
</html>
|
||||
|
27
client/index.scss
Normal file
27
client/index.scss
Normal file
@ -0,0 +1,27 @@
|
||||
html, body {
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#container {
|
||||
height: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
header > h1 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
}
|
@ -2,19 +2,15 @@ use yew::prelude::*;
|
||||
|
||||
#[function_component]
|
||||
fn App() -> Html {
|
||||
let counter = use_state(|| 0);
|
||||
let onclick = {
|
||||
let counter = counter.clone();
|
||||
move |_| {
|
||||
let value = *counter + 2;
|
||||
counter.set(value);
|
||||
}
|
||||
};
|
||||
|
||||
html! {
|
||||
<div>
|
||||
<button {onclick}>{ "+1" }</button>
|
||||
<p>{ *counter }</p>
|
||||
<div id="container">
|
||||
<header>
|
||||
<h1>{ "Personal Tracker" }</h1>
|
||||
</header>
|
||||
<main>
|
||||
<p>{ "Main" }</p>
|
||||
</main>
|
||||
<footer>{ "Personal Tracker v1" }</footer>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user