Skip to content

Commit

Permalink
Merge pull request #1305 from yshui/animation-presets
Browse files Browse the repository at this point in the history
Animation part 4:  Presets
  • Loading branch information
yshui authored Aug 6, 2024
2 parents 0efe479 + 5db4192 commit 1cfd2a0
Show file tree
Hide file tree
Showing 24 changed files with 2,859 additions and 466 deletions.
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
steps:
- build:
build-config: -Dwith_docs=true -Db_coverage=true
- run:
name: build animgen
command: ninja -vC build tools/animgen
- persist_to_workspace:
root: .
paths:
Expand All @@ -54,6 +57,10 @@ jobs:
command: |
ulimit -c unlimited
printf "\n::: test animgen :::\n"
build/tools/animgen data/animation_presets.conf >/dev/null 2>error.log
[ -s error.log ] && cat error.log && exit 1
printf "\n::: Unit tests :::\n"
ninja -vC build test
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ target
!/tests/testcases/*.py

# Misc files
.vscode
*.conf
!/tests/configs/*.conf
!/data/*.conf
perf.data
perf.data.old
core.*
Expand Down
165 changes: 165 additions & 0 deletions data/animation_presets.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
disappear = {
opacity = {
duration = "placeholder0";
start = "window-raw-opacity-before";
end = "window-raw-opacity";
};
blur-opacity = "opacity";
shadow-opacity = "opacity";
offset-x = "(1 - scale-x) / 2 * window-width";
offset-y = "(1 - scale-y) / 2 * window-height";
scale-x = {
curve = "cubic-bezier(0.21, 0.02, 0.76, 0.36)";
duration = "placeholder0";
start = 1;
end = "placeholder1";
};
scale-y = "scale-x";
shadow-scale-x = "scale-x";
shadow-scale-y = "scale-y";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";

# See comments in tools/animgen.c for syntax
*knobs = {
scale = 0.95;
duration = 0.2;
};
*placeholders = ((0, "duration"),(1, "scale"));
};

appear = {
opacity = {
duration = "placeholder0";
start = "window-raw-opacity-before";
end = "window-raw-opacity";
};
blur-opacity = "opacity";
shadow-opacity = "opacity";
offset-x = "(1 - scale-x) / 2 * window-width";
offset-y = "(1 - scale-y) / 2 * window-height";
scale-x = {
curve = "cubic-bezier(0.24, 0.64, 0.79, 0.98)";
duration = "placeholder0";
start = "placeholder1";
end = 1;
};
scale-y = "scale-x";
shadow-scale-x = "scale-x";
shadow-scale-y = "scale-y";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
*knobs = {
scale = 0.95;
duration = 0.2;
};
*placeholders = ((0, "duration"),(1, "scale"));
};

slide-out = {
v-timing = {
curve = "cubic-bezier(0.21, 0.02, 0.76, 0.36)";
start = 0;
duration = "placeholder0";
end = "window-width * placeholder1 + window-height * placeholder2";
};
offset-x = "v-timing * placeholder3";
offset-y = "v-timing * (1 - placeholder3)";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
crop-x = "window-x";
crop-y = "window-y";
crop-width = "window-width";
crop-height = "window-height";
opacity = 1;
blur-opacity = "opacity";
shadow-opacity = "opacity";
*knobs = {
duration = 0.2;
direction = (2, ["up", "down", "left", "right"]);
};
*placeholders = (
(0, "duration"),
(1, "direction", [0, 0, -1, 1]),
(2, "direction", [-1, 1, 0, 0]),
(3, "direction", [0, 0, 1, 1]),
);
};

slide-in = {
v-timing = {
curve = "cubic-bezier(0.24, 0.64, 0.79, 0.98)";
start = "window-width * placeholder1 + window-height * placeholder2";
duration = "placeholder0";
end = 0;
};
offset-x = "v-timing * placeholder3";
offset-y = "v-timing * (1 - placeholder3)";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
crop-x = "window-x";
crop-y = "window-y";
crop-width = "window-width";
crop-height = "window-height";
*knobs = {
duration = 0.2;
direction = (2, ["up", "down", "left", "right"]);
};
*placeholders = (
(0, "duration"),
(1, "direction", [0, 0, -1, 1]),
(2, "direction", [-1, 1, 0, 0]),
(3, "direction", [0, 0, 1, 1]),
);
};

fly-out = {
v-timing = {
curve = "cubic-bezier(0.05, 0, 0.69, -0.05)";
duration = "placeholder0";
start = 0;
end = "(window-height + window-y) * placeholder2 + (window-width + window-x) * placeholder1";
};
offset-x = "v-timing * placeholder3";
offset-y = "v-timing * (1 - placeholder3)";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
opacity = 1;
shadow-opacity = 1;
blur-opacity = 1;
*knobs = {
duration = 0.2;
direction = (0, ["up", "down", "left", "right"]);
};
*placeholders = (
(0, "duration"),
(1, "direction", [0, 0, -1, 1]),
(2, "direction", [-1, 1, 0, 0]),
(3, "direction", [0, 0, 1, 1]),
);
};
fly-in = {
v-timing = {
curve = "cubic-bezier(0.17, 0.67, 0.68, 1.03)";
end = 0;
duration = "placeholder0";
start = "- window-height - window-y";
};
offset-x = "v-timing * placeholder3";
offset-y = "v-timing * (1 - placeholder3)";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
opacity = 1;
shadow-opacity = 1;
blur-opacity = 1;
*knobs = {
duration = 0.2;
direction = (0, ["up", "down", "left", "right"]);
};
*placeholders = (
(0, "duration"),
(1, "direction", [0, 0, -1, 1]),
(2, "direction", [-1, 1, 0, 0]),
(3, "direction", [0, 0, 1, 1]),
);
}
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ test_h_dep = subproject('test.h').get_variable('test_h_dep')

subdir('src')
subdir('man')
subdir('tools')

install_data('bin/picom-trans', install_dir: get_option('bindir'))
install_data('picom.desktop', install_dir: 'share/applications')
Expand Down
Loading

0 comments on commit 1cfd2a0

Please sign in to comment.