Skip to content

Commit 155df3b

Browse files
committed
chore: updated tapes
1 parent a925a11 commit 155df3b

File tree

13 files changed

+81
-60
lines changed

13 files changed

+81
-60
lines changed

assets/style-rule.gif

588 KB
Loading

assets/stylize-other-widget.gif

419 KB
Loading

examples/hello-shader/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn main() -> std::io::Result<()> {
1010
if start_time.elapsed().as_secs() > 5 {
1111
break;
1212
}
13-
std::thread::sleep(std::time::Duration::from_millis(50));
13+
std::thread::sleep(std::time::Duration::from_millis(10));
1414
}
1515
ratatui::restore();
1616
Ok(())

examples/pipe-into/main.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,7 @@ pub fn main() -> std::io::Result<()> {
66
}
77

88
let mut terminal = ratatui::init();
9-
let mut state = tui_shader::ShaderCanvasState::new_with_options(
10-
"shaders/gradient.wgsl",
11-
// This sets the character for our ShaderCanvas to use to a Space,
12-
// which never displays the foreground color. This way we can use
13-
// the foreground coloring for a character that we specify in a
14-
// different widget
15-
tui_shader::ShaderCanvasOptions {
16-
character_rule: tui_shader::CharacterRule::Always(' '),
17-
..Default::default()
18-
},
19-
);
9+
let mut state = tui_shader::ShaderCanvasState::new("shaders/gradient.wgsl");
2010

2111
let start_time = std::time::Instant::now();
2212
loop {
@@ -27,7 +17,7 @@ pub fn main() -> std::io::Result<()> {
2717
if start_time.elapsed().as_secs() > 5 {
2818
break;
2919
}
30-
std::thread::sleep(std::time::Duration::from_millis(50));
20+
std::thread::sleep(std::time::Duration::from_millis(10));
3121
}
3222
ratatui::restore();
3323
Ok(())
File renamed without changes.

examples/style-rule/color-rule.tape

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/style-rule/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pub fn main() -> std::io::Result<()> {
33
let mut state = tui_shader::ShaderCanvasState::new_with_options(
44
"shaders/gradient.wgsl",
55
tui_shader::ShaderCanvasOptions {
6-
character_rule: tui_shader::CharacterRule::Always(' '),
76
style_rule: tui_shader::StyleRule::Map(|sample| {
87
let color = ratatui::style::Color::Rgb(sample.r(), sample.g(), sample.b());
98
let sum = sample.r() as u16 + sample.g() as u16 + sample.b() as u16;
@@ -49,7 +48,7 @@ pub fn main() -> std::io::Result<()> {
4948
if start_time.elapsed().as_secs() > 7 {
5049
break;
5150
}
52-
std::thread::sleep(std::time::Duration::from_millis(20));
51+
std::thread::sleep(std::time::Duration::from_millis(10));
5352
}
5453
ratatui::restore();
5554
Ok(())
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Output "assets/style-rule.gif"
2+
Set PlaybackSpeed 0.75
3+
Set FontFamily "JetBrainsMonoNL NF"
4+
Set FontSize 9
5+
Set Width 720
6+
Set Height 240
7+
Hide
8+
Type "cargo run --example=style-rule"
9+
Enter
10+
Sleep 1s
11+
Show
12+
Sleep 6s

examples/stylize-other-widget/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ pub fn main() -> std::io::Result<()> {
66
"shaders/voronoi.wgsl",
77
tui_shader::ShaderCanvasOptions {
88
character_rule: tui_shader::CharacterRule::Always(' '),
9+
style_rule: tui_shader::StyleRule::ColorFg,
910
..Default::default()
1011
},
1112
);
1213
let mut bg_shader_state = tui_shader::ShaderCanvasState::new_with_options(
1314
"shaders/starlight.wgsl",
1415
tui_shader::ShaderCanvasOptions {
1516
character_rule: tui_shader::CharacterRule::Always(' '),
16-
style_rule: tui_shader::StyleRule::ColorBg,
1717
..Default::default()
1818
},
1919
);
@@ -47,7 +47,7 @@ pub fn main() -> std::io::Result<()> {
4747
&mut list_state,
4848
);
4949
})?;
50-
std::thread::sleep(std::time::Duration::from_millis(50));
50+
std::thread::sleep(std::time::Duration::from_millis(10));
5151
}
5252
ratatui::restore();
5353
Ok(())
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Output "assets/stylize-other-widget.gif"
22
Set FontFamily "JetBrainsMonoNL NF"
3+
Set FontSize 10
34
Set Width 400
4-
Set Height 200
5+
Set Height 300
56
Hide
67
Type "cargo run --example=stylize-other-widget"
78
Enter
8-
Sleep 2s
9+
Sleep 1s
910
Show
10-
Sleep 6.4s
11+
Sleep 5s

0 commit comments

Comments
 (0)