mirror of
https://github.com/RGBCube/rgbcube.github.io
synced 2025-05-31 05:08:12 +00:00
33 lines
749 B
Rust
33 lines
749 B
Rust
use maud::{
|
|
html,
|
|
Markup,
|
|
};
|
|
|
|
use crate::page;
|
|
|
|
const FACES: [&str; 6] = ["front", "top", "back", "bottom", "right", "left"];
|
|
|
|
pub fn create(styling: &str, faces: [Markup; 6]) -> Markup {
|
|
page::create(
|
|
html! {
|
|
link href="cube.min.css" rel="stylesheet";
|
|
},
|
|
html! {
|
|
style {
|
|
(styling)
|
|
}
|
|
|
|
div class="scene" {
|
|
div class="cube" {
|
|
@for (name, content) in FACES.iter().zip(faces) {
|
|
div class=(format!("face {name}")) {
|
|
(content)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
script src="cube.min.js" {}
|
|
},
|
|
)
|
|
}
|