Compare commits
7 Commits
0.3.1
...
daylight-s
| Author | SHA1 | Date | |
|---|---|---|---|
| b7fa967b3a | |||
| 428e75488d | |||
| 86918e69c3 | |||
| 2af82804c0 | |||
| 35f3aa76f6 | |||
| 8bd16b6755 | |||
| 558bf4782b |
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -203,7 +203,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "common"
|
name = "common"
|
||||||
version = "0.3.1"
|
version = "0.3.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"lighter_lib",
|
"lighter_lib",
|
||||||
@ -605,7 +605,7 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hemma"
|
name = "hemma"
|
||||||
version = "0.3.1"
|
version = "0.3.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -630,7 +630,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hemma_web"
|
name = "hemma_web"
|
||||||
version = "0.3.1"
|
version = "0.3.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"common",
|
"common",
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
##################
|
##################
|
||||||
### BASE STAGE ###
|
### BASE STAGE ###
|
||||||
##################
|
##################
|
||||||
FROM rust:1.72.1 as base
|
FROM rust:1.76.0 as base
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
RUN cargo install --locked cargo-make trunk strip_cargo_version
|
RUN cargo install --locked trunk@^0.18.8 strip_cargo_version
|
||||||
RUN rustup target add wasm32-unknown-unknown
|
RUN rustup target add wasm32-unknown-unknown
|
||||||
RUN rustup target add x86_64-unknown-linux-musl
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hemma"
|
name = "hemma"
|
||||||
version = "0.3.1"
|
version = "0.3.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
60
backend/src/tasks/lights/scripts/daylight.rs
Normal file
60
backend/src/tasks/lights/scripts/daylight.rs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|
||||||
|
use common::{BulbPrefs, Param};
|
||||||
|
use lighter_lib::BulbId;
|
||||||
|
use lighter_manager::manager::BulbManager;
|
||||||
|
use std::sync::Mutex;
|
||||||
|
|
||||||
|
use crate::util::DeadMansHandle;
|
||||||
|
|
||||||
|
use super::LightScript;
|
||||||
|
|
||||||
|
pub struct Auto {
|
||||||
|
state: Arc<Mutex<AutoState>>,
|
||||||
|
_task_handle: DeadMansHandle,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct AutoState {
|
||||||
|
manager: BulbManager,
|
||||||
|
enabled_bulbs: HashMap<BulbId, AutoBulbState>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
struct AutoBulbState {}
|
||||||
|
|
||||||
|
impl LightScript for Auto {
|
||||||
|
fn get_params(&mut self, bulb: &BulbId) -> BulbPrefs {
|
||||||
|
let state = self.state.lock().unwrap();
|
||||||
|
let enabled = state.enabled_bulbs.contains_key(bulb);
|
||||||
|
|
||||||
|
BulbPrefs {
|
||||||
|
kvs: [("Auto".to_string(), Param::Toggle(enabled))]
|
||||||
|
.into_iter()
|
||||||
|
.collect(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_param(&mut self, bulb: &BulbId, name: &str, param: Param) {
|
||||||
|
if name != "Auto" {
|
||||||
|
error!("invalid param name");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let Param::Toggle(enabled) = param else {
|
||||||
|
error!("invalid param kind");
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut state = self.state.lock().unwrap();
|
||||||
|
if !enabled {
|
||||||
|
state.enabled_bulbs.remove(bulb);
|
||||||
|
} else {
|
||||||
|
let bulb_state = AutoBulbState::default();
|
||||||
|
state.enabled_bulbs.insert(bulb.clone(), bulb_state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn auto_task(state: Arc<Mutex<AutoState>>) {
|
||||||
|
loop {}
|
||||||
|
}
|
||||||
@ -1,8 +1,10 @@
|
|||||||
use common::{BulbPrefs, Param};
|
use common::{BulbPrefs, Param};
|
||||||
use lighter_lib::BulbId;
|
use lighter_lib::BulbId;
|
||||||
|
|
||||||
|
mod daylight;
|
||||||
mod party;
|
mod party;
|
||||||
mod waker;
|
mod waker;
|
||||||
|
pub use daylight::Daylight;
|
||||||
pub use party::Party;
|
pub use party::Party;
|
||||||
pub use waker::Waker;
|
pub use waker::Waker;
|
||||||
|
|
||||||
|
|||||||
@ -37,13 +37,12 @@ impl LightScript for Party {
|
|||||||
|
|
||||||
fn set_param(&mut self, bulb: &BulbId, name: &str, param: Param) {
|
fn set_param(&mut self, bulb: &BulbId, name: &str, param: Param) {
|
||||||
if name != "Party" {
|
if name != "Party" {
|
||||||
error!("invalit param name");
|
error!("invalid param name");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: should be toggle
|
|
||||||
let Param::Toggle(enabled) = param else {
|
let Param::Toggle(enabled) = param else {
|
||||||
error!("invalit param kind");
|
error!("invalid param kind");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,8 @@ impl Waker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TIME_FMT: &str = "%H:%M";
|
const TIME_FMT: &str = "%H:%M";
|
||||||
|
const WAKE_TARGET_BRIGHTNESS: u8 = 75;
|
||||||
|
const WAKE_TARGET_TEMPERATURE: u8 = 60;
|
||||||
|
|
||||||
impl LightScript for Waker {
|
impl LightScript for Waker {
|
||||||
fn get_params(&mut self, bulb: &BulbId) -> BulbPrefs {
|
fn get_params(&mut self, bulb: &BulbId) -> BulbPrefs {
|
||||||
@ -116,9 +118,8 @@ async fn wake_task(manager: BulbManager, id: BulbId, day: Weekday, time: NaiveTi
|
|||||||
let r = manager
|
let r = manager
|
||||||
.until_interrupted(id.clone(), async {
|
.until_interrupted(id.clone(), async {
|
||||||
// slowly turn up brightness of bulb
|
// slowly turn up brightness of bulb
|
||||||
for brightness in (1..=75).map(|i| (i as f32) * 0.01) {
|
for brightness in (1..=WAKE_TARGET_BRIGHTNESS).map(|i| (i as f32) * 0.01) {
|
||||||
//sleep(Duration::from_secs(12)).await;
|
sleep(Duration::from_secs(12)).await;
|
||||||
sleep(Duration::from_millis(500)).await;
|
|
||||||
|
|
||||||
manager
|
manager
|
||||||
.send_command(BulbCommand::SetColor(
|
.send_command(BulbCommand::SetColor(
|
||||||
@ -130,6 +131,21 @@ async fn wake_task(manager: BulbManager, id: BulbId, day: Weekday, time: NaiveTi
|
|||||||
))
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// slowly turn up temperature of bulb
|
||||||
|
for temperature in (1..=WAKE_TARGET_TEMPERATURE).map(|i| (i as f32) * 0.01) {
|
||||||
|
sleep(Duration::from_secs(12)).await;
|
||||||
|
|
||||||
|
manager
|
||||||
|
.send_command(BulbCommand::SetColor(
|
||||||
|
BulbSelector::Id(id.clone()),
|
||||||
|
BulbColor::Kelvin {
|
||||||
|
t: temperature,
|
||||||
|
b: WAKE_TARGET_BRIGHTNESS as f32 * 0.01,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.await
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
use tokio::task::AbortHandle;
|
use tokio::task::AbortHandle;
|
||||||
|
|
||||||
|
/// A tokio task handle that will abort the task when dropped.
|
||||||
pub struct DeadMansHandle(pub AbortHandle);
|
pub struct DeadMansHandle(pub AbortHandle);
|
||||||
|
|
||||||
impl From<AbortHandle> for DeadMansHandle {
|
impl From<AbortHandle> for DeadMansHandle {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "common"
|
name = "common"
|
||||||
version = "0.3.1"
|
version = "0.3.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hemma_web"
|
name = "hemma_web"
|
||||||
version = "0.3.1"
|
version = "0.3.3"
|
||||||
authors = ["Joakim Hulthe <joakim@hulthe.net"]
|
authors = ["Joakim Hulthe <joakim@hulthe.net"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ use crate::components::color_picker::{ColorPicker, ColorPickerMsg};
|
|||||||
use crate::css::C;
|
use crate::css::C;
|
||||||
use common::{BulbGroup, BulbGroupShape, BulbMap, BulbPrefs, ClientMessage, Param, ServerMessage};
|
use common::{BulbGroup, BulbGroupShape, BulbMap, BulbPrefs, ClientMessage, Param, ServerMessage};
|
||||||
use lighter_lib::{BulbId, BulbMode};
|
use lighter_lib::{BulbId, BulbMode};
|
||||||
use seed::{attrs, button, div, empty, h2, input, table, td, tr, C};
|
use seed::{attrs, button, div, empty, h1, h2, input, label, span, table, td, tr, C};
|
||||||
use seed::{prelude::*, IF};
|
use seed::{prelude::*, IF};
|
||||||
use seed_router::Page;
|
use seed_router::Page;
|
||||||
use std::collections::{BTreeMap, HashSet};
|
use std::collections::{BTreeMap, HashSet};
|
||||||
@ -14,11 +14,16 @@ use std::iter::repeat;
|
|||||||
pub struct Model {
|
pub struct Model {
|
||||||
bulb_states: BTreeMap<BulbId, BulbState>,
|
bulb_states: BTreeMap<BulbId, BulbState>,
|
||||||
|
|
||||||
|
select_mode: SelectMode,
|
||||||
|
|
||||||
bulb_map: BulbMap,
|
bulb_map: BulbMap,
|
||||||
|
|
||||||
/// the currently selected bulb map groups
|
/// the currently selected bulbs on the map
|
||||||
selected_groups: HashSet<usize>,
|
selected_groups: HashSet<usize>,
|
||||||
|
|
||||||
|
/// the currently selected bulbs on the list
|
||||||
|
selected_bulbs: HashSet<BulbId>,
|
||||||
|
|
||||||
/// whether the currently selected map groups have been interacted with
|
/// whether the currently selected map groups have been interacted with
|
||||||
groups_interacted: bool,
|
groups_interacted: bool,
|
||||||
|
|
||||||
@ -37,6 +42,9 @@ pub enum Msg {
|
|||||||
|
|
||||||
SelectGroup(usize),
|
SelectGroup(usize),
|
||||||
DeselectGroups,
|
DeselectGroups,
|
||||||
|
|
||||||
|
SelectBulb(BulbId),
|
||||||
|
|
||||||
ColorPicker(ColorPickerMsg),
|
ColorPicker(ColorPickerMsg),
|
||||||
SetBulbPower(bool),
|
SetBulbPower(bool),
|
||||||
|
|
||||||
@ -46,6 +54,15 @@ pub enum Msg {
|
|||||||
name: String,
|
name: String,
|
||||||
value: Param,
|
value: Param,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
SetSelectMode(SelectMode),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||||
|
pub enum SelectMode {
|
||||||
|
#[default]
|
||||||
|
Map,
|
||||||
|
List,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Page for Model {
|
impl Page for Model {
|
||||||
@ -70,8 +87,6 @@ impl Page for Model {
|
|||||||
mode: new_mode,
|
mode: new_mode,
|
||||||
prefs,
|
prefs,
|
||||||
};
|
};
|
||||||
|
|
||||||
//color_picker.set_color(mode.color);
|
|
||||||
}
|
}
|
||||||
ServerMessage::BulbMap(bulb_map) => {
|
ServerMessage::BulbMap(bulb_map) => {
|
||||||
self.bulb_map = bulb_map;
|
self.bulb_map = bulb_map;
|
||||||
@ -106,6 +121,11 @@ impl Page for Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Msg::SelectBulb(bulb) => {
|
||||||
|
if !self.selected_bulbs.remove(&bulb) {
|
||||||
|
self.selected_bulbs.insert(bulb);
|
||||||
|
}
|
||||||
|
}
|
||||||
Msg::ColorPicker(ColorPickerMsg::SetColor(color)) => {
|
Msg::ColorPicker(ColorPickerMsg::SetColor(color)) => {
|
||||||
self.groups_interacted = true;
|
self.groups_interacted = true;
|
||||||
self.for_selected_bulbs(|id, _| {
|
self.for_selected_bulbs(|id, _| {
|
||||||
@ -150,36 +170,13 @@ impl Page for Model {
|
|||||||
orders.notify(message);
|
orders.notify(message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Msg::SetSelectMode(mode) => {
|
||||||
|
self.select_mode = mode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn view(&self) -> Node<Self::Msg> {
|
fn view(&self) -> Node<Self::Msg> {
|
||||||
//let view_bulb = |(id, (mode, color_picker)): (&BulbId, &(BulbMode, ColorPicker))| {
|
|
||||||
// div![
|
|
||||||
// C![C.bulb_box],
|
|
||||||
// h1![id],
|
|
||||||
// div![
|
|
||||||
// C![C.bulb_controls],
|
|
||||||
// {
|
|
||||||
// let id = id.clone();
|
|
||||||
// color_picker.view().map_msg(|msg| Msg::ColorPicker(id, msg))
|
|
||||||
// },
|
|
||||||
// button![
|
|
||||||
// if mode.power {
|
|
||||||
// C![C.bulb_power_button, C.bulb_power_button_on]
|
|
||||||
// } else {
|
|
||||||
// C![C.bulb_power_button]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// let id = id.clone();
|
|
||||||
// let power = !mode.power;
|
|
||||||
// ev(Ev::Click, move |_| Msg::SetBulbPower(id, power))
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
// ]
|
|
||||||
//};
|
|
||||||
|
|
||||||
let bulb_map_width = self
|
let bulb_map_width = self
|
||||||
.bulb_map
|
.bulb_map
|
||||||
.groups
|
.groups
|
||||||
@ -196,7 +193,7 @@ impl Page for Model {
|
|||||||
.max()
|
.max()
|
||||||
.unwrap_or(0);
|
.unwrap_or(0);
|
||||||
|
|
||||||
let view_bulb_group = |(i, group): (usize, &BulbGroup)| {
|
let bulb_group_map = |(i, group): (usize, &BulbGroup)| {
|
||||||
let (w, h) = (group.shape.width(), group.shape.height());
|
let (w, h) = (group.shape.width(), group.shape.height());
|
||||||
let mut style = String::new();
|
let mut style = String::new();
|
||||||
write!(
|
write!(
|
||||||
@ -227,13 +224,51 @@ impl Page for Model {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
let selected_bulb = self
|
let bulb_group_list = |(_i, group): (usize, &BulbGroup)| {
|
||||||
.selected_groups
|
div![
|
||||||
|
C![C.bulb_list_group],
|
||||||
|
h1![&group.name],
|
||||||
|
group.bulbs.iter().map(|bulb| {
|
||||||
|
let select_ev = || {
|
||||||
|
let bulb = bulb.clone();
|
||||||
|
ev(Ev::Click, |_| Msg::SelectBulb(bulb))
|
||||||
|
};
|
||||||
|
|
||||||
|
button![
|
||||||
|
C![C.bulb_list_bulb],
|
||||||
|
select_ev(),
|
||||||
|
div![
|
||||||
|
C![C.bulb_list_checkbox],
|
||||||
|
label![
|
||||||
|
C![C.container],
|
||||||
|
input![
|
||||||
|
attrs! { At::Type => "checkbox" },
|
||||||
|
IF!(self.selected_bulbs.contains(bulb) => attrs! { At::Checked => true }),
|
||||||
|
select_ev(),
|
||||||
|
],
|
||||||
|
div![C![C.checkmark]],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
span![bulb],
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
// pick one (arbitrary) selected bulb to pull values for the controls from
|
||||||
|
let selected_bulb = if let SelectMode::Map = self.select_mode {
|
||||||
|
self.selected_groups
|
||||||
.iter()
|
.iter()
|
||||||
.next()
|
.next()
|
||||||
.and_then(|&index| self.bulb_map.groups.get(index))
|
.and_then(|&index| self.bulb_map.groups.get(index))
|
||||||
.and_then(|group| group.bulbs.first())
|
.and_then(|group| group.bulbs.first())
|
||||||
.and_then(|id| self.bulb_states.get(id));
|
.and_then(|id| self.bulb_states.get(id))
|
||||||
|
} else {
|
||||||
|
self.selected_bulbs
|
||||||
|
.iter()
|
||||||
|
.next()
|
||||||
|
.and_then(|id| self.bulb_states.get(id))
|
||||||
|
};
|
||||||
|
|
||||||
let script_param = |script: &str, name: &str, value: &Param| {
|
let script_param = |script: &str, name: &str, value: &Param| {
|
||||||
let name = name.to_string();
|
let name = name.to_string();
|
||||||
@ -278,13 +313,35 @@ impl Page for Model {
|
|||||||
div![
|
div![
|
||||||
C![C.bulb_box],
|
C![C.bulb_box],
|
||||||
div![
|
div![
|
||||||
|
C![C.selector_selector],
|
||||||
|
button![
|
||||||
|
"Map",
|
||||||
|
ev(Ev::Click, move |_| Msg::SetSelectMode(SelectMode::Map))
|
||||||
|
],
|
||||||
|
div![
|
||||||
|
C![C.selector_selector_arrow],
|
||||||
|
IF!(self.select_mode == SelectMode::Map =>
|
||||||
|
attrs! { At::Style => "transform: rotateY(180deg);"}),
|
||||||
|
],
|
||||||
|
button![
|
||||||
|
"List",
|
||||||
|
ev(Ev::Click, move |_| Msg::SetSelectMode(SelectMode::List))
|
||||||
|
],
|
||||||
|
],
|
||||||
|
match self.select_mode {
|
||||||
|
SelectMode::Map => div![
|
||||||
C![C.bulb_map],
|
C![C.bulb_map],
|
||||||
attrs! {
|
attrs! {
|
||||||
At::Style => format!("min-width: {}rem; height: {}rem;", bulb_map_width, bulb_map_height),
|
At::Style => format!("min-width: {}rem; height: {}rem;", bulb_map_width, bulb_map_height),
|
||||||
},
|
},
|
||||||
ev(Ev::Click, |_| Msg::DeselectGroups),
|
ev(Ev::Click, |_| Msg::DeselectGroups),
|
||||||
self.bulb_map.groups.iter().enumerate().map(view_bulb_group),
|
self.bulb_map.groups.iter().enumerate().map(bulb_group_map),
|
||||||
],
|
],
|
||||||
|
SelectMode::List => div![
|
||||||
|
C![C.bulb_list],
|
||||||
|
self.bulb_map.groups.iter().enumerate().map(bulb_group_list),
|
||||||
|
],
|
||||||
|
},
|
||||||
div![
|
div![
|
||||||
C![C.bulb_controls],
|
C![C.bulb_controls],
|
||||||
IF!(selected_bulb.is_none() => C![C.cross_out]),
|
IF!(selected_bulb.is_none() => C![C.cross_out]),
|
||||||
@ -326,6 +383,7 @@ impl Page for Model {
|
|||||||
|
|
||||||
impl Model {
|
impl Model {
|
||||||
fn for_selected_bulbs(&mut self, mut f: impl FnMut(&BulbId, &mut BulbState)) {
|
fn for_selected_bulbs(&mut self, mut f: impl FnMut(&BulbId, &mut BulbState)) {
|
||||||
|
if let SelectMode::Map = self.select_mode {
|
||||||
for &index in &self.selected_groups {
|
for &index in &self.selected_groups {
|
||||||
let Some(group) = self.bulb_map.groups.get(index) else {
|
let Some(group) = self.bulb_map.groups.get(index) else {
|
||||||
continue;
|
continue;
|
||||||
@ -337,5 +395,12 @@ impl Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for id in &self.selected_bulbs {
|
||||||
|
if let Some(bulb) = self.bulb_states.get_mut(id) {
|
||||||
|
f(id, bulb);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
frontend/static/images/circle-arrow.svg
Normal file
5
frontend/static/images/circle-arrow.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
|
||||||
|
<ellipse style="vector-effect: non-scaling-stroke; stroke-width: 0px; stroke: rgb(245, 222, 179); fill: rgb(245, 222, 179);" cx="250" cy="250" rx="250" ry="250"/>
|
||||||
|
<path d="M 59.4 209.201 H 308.253 L 274.16 131.459 L 447.051 254.953 L 274.16 378.446 L 308.253 300.704 H 59.4 V 209.201 Z" style="transform-origin: 447.051px 254.952px; stroke-width: 16px; stroke: rgb(193, 168, 123);" bx:shape="arrow 59.4 131.459 387.651 246.987 91.503 172.891 34.093 1@d4e47a6f"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 607 B |
@ -102,6 +102,42 @@ body {
|
|||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* lol i'm so funny */
|
||||||
|
.selector_selector {
|
||||||
|
margin-bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
//background: #534f44;
|
||||||
|
}
|
||||||
|
.selector_selector > button {
|
||||||
|
width: 10rem;
|
||||||
|
border: solid 0.1rem wheat;
|
||||||
|
background-color: #3a3743;
|
||||||
|
color: white;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
border-left: solid white 0.1rem;
|
||||||
|
border-right: solid white 0.1rem;
|
||||||
|
}
|
||||||
|
.selector_selector > button:hover {
|
||||||
|
background-color: #4c4858;
|
||||||
|
}
|
||||||
|
.selector_selector > button:active {
|
||||||
|
background-color: #312e38;
|
||||||
|
}
|
||||||
|
.selector_selector > button:first-child {
|
||||||
|
border-top-left-radius: 0.5rem;
|
||||||
|
}
|
||||||
|
.selector_selector > button:last-child {
|
||||||
|
border-top-right-radius: 0.5rem;
|
||||||
|
}
|
||||||
|
.selector_selector_arrow {
|
||||||
|
position: absolute;
|
||||||
|
width: 2.15rem;
|
||||||
|
height: 2.15rem;
|
||||||
|
background: url("/images/circle-arrow.svg");
|
||||||
|
transition: transform 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
.bulb_controls {
|
.bulb_controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -150,6 +186,47 @@ body {
|
|||||||
}
|
}
|
||||||
@keyframes to_width_90 { to { width: 90%; } }
|
@keyframes to_width_90 { to { width: 90%; } }
|
||||||
|
|
||||||
|
.bulb_list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bulb_list_group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bulb_list_group > h1 {
|
||||||
|
margin-top: 0.6em;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 1.3em;
|
||||||
|
border-bottom: solid 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bulb_list_bulb {
|
||||||
|
font-family: Ubuntu Mono;
|
||||||
|
display: flex;
|
||||||
|
font-size: 0.8em;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
margin-top: 0.3em;
|
||||||
|
background-color: #3a3743;
|
||||||
|
border: solid 0.2em #45374f;
|
||||||
|
border-radius: 0.5em;
|
||||||
|
color: wheat;
|
||||||
|
}
|
||||||
|
.bulb_list_bulb:hover {
|
||||||
|
background-color: #4c4858;
|
||||||
|
}
|
||||||
|
.bulb_list_bulb:active {
|
||||||
|
background-color: #312e38;
|
||||||
|
}
|
||||||
|
.bulb_list_bulb > span {
|
||||||
|
margin: auto;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding-right: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
.bulb_map {
|
.bulb_map {
|
||||||
background: url(images/blueprint_bg.png);
|
background: url(images/blueprint_bg.png);
|
||||||
background-size: auto;
|
background-size: auto;
|
||||||
@ -371,3 +448,65 @@ body {
|
|||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bulb_list_checkbox {}
|
||||||
|
.bulb_list_checkbox input[type="checkbox"] {
|
||||||
|
visibility: hidden;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bulb_list_checkbox *,
|
||||||
|
.bulb_list_checkbox ::after,
|
||||||
|
.bulb_list_checkbox ::before {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bulb_list_checkbox .container {
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 25px;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create a custom checkbox */
|
||||||
|
.bulb_list_checkbox .checkmark {
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 1.3em;
|
||||||
|
width: 1.3em;
|
||||||
|
background: black;
|
||||||
|
border-radius: 50px;
|
||||||
|
transition: all 0.7s;
|
||||||
|
--spread: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When the checkbox is checked, add a blue background */
|
||||||
|
.bulb_list_checkbox .container input:checked ~ .checkmark {
|
||||||
|
background: black;
|
||||||
|
/* spawn a bunch of colored balls and blur them together */
|
||||||
|
box-shadow: -5px -5px var(--spread) 0px #5B51D8, 0 -5px var(--spread) 0px #833AB4, 5px -5px var(--spread) 0px #E1306C, 5px 0 var(--spread) 0px #FD1D1D, 5px 5px var(--spread) 0px #F77737, 0 5px var(--spread) 0px #FCAF45, -5px 5px var(--spread) 0px #FFDC80;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the checkmark/indicator (hidden when not checked) */
|
||||||
|
.bulb_list_checkbox .checkmark::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show the checkmark when checked */
|
||||||
|
.bulb_list_checkbox .container input:checked ~ .checkmark::after {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Style the checkmark/indicator */
|
||||||
|
.bulb_list_checkbox .container .checkmark::after {
|
||||||
|
left: 0.5em;
|
||||||
|
top: 0.34em;
|
||||||
|
width: 0.25em;
|
||||||
|
height: 0.5em;
|
||||||
|
border: solid wheat;
|
||||||
|
border-width: 0 0.15em 0.15em 0;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user