wiki: Clarify animations
Browse files at this commitdee0abb713105b68b58014d65d569b557e6ccf44Parent: bbb4a641 changed file +58 -41
wiki/Configuration:-Animations.mdmodified+58 -41
| @@ -20,14 +20,6 @@ animations { | ||
| 20 | 20 | spring damping-ratio=1.0 stiffness=1000 epsilon=0.0001 |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - horizontal-view-movement { | |
| 24 | - spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 25 | - } | |
| 26 | - | |
| 27 | - window-movement { | |
| 28 | - spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 29 | - } | |
| 30 | - | |
| 31 | 23 | window-open { |
| 32 | 24 | duration-ms 150 |
| 33 | 25 | curve "ease-out-expo" |
| @@ -38,6 +30,14 @@ animations { | ||
| 38 | 30 | curve "ease-out-quad" |
| 39 | 31 | } |
| 40 | 32 | |
| 33 | + horizontal-view-movement { | |
| 34 | + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 35 | + } | |
| 36 | + | |
| 37 | + window-movement { | |
| 38 | + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 39 | + } | |
| 40 | + | |
| 41 | 41 | window-resize { |
| 42 | 42 | spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 |
| 43 | 43 | } |
| @@ -132,75 +132,73 @@ animations { | ||
| 132 | 132 | } |
| 133 | 133 | ``` |
| 134 | 134 | |
| 135 | -#### `horizontal-view-movement` | |
| 135 | +#### `window-open` | |
| 136 | 136 | |
| 137 | -All horizontal camera view movement animations, such as: | |
| 137 | +Window opening animation. | |
| 138 | 138 | |
| 139 | -- When a window off-screen is focused and the camera scrolls to it. | |
| 140 | -- When a new window appears off-screen and the camera scrolls to it. | |
| 141 | -- When a window resizes bigger and the camera scrolls to show it in full. | |
| 142 | - - Since 0.1.5, animated window resizes will use the `window-resize` animation parameters for the view animation to make them synchronized. | |
| 143 | -- After a horizontal touchpad gesture (a spring is recommended). | |
| 139 | +This one uses an easing type by default. | |
| 144 | 140 | |
| 145 | 141 | ``` |
| 146 | 142 | animations { |
| 147 | - horizontal-view-movement { | |
| 148 | - spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 143 | + window-open { | |
| 144 | + duration-ms 150 | |
| 145 | + curve "ease-out-expo" | |
| 149 | 146 | } |
| 150 | 147 | } |
| 151 | 148 | ``` |
| 152 | 149 | |
| 153 | -#### `window-movement` | |
| 150 | +#### `window-close` | |
| 154 | 151 | |
| 155 | 152 | <sup>Since: 0.1.5</sup> |
| 156 | 153 | |
| 157 | -Movement of individual windows within a workspace. | |
| 158 | - | |
| 159 | -Includes: | |
| 160 | - | |
| 161 | -- Moving window columns with `move-column-left` and `move-column-right`. | |
| 162 | -- Moving windows inside a column with `move-window-up` and `move-window-down`. | |
| 163 | -- Since 0.1.5, moving windows out of the way upon window opening and closing. | |
| 164 | -- Since 0.1.5, window movement between columns when consuming/expelling. | |
| 154 | +Window closing animation. | |
| 165 | 155 | |
| 166 | -This animation *does not* include the camera view movement, such as scrolling the workspace left and right. | |
| 156 | +This one uses an easing type by default. | |
| 167 | 157 | |
| 168 | 158 | ``` |
| 169 | 159 | animations { |
| 170 | - window-movement { | |
| 171 | - spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 160 | + window-open { | |
| 161 | + duration-ms 150 | |
| 162 | + curve "ease-out-quad" | |
| 172 | 163 | } |
| 173 | 164 | } |
| 174 | 165 | ``` |
| 175 | 166 | |
| 176 | -#### `window-open` | |
| 167 | +#### `horizontal-view-movement` | |
| 177 | 168 | |
| 178 | -Window opening animation. | |
| 169 | +All horizontal camera view movement animations, such as: | |
| 179 | 170 | |
| 180 | -This one uses an easing type by default. | |
| 171 | +- When a window off-screen is focused and the camera scrolls to it. | |
| 172 | +- When a new window appears off-screen and the camera scrolls to it. | |
| 173 | +- After a horizontal touchpad gesture (a spring is recommended). | |
| 181 | 174 | |
| 182 | 175 | ``` |
| 183 | 176 | animations { |
| 184 | - window-open { | |
| 185 | - duration-ms 150 | |
| 186 | - curve "ease-out-expo" | |
| 177 | + horizontal-view-movement { | |
| 178 | + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 187 | 179 | } |
| 188 | 180 | } |
| 189 | 181 | ``` |
| 190 | 182 | |
| 191 | -#### `window-close` | |
| 183 | +#### `window-movement` | |
| 192 | 184 | |
| 193 | 185 | <sup>Since: 0.1.5</sup> |
| 194 | 186 | |
| 195 | -Window closing animation. | |
| 187 | +Movement of individual windows within a workspace. | |
| 196 | 188 | |
| 197 | -This one uses an easing type by default. | |
| 189 | +Includes: | |
| 190 | + | |
| 191 | +- Moving window columns with `move-column-left` and `move-column-right`. | |
| 192 | +- Moving windows inside a column with `move-window-up` and `move-window-down`. | |
| 193 | +- Moving windows out of the way upon window opening and closing. | |
| 194 | +- Window movement between columns when consuming/expelling. | |
| 195 | + | |
| 196 | +This animation *does not* include the camera view movement, such as scrolling the workspace left and right. | |
| 198 | 197 | |
| 199 | 198 | ``` |
| 200 | 199 | animations { |
| 201 | - window-open { | |
| 202 | - duration-ms 150 | |
| 203 | - curve "ease-out-quad" | |
| 200 | + window-movement { | |
| 201 | + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 | |
| 204 | 202 | } |
| 205 | 203 | } |
| 206 | 204 | ``` |
| @@ -235,3 +233,22 @@ animations { | ||
| 235 | 233 | } |
| 236 | 234 | } |
| 237 | 235 | ``` |
| 236 | + | |
| 237 | +### Synchronized Animations | |
| 238 | + | |
| 239 | +<sup>Since: 0.1.5</sup> | |
| 240 | + | |
| 241 | +Sometimes, when two animations are meant to play together synchronized, niri will drive them both with the same configuration. | |
| 242 | + | |
| 243 | +For example, if a window resize causes the view to move, then that view movement animation will also use the `window-resize` configuration (rather than the `horizontal-view-movement` configuration). | |
| 244 | +This is especially important for animated resizes to look good when using `center-focused-column "always"`. | |
| 245 | + | |
| 246 | +As another example, resizing a window in a column vertically causes other windows to move up or down into their new position. | |
| 247 | +This movement will use the `window-resize` configuration, rather than the `window-movement` configuration, to keep the animations synchronized. | |
| 248 | + | |
| 249 | +A few actions are still missing this synchronization logic, since in some cases it is difficult to implement properly. | |
| 250 | +Therefore, for the best results, consider using the same parameters for related animations (they are all the same by default): | |
| 251 | + | |
| 252 | +- `horizontal-view-movement` | |
| 253 | +- `window-movement` | |
| 254 | +- `window-resize` |