Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
#58 small restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
bennobuilder committed Mar 25, 2024
1 parent 0c989de commit a1de70f
Show file tree
Hide file tree
Showing 76 changed files with 727 additions and 856 deletions.
21 changes: 14 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/comprender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tracing = [
dyn-comp-asset = { path = "../../crates/comp_asset" }
dyn-comp-core = { path = "../../crates/comp_core", features = ["dtif"] }
dyn-comp-dtif = { path = "../../crates/comp_dtif" }
dyn-comp-common = { path = "../../crates/comp_common", features = [
dyn-comp-bundles = { path = "../../crates/comp_bundles", features = [
"serde_support",
] }
dyn-comp-svg-builder = { path = "../../crates/comp_svg_builder", features = [
Expand Down
2 changes: 1 addition & 1 deletion apps/comprender/src/routes/v1/render/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use axum::{
use bevy_app::App;
use bevy_ecs::query::{With, Without};
use dyn_comp_asset::asset::AssetContent;
use dyn_comp_common::mixins::Root;
use dyn_comp_bundles::components::mixins::Root;
use dyn_comp_core::{resources::composition::CompositionRes, CompCorePlugin};
use dyn_comp_dtif::DtifComposition;
use dyn_comp_svg_builder::{svg::svg_bundle::SvgBundleVariant, CompSvgBuilderPlugin};
Expand Down
32 changes: 6 additions & 26 deletions apps/web/src/app/(app)/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,46 +96,26 @@ const DEFAULT_DTIF: COMP.DtifComposition = {
paints: {
p1: {
type: 'Solid',
color: {
red: 229,
green: 229,
blue: 229
}
color: [229, 229, 229]
},
p2: {
type: 'Solid',
color: {
red: 0,
green: 128,
blue: 0
}
color: [0, 128, 0]
},
p3: {
type: 'Solid',
color: {
red: 250,
green: 128,
blue: 114
}
color: [250, 128, 114]
},
p4: {
type: 'Gradient',
variant: { type: 'Linear' },
stops: [
{
color: {
red: 138,
green: 43,
blue: 226
},
color: [138, 43, 226],
position: 0
},
{
color: {
red: 0,
green: 191,
blue: 225
},
color: [0, 191, 225],
position: 1
}
]
Expand All @@ -149,7 +129,7 @@ const DEFAULT_DTIF: COMP.DtifComposition = {
a1: {
content: {
type: 'Url',
url: 'https://raw.githubusercontent.com/dyndotart/monorepo/develop/docs/resources/images/logo-rounded.png'
url: 'https://avatars.githubusercontent.com/u/108551717?s=200&v=4'
},
contentType: { type: 'Png' }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "dyn-comp-common"
name = "dyn-comp-bundles"
version = "0.0.1"
description = ""
edition = { workspace = true }
Expand All @@ -15,6 +15,7 @@ tracing = []

[dependencies]
dyn-comp-asset = { path = "../comp_asset" }
dyn-utils = { path = "../utils" }
bevy_ecs = { workspace = true }
bevy_hierarchy = { workspace = true }
bevy_transform = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::common::{BlendMode, CornerRadii, Opacity, Size};
use bevy_ecs::{component::Component, entity::Entity};
use dyn_comp_asset::asset_id::ImageId;
use dyn_utils::properties::{corner_radii::CornerRadii, opacity::Opacity, size::Size};
use smallvec::SmallVec;

/// Marks an entity as the root or top-level entity.
Expand All @@ -19,6 +19,31 @@ pub struct CornerRadiiMixin(pub CornerRadii);
#[derive(Component, Debug, Default, Copy, Clone)]
pub struct BlendModeMixin(pub BlendMode);

#[derive(Debug, Default, Copy, Clone)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize, specta::Type)
)]
pub enum BlendMode {
#[default]
Normal,
Multiply,
Screen,
Overlay,
Darken,
Lighten,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Hue,
Saturation,
Color,
Luminosity,
}

/// Controls an entity's visibility state.
#[derive(Component, Debug, Default, Copy, Clone)]
pub struct VisibilityMixin(pub bool);
Expand Down
4 changes: 4 additions & 0 deletions crates/comp_bundles/src/components/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod mixins;
pub mod nodes;
pub mod paints;
pub mod styles;
Loading

0 comments on commit a1de70f

Please sign in to comment.