Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
generative_art_cartoon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Finn Bear
generative_art_cartoon
Commits
28c85653
Commit
28c85653
authored
2 years ago
by
Finn Bear
Browse files
Options
Downloads
Patches
Plain Diff
Smol, last-minute fixes.
parent
063e1cb8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/slide/s2_introduction.rs
+24
-40
24 additions, 40 deletions
src/slide/s2_introduction.rs
with
24 additions
and
40 deletions
src/slide/s2_introduction.rs
+
24
−
40
View file @
28c85653
...
...
@@ -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
));
});
}
}
});
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment