Favicon
Class generation favicon for browsers and devices Android, Apple, Windows and display of html code. It supports a large number of settings such as margins, color, compression, three different methods of crop and screen orientation.
Install / Use
/learn @dmamontov/FaviconREADME
Favicon Generator
This class can create Favicon images for sites and mobile devices.
It takes a give base icon image and creates multiple versions of the image for use as favicon on Web sites or be displayed by mobile devices like those using systems of Apple, Microsoft, and Android.
The class can generate all the versions of the icon images with the different sizes, as well the necessary HTML to reference the icon images in a Web page.
The margins, color, compression, crop method and screen orientation are configurable parameters.
Requirements
- PHP version ~5.3.3
- Module installed Imagick
Installation
-
Install composer
-
Follow in the project folder:
composer require dmamontov/favicon ~1.0.0
In config composer.json your project will be added to the library dmamontov/favicon, who settled in the folder vendor/. In the absence of a config file or folder with vendors they will be created.
If before your project is not used composer, connect the startup file vendors. To do this, enter the code in the project:
require 'path/to/vendor/autoload.php';
Example of work
$fav = new FaviconGenerator(__DIR__ . '/tests.png');
$fav->setCompression(FaviconGenerator::COMPRESSION_VERYHIGH);
$fav->setConfig(array(
'apple-background' => FaviconGenerator::COLOR_BLUE,
'apple-margin' => 15,
'android-background' => FaviconGenerator::COLOR_GREEN,
'android-margin' => 15,
'android-name' => 'My app',
'android-url' => 'http://slobel.ru',
'android-orientation' => FaviconGenerator::ANDROID_PORTRAIT,
'ms-background' => FaviconGenerator::COLOR_GREEN,
));
echo $fav->createAllAndGetHtml();
Related Skills
openhue
339.3kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
339.3kElevenLabs text-to-speech with mac-style say UX.
weather
339.3kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
