🚿 examples cleanup

This commit is contained in:
smiley
2023-03-12 02:16:38 +01:00
parent 11d696ee39
commit 6b92bb4c6f
14 changed files with 351 additions and 443 deletions
+38 -43
View File
@@ -1,7 +1,5 @@
<?php
/**
*
* @filesource html.php
* @created 21.12.2017
* @author Smiley <smiley@chillerlan.net>
* @copyright 2017 Smiley
@@ -9,9 +7,45 @@
*/
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
require_once '../vendor/autoload.php';
$options = new QROptions([
'version' => 5,
'outputType' => QRCode::OUTPUT_MARKUP_HTML,
'cssClass' => 'qrcode',
'eccLevel' => QRCode::ECC_L,
'moduleValues' => [
// finder
(QRMatrix::M_FINDER << 8) => '#A71111', // dark (true)
(QRMatrix::M_FINDER_DOT << 8) => '#A71111',
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
// alignment
(QRMatrix::M_ALIGNMENT << 8) => '#A70364',
QRMatrix::M_ALIGNMENT => '#FFC9C9',
// timing
(QRMatrix::M_TIMING << 8) => '#98005D',
QRMatrix::M_TIMING => '#FFB8E9',
// format
(QRMatrix::M_FORMAT << 8) => '#003804',
QRMatrix::M_FORMAT => '#00FB12',
// version
(QRMatrix::M_VERSION << 8) => '#650098',
QRMatrix::M_VERSION => '#E0B8FF',
// data
(QRMatrix::M_DATA << 8) => '#4A6000',
QRMatrix::M_DATA => '#ECF9BE',
// darkmodule
(QRMatrix::M_DARKMODULE << 8) => '#080063',
// separator
QRMatrix::M_SEPARATOR => '#AFBFBF',
// quietzone
QRMatrix::M_QUIETZONE => '#FFFFFF',
],
]);
header('Content-Type: text/html; charset=utf-8');
?>
@@ -23,7 +57,7 @@ header('Content-Type: text/html; charset=utf-8');
<title>QRCode test</title>
<style>
body{
margin: 5em;
margin: 1em;
padding: 0;
}
@@ -52,49 +86,10 @@ header('Content-Type: text/html; charset=utf-8');
</style>
</head>
<body>
<div class="qrcode">
<?php
$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
$options = new QROptions([
'version' => 5,
'outputType' => QRCode::OUTPUT_MARKUP_HTML,
'eccLevel' => QRCode::ECC_L,
'moduleValues' => [
// finder
1536 => '#A71111', // dark (true)
6 => '#FFBFBF', // light (false)
// alignment
2560 => '#A70364',
10 => '#FFC9C9',
// timing
3072 => '#98005D',
12 => '#FFB8E9',
// format
3584 => '#003804',
14 => '#00FB12',
// version
4096 => '#650098',
16 => '#E0B8FF',
// data
1024 => '#4A6000',
4 => '#ECF9BE',
// darkmodule
512 => '#080063',
// separator
8 => '#AFBFBF',
// quietzone
18 => '#FFFFFF',
],
]);
echo (new QRCode($options))->render($data);
echo (new QRCode($options))->render('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
?>
</div>
</body>
</html>