add app readme
lots of styling improvements fix dark/bright mode
This commit is contained in:
@@ -17,7 +17,7 @@ tauri-build = { version = "1.3", features = [] }
|
||||
|
||||
uuid = { version = "1.3.3", features = ["v4", "fast-rng", "macro-diagnostics"] }
|
||||
tauri = { version = "1.3", features = ["dialog-open", "dialog-save", "shell-open"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde = { version = "1.0", features = ["derive", "rc"] }
|
||||
serde_json = "1.0"
|
||||
tint = "1.0.0"
|
||||
simple-easing = "1.0.1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::cmp::Ordering;
|
||||
use std::{cmp::Ordering, sync::Arc};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -12,10 +12,26 @@ use super::{
|
||||
pub struct Keyframe {
|
||||
pub value: f32,
|
||||
pub offset: f32,
|
||||
pub id: String,
|
||||
pub id: Arc<str>,
|
||||
pub interpolation: Option<InterpolationType>,
|
||||
}
|
||||
|
||||
impl Keyframe {
|
||||
pub fn new(
|
||||
value: f32,
|
||||
offset: f32,
|
||||
id: Arc<str>,
|
||||
interpolation: Option<InterpolationType>,
|
||||
) -> Self {
|
||||
Keyframe {
|
||||
value,
|
||||
offset,
|
||||
id,
|
||||
interpolation,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct RenderedKeyframe {
|
||||
pub absolute_frame: i32,
|
||||
|
||||
@@ -25,19 +25,19 @@ fn interpolates_the_input() {
|
||||
let keyframes1 = Keyframes {
|
||||
values: vec![
|
||||
Keyframe {
|
||||
id: "1".to_string(),
|
||||
id: "1".into(),
|
||||
value: 0.0,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
},
|
||||
Keyframe {
|
||||
id: "2".to_string(),
|
||||
id: "2".into(),
|
||||
value: 100.0,
|
||||
offset: 1.0,
|
||||
interpolation: None,
|
||||
},
|
||||
Keyframe {
|
||||
id: "3".to_string(),
|
||||
id: "3".into(),
|
||||
value: 300.0,
|
||||
offset: 3.0,
|
||||
interpolation: None,
|
||||
@@ -48,13 +48,13 @@ fn interpolates_the_input() {
|
||||
let keyframes2 = Keyframes {
|
||||
values: vec![
|
||||
Keyframe {
|
||||
id: "4".to_string(),
|
||||
id: "4".into(),
|
||||
value: -100.0,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
},
|
||||
Keyframe {
|
||||
id: "5".to_string(),
|
||||
id: "5".into(),
|
||||
value: 0.0,
|
||||
offset: 1.0,
|
||||
interpolation: None,
|
||||
@@ -150,19 +150,19 @@ fn gets_value_at_frame() {
|
||||
let keyframes = Keyframes {
|
||||
values: vec![
|
||||
Keyframe {
|
||||
id: "1".to_string(),
|
||||
id: "1".into(),
|
||||
value: 0.0,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
},
|
||||
Keyframe {
|
||||
id: "2".to_string(),
|
||||
id: "2".into(),
|
||||
value: 100.0,
|
||||
offset: 1.0,
|
||||
interpolation: None,
|
||||
},
|
||||
Keyframe {
|
||||
id: "3".to_string(),
|
||||
id: "3".into(),
|
||||
value: 300.0,
|
||||
offset: 3.0,
|
||||
interpolation: None,
|
||||
|
||||
@@ -29,7 +29,7 @@ impl AnimatedFloat {
|
||||
AnimatedFloat {
|
||||
keyframes: Keyframes {
|
||||
values: vec![Keyframe {
|
||||
id: Uuid::new_v4().to_string(),
|
||||
id: Uuid::new_v4().to_string().into(),
|
||||
value: val,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
|
||||
@@ -70,7 +70,7 @@ fn build_bg(offset: f32, paint: Paint, size: (i32, i32)) -> AnimatedRectEntity {
|
||||
keyframes: Keyframes {
|
||||
values: vec![
|
||||
Keyframe {
|
||||
id: "1".to_string(),
|
||||
id: "1".into(),
|
||||
value: (size.0 * -1) as f32,
|
||||
offset: 0.0,
|
||||
interpolation: Some(InterpolationType::EasingFunction(
|
||||
@@ -78,7 +78,7 @@ fn build_bg(offset: f32, paint: Paint, size: (i32, i32)) -> AnimatedRectEntity {
|
||||
)),
|
||||
},
|
||||
Keyframe {
|
||||
id: "2".to_string(),
|
||||
id: "2".into(),
|
||||
value: 0.0,
|
||||
offset: 5.0,
|
||||
interpolation: None,
|
||||
@@ -89,7 +89,7 @@ fn build_bg(offset: f32, paint: Paint, size: (i32, i32)) -> AnimatedRectEntity {
|
||||
AnimatedFloat {
|
||||
keyframes: Keyframes {
|
||||
values: vec![Keyframe {
|
||||
id: "3".to_string(),
|
||||
id: "3".into(),
|
||||
value: 0.0,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
@@ -103,7 +103,7 @@ fn build_bg(offset: f32, paint: Paint, size: (i32, i32)) -> AnimatedRectEntity {
|
||||
AnimatedFloat {
|
||||
keyframes: Keyframes {
|
||||
values: vec![Keyframe {
|
||||
id: "4".to_string(),
|
||||
id: "4".into(),
|
||||
interpolation: None,
|
||||
value: size.0 as f32,
|
||||
offset: 0.0,
|
||||
@@ -113,7 +113,7 @@ fn build_bg(offset: f32, paint: Paint, size: (i32, i32)) -> AnimatedRectEntity {
|
||||
AnimatedFloat {
|
||||
keyframes: Keyframes {
|
||||
values: vec![Keyframe {
|
||||
id: "5".to_string(),
|
||||
id: "5".into(),
|
||||
value: size.1 as f32,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
@@ -159,7 +159,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
color: Color::new(0, 0, 0, 1.0),
|
||||
width: 10.0,
|
||||
}),
|
||||
font_name: "Arial".to_string(),
|
||||
font_name: "Arial".into(),
|
||||
align: TextAlign::Center,
|
||||
size: 20.0,
|
||||
};
|
||||
@@ -168,7 +168,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
style: PaintStyle::Fill(FillStyle {
|
||||
color: Color::new(0, 0, 0, 1.0),
|
||||
}),
|
||||
font_name: "Arial".to_string(),
|
||||
font_name: "Arial".into(),
|
||||
align: TextAlign::Center,
|
||||
size: 10.0,
|
||||
};
|
||||
@@ -198,7 +198,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
keyframes: Keyframes {
|
||||
values: vec![
|
||||
Keyframe {
|
||||
id: "1".to_string(),
|
||||
id: "1".into(),
|
||||
value: 0.0,
|
||||
offset: 0.0,
|
||||
interpolation: Some(InterpolationType::Spring(
|
||||
@@ -210,7 +210,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
)),
|
||||
},
|
||||
Keyframe {
|
||||
id: "2".to_string(),
|
||||
id: "2".into(),
|
||||
value: (size.0 / 2) as f32,
|
||||
offset: 2.0,
|
||||
interpolation: None,
|
||||
@@ -221,7 +221,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
AnimatedFloat {
|
||||
keyframes: Keyframes {
|
||||
values: vec![Keyframe {
|
||||
id: "3".to_string(),
|
||||
id: "3".into(),
|
||||
value: (size.1 / 2) as f32,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
@@ -248,7 +248,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
keyframes: Keyframes {
|
||||
values: vec![
|
||||
Keyframe {
|
||||
id: "5".to_string(),
|
||||
id: "5".into(),
|
||||
value: 0.0,
|
||||
offset: 0.0,
|
||||
interpolation: Some(InterpolationType::Spring(
|
||||
@@ -260,7 +260,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
)),
|
||||
},
|
||||
Keyframe {
|
||||
id: "6".to_string(),
|
||||
id: "6".into(),
|
||||
|
||||
value: (size.0 / 2) as f32,
|
||||
offset: 2.0,
|
||||
@@ -272,7 +272,7 @@ pub fn test_timeline_entities_at_frame(
|
||||
AnimatedFloat {
|
||||
keyframes: Keyframes {
|
||||
values: vec![Keyframe {
|
||||
id: "7".to_string(),
|
||||
id: "7".into(),
|
||||
value: ((size.1 / 2) as f32) + 80.0,
|
||||
offset: 0.0,
|
||||
interpolation: None,
|
||||
|
||||
Reference in New Issue
Block a user