PHP code example of johannschopplich / kirby-blurry-placeholder
1. Go to this page and download the library: Download johannschopplich/kirby-blurry-placeholder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
johannschopplich / kirby-blurry-placeholder example snippets
<img
src="<?= $image->thumbhashUri()
<!-- Using the `placeholderUri` file method for the `src` attribute -->
<img
src="<?= $image->placeholderUri()
$file->placeholderUri([
'ratio' => 1.5,
'transparent' => true
]);
<img src="<?= $image->placeholderUri(['transparent' => true])
$cropped = $original->crop(500, 400)
return [
'johannschopplich.blurry-placeholder' => [
'pixel-target' => 60,
'kirbytag' => [
'srcset-preset' => 'article'
]
]
];