Skip to content
Snippets Groups Projects
Commit 28c85653 authored by Finn Bear's avatar Finn Bear
Browse files

Smol, last-minute fixes.

parent 063e1cb8
No related branches found
No related tags found
No related merge requests found
......@@ -2,42 +2,26 @@
use crate::fade_in::fade_in;
use crate::slide::Slide;
use eframe::egui::style::Margin;
use eframe::egui::{Context, Frame, Ui};
use eframe::egui::{Context, Frame, TextStyle, Ui};
/// A slide that sets some expectations about generative art.
#[derive(Default)]
#[allow(unused)]
pub struct Introduction {
state: IntroductionState,
}
#[allow(unused)]
#[derive(Default)]
enum IntroductionState {
#[default]
Weaknesses,
Strengths {
/// What time we started fading in the strengths.
transition_time: f64,
},
fade_starts: [Option<f64>; 3],
}
impl Slide for Introduction {
#[rustfmt::skip]
#[allow(unused)]
fn transition(&mut self, ctx: &Context) -> bool {
true
/*
match self.state {
IntroductionState::Weaknesses => {
self.state = IntroductionState::Strengths {
transition_time: ctx.input().time,
};
false
for fade_start in &mut self.fade_starts {
if fade_start.is_none() {
*fade_start = Some(ctx.input().time);
return false;
}
IntroductionState::Strengths { .. } => true,
}
*/
true
}
#[rustfmt::skip]
......@@ -45,24 +29,24 @@ impl Slide for Introduction {
Frame::none().margin(Margin::same(20.0)).show(ui, |ui| {
ui.heading("Introduction to Artistic Algorithms");
/*
ui.add_space(8.0);
ui.label("Weaknesses");
ui.small(" ✖ Social context");
ui.small(" ✖ Human emotion");
ui.small(" ✖ Political commentary");
*/
//if let IntroductionState::Strengths { transition_time } = &self.state {
//fade_in(ui, *transition_time, |ui| {
ui.add_space(10.0);
ui.label("Strengths");
ui.small(" ✔ Following rules");
ui.small(" ✔ Performing computation");
ui.small(" ✔ Harnessing chaos and randomness");
ui.small(" ✔ Guided exploration");
//});
//}
ui.add_space(10.0);
ui.scope(|ui| {
{
let body_style = ui.style_mut().text_styles.get_mut(&TextStyle::Body).unwrap();
body_style.size = 36.0;
}
ui.label("Strengths");
ui.add_space(4.0);
});
let strengths = ["Following rules", "Performing computation", "Harnessing chaos and randomness"];
for (strength, fade_start) in strengths.into_iter().zip(&self.fade_starts) {
if let &Some(fade_start) = fade_start {
fade_in(ui, fade_start, |ui| {
ui.label(format!(" ✔ {}", strength));
});
}
}
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment