Skip to content

Commit 7515260

Browse files
committed
update README
1 parent d25afe0 commit 7515260

File tree

1 file changed

+20
-31
lines changed

1 file changed

+20
-31
lines changed

README.md

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff 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.
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/projektgopher/laravel-ffmpeg-tween.svg?style=flat-square)](https://packagist.org/packages/projektgopher/laravel-ffmpeg-tween)
44
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/projektgopher/laravel-ffmpeg-tween/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/projektgopher/laravel-ffmpeg-tween/actions?query=workflow%3Arun-tests+branch%3Amain)
55
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/projektgopher/laravel-ffmpeg-tween/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/projektgopher/laravel-ffmpeg-tween/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/projektgopher/laravel-ffmpeg-tween.svg?style=flat-square)](https://packagist.org/packages/projektgopher/laravel-ffmpeg-tween)
77

8-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
9-
10-
## Support us
8+
FFMpeg can be opaque in its commands. Take the following example:
9+
```bash
10+
if(lt(t\,5)\,((w*7/8)-text_w-200)\,if(gt(t\,5+2)\,((w*7/8)-text_w)\,((w*7/8)-text_w-200)+((((w*7/8)-text_w)-((w*7/8)-text_w-200))(if(eq(((t-5)/2)\,0)\,0\,if(eq(((t-5)/2)\,1)\,1\,pow(2\,-10((t-5)/2))*sin((((t-5)/2)*10-0.75)*2.0943951023932)+1))))))
11+
```
12+
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.
1113

12-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-ffmpeg-tween.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-ffmpeg-tween)
14+
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+
```
1324

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.)
1527

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).
1728

1829
## Installation
1930

@@ -23,31 +34,9 @@ You can install the package via composer:
2334
composer require projektgopher/laravel-ffmpeg-tween
2435
```
2536

26-
You can publish and run the migrations with:
37+
### Using outside of a Laravel application
2738

28-
```bash
29-
php artisan vendor:publish --tag="laravel-ffmpeg-tween-migrations"
30-
php artisan migrate
31-
```
32-
33-
You can publish the config file with:
34-
35-
```bash
36-
php artisan vendor:publish --tag="laravel-ffmpeg-tween-config"
37-
```
38-
39-
This is the contents of the published config file:
40-
41-
```php
42-
return [
43-
];
44-
```
45-
46-
Optionally, you can publish the views using
47-
48-
```bash
49-
php artisan vendor:publish --tag="laravel-ffmpeg-tween-views"
50-
```
39+
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.
5140

5241
## Usage
5342

0 commit comments

Comments
 (0)