You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-31Lines changed: 20 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,30 @@
1
-
# Generates strings for use in ffmpeg commands to tween between values with easings.
1
+
# Generate FFMpeg easing and tweening strings in Laravel.
2
2
3
3
[](https://packagist.org/packages/projektgopher/laravel-ffmpeg-tween)
This **completely bonkers** string will calculate _just_ the `x` position of a text element. It'll wait 5 seconds, animate the element from 200px left of its final position over 2 seconds with an easing of `EaseOutElastic`. How would you approach changing this to an easing of `EaseOutBounce`? Not gonna happen.
This package allows you to build these string in a fluent way that's easily maintainable in a way that feels familiar to php and Laravel devs. The following example will output the exact same string as above, but imagine how much easier it'll be to change:
15
+
```php
16
+
$finalXpos = '(w*7/8)-text_w';
17
+
$posX = (new Tween)
18
+
->from("{$finalXpos}-200")
19
+
->to($finalXpos)
20
+
->delay(Timing::seconds(5))
21
+
->duration(Timing::seconds(2))
22
+
->ease(Ease::OutElastic);
23
+
```
13
24
14
-
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
25
+
The API is modelled after [The GreenSock Animation Platform (GSAP)](https://greensock.com/get-started/#whatIsGSAP)
26
+
and all the math for the easings is ported from [Easings.net](https://easings.net.)
15
27
16
-
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
17
28
18
29
## Installation
19
30
@@ -23,31 +34,9 @@ You can install the package via composer:
For now this package can only be used within a Laravel app, but there are plans to extract the core functionality out into a separate package that can be used without being bound to the framework.
0 commit comments