{"id":13616832,"url":"https://github.com/b-viguier/PhPresent","last_synced_at":"2025-04-14T03:31:44.740Z","repository":{"id":62498505,"uuid":"187702525","full_name":"b-viguier/PhPresent","owner":"b-viguier","description":"Library to create a Slideshow, in PHP","archived":false,"fork":false,"pushed_at":"2019-11-09T19:48:30.000Z","size":4252,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-08T01:37:51.842Z","etag":null,"topics":["imagick","php","sdl2","slideshow"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b-viguier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-20T19:39:19.000Z","updated_at":"2023-01-22T18:52:31.000Z","dependencies_parsed_at":"2022-11-02T11:45:59.790Z","dependency_job_id":null,"html_url":"https://github.com/b-viguier/PhPresent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-viguier%2FPhPresent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-viguier%2FPhPresent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-viguier%2FPhPresent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-viguier%2FPhPresent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-viguier","download_url":"https://codeload.github.com/b-viguier/PhPresent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248815580,"owners_count":21165951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imagick","php","sdl2","slideshow"],"created_at":"2024-08-01T20:01:33.884Z","updated_at":"2025-04-14T03:31:39.730Z","avatar_url":"https://github.com/b-viguier.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# PhPresent\n\n_PhPresent_ is a library allowing to create a slideshow program in Php,\nin the same way that [RevealJs](https://revealjs.com) for Javascript.\nIt is possible thanks to the [Php-SDL extension](https://github.com/Ponup/php-sdl) and\n[Imagick extension](https://www.php.net/manual/en/book.imagick.php).\n\n:warning: This library is freshly new,\nit mays not work as expected in your particular environment.\nGive it a try, and feel free to give some feedback about it.  \n\n## Installation\n\nBe sure to have required extensions:\n* [Php-SDL](https://pecl.php.net/package/sdl)\n* [Imagick](https://pecl.php.net/package/imagick)\n\n:warning: Sometimes, we may need some features of `Php-SDL` not released yet.\nBe aware that some versions might need to compile the extension directly from the sources.\n\nThe create your project and install this library through [Composer](https://getcomposer.org/).\n```bash\ncomposer require bviguier/phpresent\n```\n\n## Usage\nℹ️ Have a look to the `examples` directory to quickly check that all is working fine for you.\nWhen your program is running, press `h` to obtain some help about available commands. \n\n### Bootstrapping your presentation\n\n```php\n\u003c?php\n\nrequire __DIR__.'/../vendor/autoload.php';\n\n// Contains specific implementation.\nuse PhPresent\\Adapter;\n// All stuff related to mathematics.\nuse PhPresent\\Geometry;\n// Here we speak about bitmaps, colours, fonts…\nuse PhPresent\\Graphic;\n// The heart of the matter, the tools to create a presentation.\nuse PhPresent\\Presentation;\n\n/**\n* You need 2 things to create a slideshow:\n*  * A theme, to share some graphic expectations between slides (fonts, colors…)\n*  * A background slide, that will be displayed… in the background!\n*/ \n$presentation = new Presentation\\SlideShow(\n    Graphic\\Theme::createDefault(),\n    new Presentation\\Template\\Simple\\FullscreenColor(Graphic\\Color::white())\n);\n\n// Here, we will have to insert some slides (see next step)\n\n/**\n* The Screen class gives information about the rendering area.\n* Although the window will be resizeable, this initial screen ratio will be used to define the *safe* zone.\n* The safe zone is the larger available area in the screen with the expected size ratio.\n* It will guarantee the final rendering of your slides whatever the actual screen size. \n*/ \n$screen = Presentation\\Screen::fromSizeWithExpectedRatio(Geometry\\Size::fromDimensions(640, 480));\n\n/**\n* The engine that will render your presentation, thanks to SDL extension.\n*/\n$engine = new Adapter\\SDL\\Render\\Engine($screen);\n\n/**\n* The drawer let you create complex images or texts.\n* Current implementation uses Imagick extension.\n*/\n$drawer = new Adapter\\Imagick\\Graphic\\Drawer();\n\n// Let's start the show!\n$engine-\u003estart($presentation, $drawer);\n``` \n\n### Using existing slides templates\nSome templates are provided in the `PhPresent\\Presentation\\Template\\Simple` namespace.\n\n```php\n$presentation\n    -\u003eaddSlide(new Presentation\\Template\\Simple\\TitleAndSubtitle(\n        'PhPresent', 'A Slideshow tool'\n    ))\n    -\u003eaddSlide(new Presentation\\Template\\Simple\\FullscreenAnimatedImage(\n        $bitmapSequenceLoader-\u003efromFile(__DIR__.'/../assets/images/whirlyGif.gif')\n    ))\n    -\u003eaddSlide(new Presentation\\Template\\Simple\\BigTitle(\n        \"Hello\\nWorld!\"\n    ))\n;\n```\n\n\n### Creating your own slides templates\nProvided templates are very generic, and you may quickly want to create your own.\nCheck [`02-creating-slide.php` example](/examples/02-creating-slide.php) to see how it works.\n \n### Creating animated slides\nHere the funny part!\nHave a look to [`03-animating-slide.php` example](/examples/03-animating-slide.php) for more details.\n\n## Contributing\n\n* `composer analyse`: static code analysis\n* `composer cs`: code style (`composer cs-fix` to automatically fix it)\n* `composer deps`: check dependencies between namespaces\n* `composer ci`: run all previous commands for CI \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-viguier%2FPhPresent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-viguier%2FPhPresent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-viguier%2FPhPresent/lists"}