css
This commit is contained in:
parent
7fa45dc9b7
commit
eeae337ef2
8 changed files with 83 additions and 56 deletions
27
Cargo.lock
generated
27
Cargo.lock
generated
|
@ -107,6 +107,28 @@ dependencies = [
|
|||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "axum-extra"
|
||||
version = "0.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"axum-core",
|
||||
"bytes",
|
||||
"futures-util",
|
||||
"http",
|
||||
"http-body",
|
||||
"http-body-util",
|
||||
"mime",
|
||||
"pin-project-lite",
|
||||
"serde",
|
||||
"tower",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.73"
|
||||
|
@ -161,6 +183,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
"axum-extra",
|
||||
"futures",
|
||||
"rand",
|
||||
"serde",
|
||||
|
@ -453,9 +476,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
|
|||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
|
|
|
@ -14,3 +14,4 @@ tower = { version = "0.4", features = ["util"] }
|
|||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
anyhow = "1.0.82"
|
||||
axum-extra = "0.9.3"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cards For Humanity</title>
|
||||
<link type="text/css" rel="stylesheet" href="css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Cards For Humanity</h1>
|
||||
|
|
36
public/main.css
Normal file
36
public/main.css
Normal file
|
@ -0,0 +1,36 @@
|
|||
html,
|
||||
body,
|
||||
input,
|
||||
textarea,
|
||||
button {
|
||||
font-family: monospace;
|
||||
background-color: #111;
|
||||
color: #ddd;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
div {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
span {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
input {
|
||||
display: block;
|
||||
width: 10rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
iframe {
|
||||
width: 49%;
|
||||
height: 49vh;
|
||||
border-style: none;
|
||||
}
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cards For Humanity Reference Client</title>
|
||||
<style></style>
|
||||
<link type="text/css" rel="stylesheet" href="css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Cards For Humanity Reference Client</h1>
|
||||
|
|
|
@ -1,32 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title>Cards For Humanity Test Clients</title>
|
||||
<style>
|
||||
body, html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #000;
|
||||
overflow: hidden;
|
||||
}
|
||||
iframe {
|
||||
width: 49%;
|
||||
height: 49vh;
|
||||
border-style: none;
|
||||
}
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cards For Humanity Test Clients</title>
|
||||
<link type="text/css" rel="stylesheet" href="css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
<iframe src="http://localhost:3030/test_client"></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,30 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cards For Humanity Test Client</title>
|
||||
<style>
|
||||
html, body, input, textarea, button {
|
||||
font-family: monospace;
|
||||
background-color: #111;
|
||||
color: #DDD;
|
||||
margin: 0;
|
||||
parring: 0;
|
||||
}
|
||||
div {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
span {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
input {
|
||||
display: block;
|
||||
width: 10rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Cards For Humanity Test Client</h1>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use anyhow::{Context, Result};
|
||||
use axum_extra::response::Css;
|
||||
use axum::{response::Html, routing::get, Router};
|
||||
use std::{
|
||||
// collections::HashSet,
|
||||
|
@ -101,6 +102,9 @@ async fn spawn_clients() -> Html<&'static str> {
|
|||
async fn reference_client() -> Html<&'static str> {
|
||||
Html(std::include_str!("../public/reference_client.html"))
|
||||
}
|
||||
async fn css() -> Css<&'static str> {
|
||||
Css(std::include_str!("../public/main.css"))
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
@ -133,6 +137,7 @@ async fn main() -> Result<()> {
|
|||
.route("/test_client", get(test_client))
|
||||
.route("/reference_client", get(reference_client))
|
||||
.route("/websocket", get(websocket_handler))
|
||||
.route("/css", get(css))
|
||||
.with_state(app_state);
|
||||
|
||||
// send it
|
||||
|
|
Loading…
Add table
Reference in a new issue