diff --git a/README.md b/README.md index 1d401a4..716c072 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ![Logo](themes/defaut/favicons/32.png) Générateur de codes QR +# ![](themes/defaut/favicons/32.png) LibreQR ## Présentation @@ -26,7 +26,9 @@ Placez ce code source dans un serveur Web avec PHP, tout simplement. ### YunoHost -J'ai créé un [paquet](https://code.antopie.org/miraty/qr_ynh/) [YunoHost](https://yunohost.org/). +J'ai créé un [paquet](https://code.antopie.org/miraty/qr_ynh/) pour [YunoHost](https://yunohost.org/). + +Vous pouvez l'installer depuis l'interface d'administration ou avec cette commande : ``` sudo yunohost app install https://code.antopie.org/miraty/qr_ynh/ @@ -40,14 +42,14 @@ Dans options.inc.php, donnez à $theme le nom du thème voulu. Par défaut, deux thèmes sont proposés : -* defaut, le thème par défaut, sombre. Il est utilisé ici : +* dark, le thème par défaut, sombre. Il est utilisé ici : * parinux, un thème bleu, créé pour [Bastet](https://bastet.parinux.org/), le chaton de [Parinux](https://parinux.org/). Il est utilisé ici : ### Créer un thème -* Copiez themes/defaut vers themes/[nom de votre thème] -* Depuis ce nouveau dossier, créez les icônes dans favicons/[longueur du côté de l'icone].png -* Complétez theme.php en fonctions des favicons créées précédemment et des couleurs CSS voulues dans l'interface +* Copiez themes/dark vers themes/[nom de votre thème] +* Depuis ce nouveau dossier, créez les icônes dans favicons/[longueur d'un côté de l'icône].png +* Complétez theme.php en fonction des favicons créées précédemment et des couleurs CSS voulues dans l'interface ## Bibliothèques tierces @@ -61,8 +63,8 @@ Ce code source inclus : [AGPLv3+](https://code.antopie.org/miraty/qr/src/branch/master/LICENSE) -Ce générateur de codes QR est un logiciel libre ; vous pouvez le diffuser et le modifier suivant les termes de la GNU Affero General Public License telle que publiée par la Free Software Foundation ; soit la version 3 de cette licence, soit (à votre convenance) une version ultérieure. +LibreQR est un logiciel libre ; vous pouvez le diffuser et le modifier suivant les termes de la GNU Affero General Public License telle que publiée par la Free Software Foundation ; soit la version 3 de cette licence, soit (à votre convenance) une version ultérieure. -Ce générateur de codes QR est diffusé dans l’espoir qu’il sera utile, mais SANS AUCUNE GARANTIE ; sans même une garantie implicite de COMMERCIALISATION ou d’ADÉQUATION À UN USAGE PARTICULIER. Voyez la GNU Affero General Public License pour plus de détails. +LibreQR est diffusé dans l’espoir qu’il sera utile, mais SANS AUCUNE GARANTIE ; sans même une garantie implicite de COMMERCIALISATION ou d’ADÉQUATION À UN USAGE PARTICULIER. Voyez la GNU Affero General Public License pour plus de détails. Vous devriez avoir reçu une copie de la GNU Affero General Public License avec ce code. Sinon, consultez diff --git a/aide.svg b/aide.svg index b6cba09..b57a54f 100755 --- a/aide.svg +++ b/aide.svg @@ -2,8 +2,8 @@ - " stroke-width="2" cx="12" cy="12" r="10"> - "> + " stroke-width="2" cx="12" cy="12" r="10"> + "> diff --git a/index.php b/index.php index b62e830..1497001 100755 --- a/index.php +++ b/index.php @@ -1,242 +1,248 @@ + + Générateur de codes QR - + - - - ' . "\n"; - } ?> + foreach($themeDimensionsFavicons as $dimFav) { // Indique toutes les dimensions de favicons + echo ' ' . "\n"; + } ?> -
-

Générateur de codes QR

-
+
- +
+

Générateur de codes QR

+
-
-
- - - - Vous pouvez encoder ce que vous voulez sous forme de texte. - -
- -
- - -
- -
- - - - Par combien les dimensions de l'image seront-elles multipliées ? - -
-
- "> -
-
- -
- - - - Nombre de pixels des bandes blanches autour du code QR. - -
-
- "> -
-
- -
+ +
- -
- -
-
- -
-
-
- - -
+ +
+ + + + Nombre de pixels des bandes blanches autour du code QR. + +
+ +
- QRcode::png($_POST['texte'], $cheminImage, $_POST['redondance'], $_POST['taille'], $_POST['marge'], false, hexdec($_POST['couleurFond']), hexdec($_POST['couleurPrincipale'])); ?> +
+ + + + Par combien les dimensions de l'image seront-elles multipliées ? + + +
+ +
- -

- - +
- - if (empty($_GET["texte"])) { // Si rien n'a été recherché ?> - Erreur : vous ne pouvez pas générer un code QR vide ! +
- + +
+ "> +
+
- require "phpqrcode.php"; - $cheminImage = "temp/" . generateRandomString(50) . ".png"; +
+ +
+ "> +
+
- QRcode::png($_GET['texte'], $cheminImage, "H", 4, 2); ?> + -
+
+
+ +
- Vous avez créé un code QR contenant : -
+ -
+ - Télécharger ce code QR - -

- + if (!empty($_GET['text']) AND !empty($_GET['size']) AND !empty($_GET['redondancy']) AND !empty($_GET['margin']) AND !empty($_GET['bgColor']) AND !empty($_GET['mainColor'])) { + if (isset($_GET['text']) AND isset($_GET['size']) AND isset($_GET['redondancy']) AND isset($_GET['margin']) AND isset($_GET['bgColor']) AND isset($_GET['mainColor'])) { + require "phpqrcode.php"; + $cheminImage = "temp/" . generateRandomString(64) . ".png"; + QRcode::png($_GET['text'], $cheminImage); ?> + + +

+ + - +
Qu'est-ce qu'un code QR ?
- Un code QR est une image en 2 dimensions dans laquelle est inscrite en binaire des informations textuelles.
- Un pixel blanc représente un 0 et un pixel noir représente un 1.
+ Un code QR est un code-barres en 2 dimensions dans lequel est inscrit en binaire du texte. Il peut être décodé avec un appareil muni d'un capteur photo et d'un logiciel adéquat. Code QR sur Wikipédia
- - diff --git a/manifest.php b/manifest.php index 7e78eed..f3c52d4 100755 --- a/manifest.php +++ b/manifest.php @@ -2,29 +2,24 @@ { "dir": "ltr", "lang": "fr-FR", - "name": "Générateur de code QR", - "short_name": "Code QR", - "description": "Générez un code QR rapidement", + "name": "LibreQR", + "short_name": "LibreQR", + "description": "Générer un code QR rapidement", "start_url": "", "scope": "", "display": "standalone", - "theme_color": "", - "background_color": "", + "theme_color": "", + "background_color": "", "orientation": "portrait", "icons": [ - - { - "src": "themes//favicons/.png", - "sizes": "x", - "type": "image/png" - }, - - + + { + "src": "themes//favicons/.png", + "sizes": "x", + "type": "image/png" + }, + { "src": "themes//favicons/.png", "sizes": "x", diff --git a/opensearch.php b/opensearch.php index 9d9833b..b8d92f7 100755 --- a/opensearch.php +++ b/opensearch.php @@ -10,6 +10,6 @@ ?> fr UTF-8 - + diff --git a/options.inc.php b/options.inc.php index 44386bf..bbc0c4e 100755 --- a/options.inc.php +++ b/options.inc.php @@ -1,9 +1,10 @@ diff --git a/phpqrcode.php b/phpqrcode.php index c3afc9d..c2c92f0 100755 --- a/phpqrcode.php +++ b/phpqrcode.php @@ -34,19 +34,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - -/* - * Version: 1.1.4 - * Build: 2010100721 - */ - - - -//---- qrconst.php ----------------------------- - - - + + +/* + * Version: 1.1.4 + * Build: 2010100721 + */ + + + +//---- qrconst.php ----------------------------- + + + /* @@ -100,14 +100,14 @@ public static function set(&$srctab, $x, $y, $repl, $replLen = false) { $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); } - } - - - -//---- merged_config.php ----------------------------- - - - + } + + + +//---- merged_config.php ----------------------------- + + + /* * PHP QR Code encoder @@ -124,206 +124,206 @@ define('QR_DEFAULT_MASK', 2); // when QR_FIND_BEST_MASK === false define('QR_PNG_MAXIMUM_SIZE', 1024); // maximum allowed png image width (in pixels), tune to make sure GD and PHP can handle such big images - - - - -//---- qrtools.php ----------------------------- - - - - -/* - * PHP QR Code encoder - * - * Toolset, handy and debug utilites. - * - * PHP QR Code is distributed under LGPL 3 - * Copyright (C) 2010 Dominik Dzienia - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - class QRtools { - - //---------------------------------------------------------------------- - public static function binarize($frame) - { - $len = count($frame); - foreach ($frame as &$frameLine) { - - for($i=0; $i<$len; $i++) { - $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; - } - } - - return $frame; - } - - //---------------------------------------------------------------------- - public static function tcpdfBarcodeArray($code, $mode = 'QR,L', $tcPdfVersion = '4.5.037') - { - $barcode_array = array(); - - if (!is_array($mode)) - $mode = explode(',', $mode); - - $eccLevel = 'L'; - - if (count($mode) > 1) { - $eccLevel = $mode[1]; - } - - $qrTab = QRcode::text($code, false, $eccLevel); - $size = count($qrTab); - - $barcode_array['num_rows'] = $size; - $barcode_array['num_cols'] = $size; - $barcode_array['bcode'] = array(); - - foreach ($qrTab as $line) { - $arrAdd = array(); - foreach(str_split($line) as $char) - $arrAdd[] = ($char=='1')?1:0; - $barcode_array['bcode'][] = $arrAdd; - } - - return $barcode_array; - } - - //---------------------------------------------------------------------- - public static function clearCache() - { - self::$frames = array(); - } - - //---------------------------------------------------------------------- - public static function buildCache() - { - QRtools::markTime('before_build_cache'); - - $mask = new QRmask(); - for ($a=1; $a <= QRSPEC_VERSION_MAX; $a++) { - $frame = QRspec::newFrame($a); - if (QR_IMAGE) { - $fileName = QR_CACHE_DIR.'frame_'.$a.'.png'; - QRimage::png(self::binarize($frame), $fileName, 1, 0); - } - - $width = count($frame); - $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); - for ($maskNo=0; $maskNo<8; $maskNo++) - $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true); - } - - QRtools::markTime('after_build_cache'); - } - - //---------------------------------------------------------------------- - public static function log($outfile, $err) - { - if (QR_LOG_DIR !== false) { - if ($err != '') { - if ($outfile !== false) { - file_put_contents(QR_LOG_DIR.basename($outfile).'-errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); - } else { - file_put_contents(QR_LOG_DIR.'errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); - } - } - } - } - - //---------------------------------------------------------------------- - public static function dumpMask($frame) - { - $width = count($frame); - for($y=0;$y<$width;$y++) { - for($x=0;$x<$width;$x++) { - echo ord($frame[$y][$x]).','; - } - } - } - - //---------------------------------------------------------------------- - public static function markTime($markerId) - { - list($usec, $sec) = explode(" ", microtime()); - $time = ((float)$usec + (float)$sec); - - if (!isset($GLOBALS['qr_time_bench'])) - $GLOBALS['qr_time_bench'] = array(); - - $GLOBALS['qr_time_bench'][$markerId] = $time; - } - - //---------------------------------------------------------------------- - public static function timeBenchmark() - { - self::markTime('finish'); - - $lastTime = 0; - $startTime = 0; - $p = 0; - - echo ' - - '; - - foreach($GLOBALS['qr_time_bench'] as $markerId=>$thisTime) { - if ($p > 0) { - echo ''; - } else { - $startTime = $thisTime; - } - - $p++; - $lastTime = $thisTime; - } - - echo ' - - -
BENCHMARK
till '.$markerId.': '.number_format($thisTime-$lastTime, 6).'s
TOTAL: '.number_format($lastTime-$startTime, 6).'s
'; - } - - public static function save($content, $filename_path) - { - try { - $handle = fopen($filename_path, "w"); - fwrite($handle, $content); - fclose($handle); - return true; - } catch (Exception $e) { - echo 'Exception reçue : ', $e->getMessage(), "\n"; - } - - } - - } - - //########################################################################## - - QRtools::markTime('start'); - - - - -//---- qrspec.php ----------------------------- - - - + + + + +//---- qrtools.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Toolset, handy and debug utilites. + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRtools { + + //---------------------------------------------------------------------- + public static function binarize($frame) + { + $len = count($frame); + foreach ($frame as &$frameLine) { + + for($i=0; $i<$len; $i++) { + $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; + } + } + + return $frame; + } + + //---------------------------------------------------------------------- + public static function tcpdfBarcodeArray($code, $mode = 'QR,L', $tcPdfVersion = '4.5.037') + { + $barcode_array = array(); + + if (!is_array($mode)) + $mode = explode(',', $mode); + + $eccLevel = 'L'; + + if (count($mode) > 1) { + $eccLevel = $mode[1]; + } + + $qrTab = QRcode::text($code, false, $eccLevel); + $size = count($qrTab); + + $barcode_array['num_rows'] = $size; + $barcode_array['num_cols'] = $size; + $barcode_array['bcode'] = array(); + + foreach ($qrTab as $line) { + $arrAdd = array(); + foreach(str_split($line) as $char) + $arrAdd[] = ($char=='1')?1:0; + $barcode_array['bcode'][] = $arrAdd; + } + + return $barcode_array; + } + + //---------------------------------------------------------------------- + public static function clearCache() + { + self::$frames = array(); + } + + //---------------------------------------------------------------------- + public static function buildCache() + { + QRtools::markTime('before_build_cache'); + + $mask = new QRmask(); + for ($a=1; $a <= QRSPEC_VERSION_MAX; $a++) { + $frame = QRspec::newFrame($a); + if (QR_IMAGE) { + $fileName = QR_CACHE_DIR.'frame_'.$a.'.png'; + QRimage::png(self::binarize($frame), $fileName, 1, 0); + } + + $width = count($frame); + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + for ($maskNo=0; $maskNo<8; $maskNo++) + $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true); + } + + QRtools::markTime('after_build_cache'); + } + + //---------------------------------------------------------------------- + public static function log($outfile, $err) + { + if (QR_LOG_DIR !== false) { + if ($err != '') { + if ($outfile !== false) { + file_put_contents(QR_LOG_DIR.basename($outfile).'-errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); + } else { + file_put_contents(QR_LOG_DIR.'errors.txt', date('Y-m-d H:i:s').': '.$err, FILE_APPEND); + } + } + } + } + + //---------------------------------------------------------------------- + public static function dumpMask($frame) + { + $width = count($frame); + for($y=0;$y<$width;$y++) { + for($x=0;$x<$width;$x++) { + echo ord($frame[$y][$x]).','; + } + } + } + + //---------------------------------------------------------------------- + public static function markTime($markerId) + { + list($usec, $sec) = explode(" ", microtime()); + $time = ((float)$usec + (float)$sec); + + if (!isset($GLOBALS['qr_time_bench'])) + $GLOBALS['qr_time_bench'] = array(); + + $GLOBALS['qr_time_bench'][$markerId] = $time; + } + + //---------------------------------------------------------------------- + public static function timeBenchmark() + { + self::markTime('finish'); + + $lastTime = 0; + $startTime = 0; + $p = 0; + + echo ' + + '; + + foreach($GLOBALS['qr_time_bench'] as $markerId=>$thisTime) { + if ($p > 0) { + echo ''; + } else { + $startTime = $thisTime; + } + + $p++; + $lastTime = $thisTime; + } + + echo ' + + +
BENCHMARK
till '.$markerId.': '.number_format($thisTime-$lastTime, 6).'s
TOTAL: '.number_format($lastTime-$startTime, 6).'s
'; + } + + public static function save($content, $filename_path) + { + try { + $handle = fopen($filename_path, "w"); + fwrite($handle, $content); + fclose($handle); + return true; + } catch (Exception $e) { + echo 'Exception reçue : ', $e->getMessage(), "\n"; + } + + } + + } + + //########################################################################## + + QRtools::markTime('start'); + + + + +//---- qrspec.php ----------------------------- + + + /* * PHP QR Code encoder @@ -915,129 +915,129 @@ public static function rsDataLength($spec) { return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); } public static function rsEccLength($spec) { return ($spec[0] + $spec[3]) * $spec[2]; } - } - - - -//---- qrimage.php ----------------------------- - - - - -/* - * PHP QR Code encoder - * - * Image output of code using GD2 - * - * PHP QR Code is distributed under LGPL 3 - * Copyright (C) 2010 Dominik Dzienia - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - define('QR_IMAGE', true); - - class QRimage { - - //---------------------------------------------------------------------- - public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color, $fore_color) - { - $image = self::image($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color); - - if ($filename === false) { - Header("Content-type: image/png"); - ImagePng($image); - } else { - if($saveandprint===TRUE){ - ImagePng($image, $filename); - header("Content-type: image/png"); - ImagePng($image); - }else{ - ImagePng($image, $filename); - } - } - - ImageDestroy($image); - } - - //---------------------------------------------------------------------- - public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) - { - $image = self::image($frame, $pixelPerPoint, $outerFrame); - - if ($filename === false) { - Header("Content-type: image/jpeg"); - ImageJpeg($image, null, $q); - } else { - ImageJpeg($image, $filename, $q); - } - - ImageDestroy($image); - } - - //---------------------------------------------------------------------- - private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000) - { - $h = count($frame); - $w = strlen($frame[0]); - - $imgW = $w + 2*$outerFrame; - $imgH = $h + 2*$outerFrame; - - $base_image =ImageCreate($imgW, $imgH); - - // convert a hexadecimal color code into decimal format (red = 255 0 0, green = 0 255 0, blue = 0 0 255) - $r1 = round((($fore_color & 0xFF0000) >> 16), 5); - $g1 = round((($fore_color & 0x00FF00) >> 8), 5); - $b1 = round(($fore_color & 0x0000FF), 5); - - // convert a hexadecimal color code into decimal format (red = 255 0 0, green = 0 255 0, blue = 0 0 255) - $r2 = round((($back_color & 0xFF0000) >> 16), 5); - $g2 = round((($back_color & 0x00FF00) >> 8), 5); - $b2 = round(($back_color & 0x0000FF), 5); - - - - $col[0] = ImageColorAllocate($base_image, $r2, $g2, $b2); - $col[1] = ImageColorAllocate($base_image, $r1, $g1, $b1); - - imagefill($base_image, 0, 0, $col[0]); - - for($y=0; $y<$h; $y++) { - for($x=0; $x<$w; $x++) { - if ($frame[$y][$x] == '1') { - ImageSetPixel($base_image,$x+$outerFrame,$y+$outerFrame,$col[1]); - } - } - } - - $target_image =ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint); - ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); - ImageDestroy($base_image); - - return $target_image; - } - } - - - - -//---- qrinput.php ----------------------------- - - - + } + + + +//---- qrimage.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Image output of code using GD2 + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('QR_IMAGE', true); + + class QRimage { + + //---------------------------------------------------------------------- + public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color, $fore_color) + { + $image = self::image($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color); + + if ($filename === false) { + Header("Content-type: image/png"); + ImagePng($image); + } else { + if($saveandprint===TRUE){ + ImagePng($image, $filename); + header("Content-type: image/png"); + ImagePng($image); + }else{ + ImagePng($image, $filename); + } + } + + ImageDestroy($image); + } + + //---------------------------------------------------------------------- + public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) + { + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + Header("Content-type: image/jpeg"); + ImageJpeg($image, null, $q); + } else { + ImageJpeg($image, $filename, $q); + } + + ImageDestroy($image); + } + + //---------------------------------------------------------------------- + private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000) + { + $h = count($frame); + $w = strlen($frame[0]); + + $imgW = $w + 2*$outerFrame; + $imgH = $h + 2*$outerFrame; + + $base_image =ImageCreate($imgW, $imgH); + + // convert a hexadecimal color code into decimal format (red = 255 0 0, green = 0 255 0, blue = 0 0 255) + $r1 = round((($fore_color & 0xFF0000) >> 16), 5); + $g1 = round((($fore_color & 0x00FF00) >> 8), 5); + $b1 = round(($fore_color & 0x0000FF), 5); + + // convert a hexadecimal color code into decimal format (red = 255 0 0, green = 0 255 0, blue = 0 0 255) + $r2 = round((($back_color & 0xFF0000) >> 16), 5); + $g2 = round((($back_color & 0x00FF00) >> 8), 5); + $b2 = round(($back_color & 0x0000FF), 5); + + + + $col[0] = ImageColorAllocate($base_image, $r2, $g2, $b2); + $col[1] = ImageColorAllocate($base_image, $r1, $g1, $b1); + + imagefill($base_image, 0, 0, $col[0]); + + for($y=0; $y<$h; $y++) { + for($x=0; $x<$w; $x++) { + if ($frame[$y][$x] == '1') { + ImageSetPixel($base_image,$x+$outerFrame,$y+$outerFrame,$col[1]); + } + } + } + + $target_image =ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint); + ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); + ImageDestroy($base_image); + + return $target_image; + } + } + + + + +//---- qrinput.php ----------------------------- + + + /* * PHP QR Code encoder @@ -1763,14 +1763,14 @@ } - - - - -//---- qrbitstream.php ----------------------------- - - - + + + + +//---- qrbitstream.php ----------------------------- + + + /* * PHP QR Code encoder @@ -1951,14 +1951,14 @@ } } - - - - -//---- qrsplit.php ----------------------------- - - - + + + + +//---- qrsplit.php ----------------------------- + + + /* * PHP QR Code encoder @@ -2269,14 +2269,14 @@ return $split->splitString(); } - } - - - -//---- qrrscode.php ----------------------------- - - - + } + + + +//---- qrrscode.php ----------------------------- + + + /* * PHP QR Code encoder @@ -2486,14 +2486,14 @@ return $rs; } - } - - - -//---- qrmask.php ----------------------------- - - - + } + + + +//---- qrmask.php ----------------------------- + + + /* * PHP QR Code encoder @@ -2822,804 +2822,804 @@ //---------------------------------------------------------------------- } - - - - -//---- qrencode.php ----------------------------- - - - - -/* - * PHP QR Code encoder - * - * Main encoder classes. - * - * Based on libqrencode C library distributed under LGPL 2.1 - * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi - * - * PHP QR Code is distributed under LGPL 3 - * Copyright (C) 2010 Dominik Dzienia - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - class QRrsblock { - public $dataLength; - public $data = array(); - public $eccLength; - public $ecc = array(); - - public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs) - { - $rs->encode_rs_char($data, $ecc); - - $this->dataLength = $dl; - $this->data = $data; - $this->eccLength = $el; - $this->ecc = $ecc; - } - }; - - //########################################################################## - - class QRrawcode { - public $version; - public $datacode = array(); - public $ecccode = array(); - public $blocks; - public $rsblocks = array(); //of RSblock - public $count; - public $dataLength; - public $eccLength; - public $b1; - - //---------------------------------------------------------------------- - public function __construct(QRinput $input) - { - $spec = array(0,0,0,0,0); - - $this->datacode = $input->getByteStream(); - if(is_null($this->datacode)) { - throw new Exception('null imput string'); - } - - QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); - - $this->version = $input->getVersion(); - $this->b1 = QRspec::rsBlockNum1($spec); - $this->dataLength = QRspec::rsDataLength($spec); - $this->eccLength = QRspec::rsEccLength($spec); - $this->ecccode = array_fill(0, $this->eccLength, 0); - $this->blocks = QRspec::rsBlockNum($spec); - - $ret = $this->init($spec); - if($ret < 0) { - throw new Exception('block alloc error'); - return null; - } - - $this->count = 0; - } - - //---------------------------------------------------------------------- - public function init(array $spec) - { - $dl = QRspec::rsDataCodes1($spec); - $el = QRspec::rsEccCodes1($spec); - $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); - - - $blockNo = 0; - $dataPos = 0; - $eccPos = 0; - for($i=0; $iecccode,$eccPos); - $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); - $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); - - $dataPos += $dl; - $eccPos += $el; - $blockNo++; - } - - if(QRspec::rsBlockNum2($spec) == 0) - return 0; - - $dl = QRspec::rsDataCodes2($spec); - $el = QRspec::rsEccCodes2($spec); - $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); - - if($rs == NULL) return -1; - - for($i=0; $iecccode,$eccPos); - $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); - $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); - - $dataPos += $dl; - $eccPos += $el; - $blockNo++; - } - - return 0; - } - - //---------------------------------------------------------------------- - public function getCode() - { - $ret; - - if($this->count < $this->dataLength) { - $row = $this->count % $this->blocks; - $col = $this->count / $this->blocks; - if($col >= $this->rsblocks[0]->dataLength) { - $row += $this->b1; - } - $ret = $this->rsblocks[$row]->data[$col]; - } else if($this->count < $this->dataLength + $this->eccLength) { - $row = ($this->count - $this->dataLength) % $this->blocks; - $col = ($this->count - $this->dataLength) / $this->blocks; - $ret = $this->rsblocks[$row]->ecc[$col]; - } else { - return 0; - } - $this->count++; - - return $ret; - } - } - - //########################################################################## - - class QRcode { - - public $version; - public $width; - public $data; - - //---------------------------------------------------------------------- - public function encodeMask(QRinput $input, $mask) - { - if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) { - throw new Exception('wrong version'); - } - if($input->getErrorCorrectionLevel() > QR_ECLEVEL_H) { - throw new Exception('wrong level'); - } - - $raw = new QRrawcode($input); - - QRtools::markTime('after_raw'); - - $version = $raw->version; - $width = QRspec::getWidth($version); - $frame = QRspec::newFrame($version); - - $filler = new FrameFiller($width, $frame); - if(is_null($filler)) { - return NULL; - } - - // inteleaved data and ecc codes - for($i=0; $i<$raw->dataLength + $raw->eccLength; $i++) { - $code = $raw->getCode(); - $bit = 0x80; - for($j=0; $j<8; $j++) { - $addr = $filler->next(); - $filler->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); - $bit = $bit >> 1; - } - } - - QRtools::markTime('after_filler'); - - unset($raw); - - // remainder bits - $j = QRspec::getRemainder($version); - for($i=0; $i<$j; $i++) { - $addr = $filler->next(); - $filler->setFrameAt($addr, 0x02); - } - - $frame = $filler->frame; - unset($filler); - - - // masking - $maskObj = new QRmask(); - if($mask < 0) { - - if (QR_FIND_BEST_MASK) { - $masked = $maskObj->mask($width, $frame, $input->getErrorCorrectionLevel()); - } else { - $masked = $maskObj->makeMask($width, $frame, (intval(QR_DEFAULT_MASK) % 8), $input->getErrorCorrectionLevel()); - } - } else { - $masked = $maskObj->makeMask($width, $frame, $mask, $input->getErrorCorrectionLevel()); - } - - if($masked == NULL) { - return NULL; - } - - QRtools::markTime('after_mask'); - - $this->version = $version; - $this->width = $width; - $this->data = $masked; - - return $this; - } - - //---------------------------------------------------------------------- - public function encodeInput(QRinput $input) - { - return $this->encodeMask($input, -1); - } - - //---------------------------------------------------------------------- - public function encodeString8bit($string, $version, $level) - { - if($string == NULL) { - throw new Exception('empty string!'); - return NULL; - } - - $input = new QRinput($version, $level); - if($input == NULL) return NULL; - - $ret = $input->append($input, QR_MODE_8, strlen($string), str_split($string)); - if($ret < 0) { - unset($input); - return NULL; - } - return $this->encodeInput($input); - } - - //---------------------------------------------------------------------- - public function encodeString($string, $version, $level, $hint, $casesensitive) - { - - if($hint != QR_MODE_8 && $hint != QR_MODE_KANJI) { - throw new Exception('bad hint'); - return NULL; - } - - $input = new QRinput($version, $level); - if($input == NULL) return NULL; - - $ret = QRsplit::splitStringToQRinput($string, $input, $hint, $casesensitive); - if($ret < 0) { - return NULL; - } - - return $this->encodeInput($input); - } - - //---------------------------------------------------------------------- - public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false, $back_color = 0xFFFFFF, $fore_color = 0x000000) - { - $enc = QRencode::factory($level, $size, $margin, $back_color, $fore_color); - return $enc->encodePNG($text, $outfile, $saveandprint=false); - } - - //---------------------------------------------------------------------- - public static function text($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) - { - $enc = QRencode::factory($level, $size, $margin); - return $enc->encode($text, $outfile); - } - - //---------------------------------------------------------------------- - public static function eps($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) - { - $enc = QRencode::factory($level, $size, $margin, $back_color, $fore_color, $cmyk); - return $enc->encodeEPS($text, $outfile, $saveandprint=false); - } - - //---------------------------------------------------------------------- - public static function svg($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false, $back_color = 0xFFFFFF, $fore_color = 0x000000) - { - $enc = QRencode::factory($level, $size, $margin, $back_color, $fore_color); - return $enc->encodeSVG($text, $outfile, $saveandprint=false); - } - - //---------------------------------------------------------------------- - public static function raw($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) - { - $enc = QRencode::factory($level, $size, $margin); - return $enc->encodeRAW($text, $outfile); - } - } - - //########################################################################## - - class FrameFiller { - - public $width; - public $frame; - public $x; - public $y; - public $dir; - public $bit; - - //---------------------------------------------------------------------- - public function __construct($width, &$frame) - { - $this->width = $width; - $this->frame = $frame; - $this->x = $width - 1; - $this->y = $width - 1; - $this->dir = -1; - $this->bit = -1; - } - - //---------------------------------------------------------------------- - public function setFrameAt($at, $val) - { - $this->frame[$at['y']][$at['x']] = chr($val); - } - - //---------------------------------------------------------------------- - public function getFrameAt($at) - { - return ord($this->frame[$at['y']][$at['x']]); - } - - //---------------------------------------------------------------------- - public function next() - { - do { - - if($this->bit == -1) { - $this->bit = 0; - return array('x'=>$this->x, 'y'=>$this->y); - } - - $x = $this->x; - $y = $this->y; - $w = $this->width; - - if($this->bit == 0) { - $x--; - $this->bit++; - } else { - $x++; - $y += $this->dir; - $this->bit--; - } - - if($this->dir < 0) { - if($y < 0) { - $y = 0; - $x -= 2; - $this->dir = 1; - if($x == 6) { - $x--; - $y = 9; - } - } - } else { - if($y == $w) { - $y = $w - 1; - $x -= 2; - $this->dir = -1; - if($x == 6) { - $x--; - $y -= 8; - } - } - } - if($x < 0 || $y < 0) return null; - - $this->x = $x; - $this->y = $y; - - } while(ord($this->frame[$y][$x]) & 0x80); - - return array('x'=>$x, 'y'=>$y); - } - - } ; - - //########################################################################## - - class QRencode { - - public $casesensitive = true; - public $eightbit = false; - - public $version = 0; - public $size = 3; - public $margin = 4; - public $back_color = 0xFFFFFF; - public $fore_color = 0x000000; - - public $structured = 0; // not supported yet - - public $level = QR_ECLEVEL_L; - public $hint = QR_MODE_8; - - //---------------------------------------------------------------------- - public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) - { - $enc = new QRencode(); - $enc->size = $size; - $enc->margin = $margin; - $enc->fore_color = $fore_color; - $enc->back_color = $back_color; - $enc->cmyk = $cmyk; - - switch ($level.'') { - case '0': - case '1': - case '2': - case '3': - $enc->level = $level; - break; - case 'l': - case 'L': - $enc->level = QR_ECLEVEL_L; - break; - case 'm': - case 'M': - $enc->level = QR_ECLEVEL_M; - break; - case 'q': - case 'Q': - $enc->level = QR_ECLEVEL_Q; - break; - case 'h': - case 'H': - $enc->level = QR_ECLEVEL_H; - break; - } - - return $enc; - } - - //---------------------------------------------------------------------- - public function encodeRAW($intext, $outfile = false) - { - $code = new QRcode(); - - if($this->eightbit) { - $code->encodeString8bit($intext, $this->version, $this->level); - } else { - $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); - } - - return $code->data; - } - - //---------------------------------------------------------------------- - public function encode($intext, $outfile = false) - { - $code = new QRcode(); - - if($this->eightbit) { - $code->encodeString8bit($intext, $this->version, $this->level); - } else { - $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); - } - - QRtools::markTime('after_encode'); - - if ($outfile!== false) { - file_put_contents($outfile, join("\n", QRtools::binarize($code->data))); - } else { - return QRtools::binarize($code->data); - } - } - - //---------------------------------------------------------------------- - public function encodePNG($intext, $outfile = false,$saveandprint=false) - { - try { - - ob_start(); - $tab = $this->encode($intext); - $err = ob_get_contents(); - ob_end_clean(); - - if ($err != '') - QRtools::log($outfile, $err); - - $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); - - QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint, $this->back_color, $this->fore_color); - - } catch (Exception $e) { - - QRtools::log($outfile, $e->getMessage()); - - } - } - - //---------------------------------------------------------------------- - public function encodeEPS($intext, $outfile = false,$saveandprint=false) - { - try { - - ob_start(); - $tab = $this->encode($intext); - $err = ob_get_contents(); - ob_end_clean(); - - if ($err != '') - QRtools::log($outfile, $err); - - $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); - - QRvect::eps($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint, $this->back_color, $this->fore_color, $this->cmyk); - - } catch (Exception $e) { - - QRtools::log($outfile, $e->getMessage()); - - } - } - - //---------------------------------------------------------------------- - public function encodeSVG($intext, $outfile = false,$saveandprint=false) - { - try { - - ob_start(); - $tab = $this->encode($intext); - $err = ob_get_contents(); - ob_end_clean(); - - if ($err != '') - QRtools::log($outfile, $err); - - $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); - - QRvect::svg($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint, $this->back_color, $this->fore_color); - - } catch (Exception $e) { - - QRtools::log($outfile, $e->getMessage()); - - } - } - } - - - - -//---- qrvect.php ----------------------------- - - - - -/* - * PHP QR Code encoder - * - * Image output of code using GD2 - * - * PHP QR Code is distributed under LGPL 3 - * Copyright (C) 2010 Dominik Dzienia - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - define('QR_VECT', true); - - class QRvect { - - //---------------------------------------------------------------------- - public static function eps($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) - { - $vect = self::vectEPS($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color, $cmyk); - - if ($filename === false) { - header("Content-Type: application/postscript"); - header('Content-Disposition: filename="qrcode.eps"'); - echo $vect; - } else { - if($saveandprint===TRUE){ - QRtools::save($vect, $filename); - header("Content-Type: application/postscript"); - header('Content-Disposition: filename="qrcode.eps"'); - echo $vect; - }else{ - QRtools::save($vect, $filename); - } - } - } - - - //---------------------------------------------------------------------- - private static function vectEPS($frame, $pixelPerPoint = 4, $outerFrame = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) - { - $h = count($frame); - $w = strlen($frame[0]); - - $imgW = $w + 2*$outerFrame; - $imgH = $h + 2*$outerFrame; - - if ($cmyk) - { - // convert color value into decimal eps format - $c = round((($fore_color & 0xFF000000) >> 16) / 255, 5); - $m = round((($fore_color & 0x00FF0000) >> 16) / 255, 5); - $y = round((($fore_color & 0x0000FF00) >> 8) / 255, 5); - $k = round(($fore_color & 0x000000FF) / 255, 5); - $fore_color_string = $c.' '.$m.' '.$y.' '.$k.' setcmykcolor'."\n"; - - // convert color value into decimal eps format - $c = round((($back_color & 0xFF000000) >> 16) / 255, 5); - $m = round((($back_color & 0x00FF0000) >> 16) / 255, 5); - $y = round((($back_color & 0x0000FF00) >> 8) / 255, 5); - $k = round(($back_color & 0x000000FF) / 255, 5); - $back_color_string = $c.' '.$m.' '.$y.' '.$k.' setcmykcolor'."\n"; - } - else - { - // convert a hexadecimal color code into decimal eps format (green = 0 1 0, blue = 0 0 1, ...) - $r = round((($fore_color & 0xFF0000) >> 16) / 255, 5); - $b = round((($fore_color & 0x00FF00) >> 8) / 255, 5); - $g = round(($fore_color & 0x0000FF) / 255, 5); - $fore_color_string = $r.' '.$b.' '.$g.' setrgbcolor'."\n"; - - // convert a hexadecimal color code into decimal eps format (green = 0 1 0, blue = 0 0 1, ...) - $r = round((($back_color & 0xFF0000) >> 16) / 255, 5); - $b = round((($back_color & 0x00FF00) >> 8) / 255, 5); - $g = round(($back_color & 0x0000FF) / 255, 5); - $back_color_string = $r.' '.$b.' '.$g.' setrgbcolor'."\n"; - } - - $output = - '%!PS-Adobe EPSF-3.0'."\n". - '%%Creator: PHPQrcodeLib'."\n". - '%%Title: QRcode'."\n". - '%%CreationDate: '.date('Y-m-d')."\n". - '%%DocumentData: Clean7Bit'."\n". - '%%LanguageLevel: 2'."\n". - '%%Pages: 1'."\n". - '%%BoundingBox: 0 0 '.$imgW * $pixelPerPoint.' '.$imgH * $pixelPerPoint."\n"; - - // set the scale - $output .= $pixelPerPoint.' '.$pixelPerPoint.' scale'."\n"; - // position the center of the coordinate system - - $output .= $outerFrame.' '.$outerFrame.' translate'."\n"; - - - - - // redefine the 'rectfill' operator to shorten the syntax - $output .= '/F { rectfill } def'."\n"; - - // set the symbol color - $output .= $back_color_string; - $output .= '-'.$outerFrame.' -'.$outerFrame.' '.($w + 2*$outerFrame).' '.($h + 2*$outerFrame).' F'."\n"; - - - // set the symbol color - $output .= $fore_color_string; - - // Convert the matrix into pixels - - for($i=0; $i<$h; $i++) { - for($j=0; $j<$w; $j++) { - if( $frame[$i][$j] == '1') { - $y = $h - 1 - $i; - $x = $j; - $output .= $x.' '.$y.' 1 1 F'."\n"; - } - } - } - - - $output .='%%EOF'; - - return $output; - } - - //---------------------------------------------------------------------- - public static function svg($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color, $fore_color) - { - $vect = self::vectSVG($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color); - - if ($filename === false) { - header("Content-Type: image/svg+xml"); - //header('Content-Disposition: attachment, filename="qrcode.svg"'); - echo $vect; - } else { - if($saveandprint===TRUE){ - QRtools::save($vect, $filename); - header("Content-Type: image/svg+xml"); - //header('Content-Disposition: filename="'.$filename.'"'); - echo $vect; - }else{ - QRtools::save($vect, $filename); - } - } - } - - - //---------------------------------------------------------------------- - private static function vectSVG($frame, $pixelPerPoint = 4, $outerFrame = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000) - { - $h = count($frame); - $w = strlen($frame[0]); - - $imgW = $w + 2*$outerFrame; - $imgH = $h + 2*$outerFrame; - - - $output = - ''."\n". - ''."\n". - ''."\n"; - - $output = - ''."\n". - ''."\n". - ''."\n". - ''."\n"; - - if(!empty($back_color)) { - $backgroundcolor = str_pad(dechex($back_color), 6, "0", STR_PAD_LEFT); - $output .= ''."\n"; - } - - $output .= - ''."\n". - ''."\n". - ''."\n". - ''."\n"; - - - // Convert the matrix into pixels - - for($i=0; $i<$h; $i++) { - for($j=0; $j<$w; $j++) { - if( $frame[$i][$j] == '1') { - $y = ($i + $outerFrame) * $pixelPerPoint; - $x = ($j + $outerFrame) * $pixelPerPoint; - $output .= ''."\n"; - } - } - } - $output .= - ''."\n". - ''; - - return $output; - } - } - - - - + + + + +//---- qrencode.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Main encoder classes. + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + class QRrsblock { + public $dataLength; + public $data = array(); + public $eccLength; + public $ecc = array(); + + public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs) + { + $rs->encode_rs_char($data, $ecc); + + $this->dataLength = $dl; + $this->data = $data; + $this->eccLength = $el; + $this->ecc = $ecc; + } + }; + + //########################################################################## + + class QRrawcode { + public $version; + public $datacode = array(); + public $ecccode = array(); + public $blocks; + public $rsblocks = array(); //of RSblock + public $count; + public $dataLength; + public $eccLength; + public $b1; + + //---------------------------------------------------------------------- + public function __construct(QRinput $input) + { + $spec = array(0,0,0,0,0); + + $this->datacode = $input->getByteStream(); + if(is_null($this->datacode)) { + throw new Exception('null imput string'); + } + + QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); + + $this->version = $input->getVersion(); + $this->b1 = QRspec::rsBlockNum1($spec); + $this->dataLength = QRspec::rsDataLength($spec); + $this->eccLength = QRspec::rsEccLength($spec); + $this->ecccode = array_fill(0, $this->eccLength, 0); + $this->blocks = QRspec::rsBlockNum($spec); + + $ret = $this->init($spec); + if($ret < 0) { + throw new Exception('block alloc error'); + return null; + } + + $this->count = 0; + } + + //---------------------------------------------------------------------- + public function init(array $spec) + { + $dl = QRspec::rsDataCodes1($spec); + $el = QRspec::rsEccCodes1($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + + $blockNo = 0; + $dataPos = 0; + $eccPos = 0; + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + if(QRspec::rsBlockNum2($spec) == 0) + return 0; + + $dl = QRspec::rsDataCodes2($spec); + $el = QRspec::rsEccCodes2($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + if($rs == NULL) return -1; + + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + return 0; + } + + //---------------------------------------------------------------------- + public function getCode() + { + $ret; + + if($this->count < $this->dataLength) { + $row = $this->count % $this->blocks; + $col = $this->count / $this->blocks; + if($col >= $this->rsblocks[0]->dataLength) { + $row += $this->b1; + } + $ret = $this->rsblocks[$row]->data[$col]; + } else if($this->count < $this->dataLength + $this->eccLength) { + $row = ($this->count - $this->dataLength) % $this->blocks; + $col = ($this->count - $this->dataLength) / $this->blocks; + $ret = $this->rsblocks[$row]->ecc[$col]; + } else { + return 0; + } + $this->count++; + + return $ret; + } + } + + //########################################################################## + + class QRcode { + + public $version; + public $width; + public $data; + + //---------------------------------------------------------------------- + public function encodeMask(QRinput $input, $mask) + { + if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) { + throw new Exception('wrong version'); + } + if($input->getErrorCorrectionLevel() > QR_ECLEVEL_H) { + throw new Exception('wrong level'); + } + + $raw = new QRrawcode($input); + + QRtools::markTime('after_raw'); + + $version = $raw->version; + $width = QRspec::getWidth($version); + $frame = QRspec::newFrame($version); + + $filler = new FrameFiller($width, $frame); + if(is_null($filler)) { + return NULL; + } + + // inteleaved data and ecc codes + for($i=0; $i<$raw->dataLength + $raw->eccLength; $i++) { + $code = $raw->getCode(); + $bit = 0x80; + for($j=0; $j<8; $j++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); + $bit = $bit >> 1; + } + } + + QRtools::markTime('after_filler'); + + unset($raw); + + // remainder bits + $j = QRspec::getRemainder($version); + for($i=0; $i<$j; $i++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02); + } + + $frame = $filler->frame; + unset($filler); + + + // masking + $maskObj = new QRmask(); + if($mask < 0) { + + if (QR_FIND_BEST_MASK) { + $masked = $maskObj->mask($width, $frame, $input->getErrorCorrectionLevel()); + } else { + $masked = $maskObj->makeMask($width, $frame, (intval(QR_DEFAULT_MASK) % 8), $input->getErrorCorrectionLevel()); + } + } else { + $masked = $maskObj->makeMask($width, $frame, $mask, $input->getErrorCorrectionLevel()); + } + + if($masked == NULL) { + return NULL; + } + + QRtools::markTime('after_mask'); + + $this->version = $version; + $this->width = $width; + $this->data = $masked; + + return $this; + } + + //---------------------------------------------------------------------- + public function encodeInput(QRinput $input) + { + return $this->encodeMask($input, -1); + } + + //---------------------------------------------------------------------- + public function encodeString8bit($string, $version, $level) + { + if($string == NULL) { + throw new Exception('empty string!'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = $input->append($input, QR_MODE_8, strlen($string), str_split($string)); + if($ret < 0) { + unset($input); + return NULL; + } + return $this->encodeInput($input); + } + + //---------------------------------------------------------------------- + public function encodeString($string, $version, $level, $hint, $casesensitive) + { + + if($hint != QR_MODE_8 && $hint != QR_MODE_KANJI) { + throw new Exception('bad hint'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = QRsplit::splitStringToQRinput($string, $input, $hint, $casesensitive); + if($ret < 0) { + return NULL; + } + + return $this->encodeInput($input); + } + + //---------------------------------------------------------------------- + public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false, $back_color = 0xFFFFFF, $fore_color = 0x000000) + { + $enc = QRencode::factory($level, $size, $margin, $back_color, $fore_color); + return $enc->encodePNG($text, $outfile, $saveandprint=false); + } + + //---------------------------------------------------------------------- + public static function text($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encode($text, $outfile); + } + + //---------------------------------------------------------------------- + public static function eps($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) + { + $enc = QRencode::factory($level, $size, $margin, $back_color, $fore_color, $cmyk); + return $enc->encodeEPS($text, $outfile, $saveandprint=false); + } + + //---------------------------------------------------------------------- + public static function svg($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false, $back_color = 0xFFFFFF, $fore_color = 0x000000) + { + $enc = QRencode::factory($level, $size, $margin, $back_color, $fore_color); + return $enc->encodeSVG($text, $outfile, $saveandprint=false); + } + + //---------------------------------------------------------------------- + public static function raw($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodeRAW($text, $outfile); + } + } + + //########################################################################## + + class FrameFiller { + + public $width; + public $frame; + public $x; + public $y; + public $dir; + public $bit; + + //---------------------------------------------------------------------- + public function __construct($width, &$frame) + { + $this->width = $width; + $this->frame = $frame; + $this->x = $width - 1; + $this->y = $width - 1; + $this->dir = -1; + $this->bit = -1; + } + + //---------------------------------------------------------------------- + public function setFrameAt($at, $val) + { + $this->frame[$at['y']][$at['x']] = chr($val); + } + + //---------------------------------------------------------------------- + public function getFrameAt($at) + { + return ord($this->frame[$at['y']][$at['x']]); + } + + //---------------------------------------------------------------------- + public function next() + { + do { + + if($this->bit == -1) { + $this->bit = 0; + return array('x'=>$this->x, 'y'=>$this->y); + } + + $x = $this->x; + $y = $this->y; + $w = $this->width; + + if($this->bit == 0) { + $x--; + $this->bit++; + } else { + $x++; + $y += $this->dir; + $this->bit--; + } + + if($this->dir < 0) { + if($y < 0) { + $y = 0; + $x -= 2; + $this->dir = 1; + if($x == 6) { + $x--; + $y = 9; + } + } + } else { + if($y == $w) { + $y = $w - 1; + $x -= 2; + $this->dir = -1; + if($x == 6) { + $x--; + $y -= 8; + } + } + } + if($x < 0 || $y < 0) return null; + + $this->x = $x; + $this->y = $y; + + } while(ord($this->frame[$y][$x]) & 0x80); + + return array('x'=>$x, 'y'=>$y); + } + + } ; + + //########################################################################## + + class QRencode { + + public $casesensitive = true; + public $eightbit = false; + + public $version = 0; + public $size = 3; + public $margin = 4; + public $back_color = 0xFFFFFF; + public $fore_color = 0x000000; + + public $structured = 0; // not supported yet + + public $level = QR_ECLEVEL_L; + public $hint = QR_MODE_8; + + //---------------------------------------------------------------------- + public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) + { + $enc = new QRencode(); + $enc->size = $size; + $enc->margin = $margin; + $enc->fore_color = $fore_color; + $enc->back_color = $back_color; + $enc->cmyk = $cmyk; + + switch ($level.'') { + case '0': + case '1': + case '2': + case '3': + $enc->level = $level; + break; + case 'l': + case 'L': + $enc->level = QR_ECLEVEL_L; + break; + case 'm': + case 'M': + $enc->level = QR_ECLEVEL_M; + break; + case 'q': + case 'Q': + $enc->level = QR_ECLEVEL_Q; + break; + case 'h': + case 'H': + $enc->level = QR_ECLEVEL_H; + break; + } + + return $enc; + } + + //---------------------------------------------------------------------- + public function encodeRAW($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + return $code->data; + } + + //---------------------------------------------------------------------- + public function encode($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + QRtools::markTime('after_encode'); + + if ($outfile!== false) { + file_put_contents($outfile, join("\n", QRtools::binarize($code->data))); + } else { + return QRtools::binarize($code->data); + } + } + + //---------------------------------------------------------------------- + public function encodePNG($intext, $outfile = false,$saveandprint=false) + { + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); + + QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint, $this->back_color, $this->fore_color); + + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + + } + } + + //---------------------------------------------------------------------- + public function encodeEPS($intext, $outfile = false,$saveandprint=false) + { + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); + + QRvect::eps($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint, $this->back_color, $this->fore_color, $this->cmyk); + + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + + } + } + + //---------------------------------------------------------------------- + public function encodeSVG($intext, $outfile = false,$saveandprint=false) + { + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); + + QRvect::svg($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint, $this->back_color, $this->fore_color); + + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + + } + } + } + + + + +//---- qrvect.php ----------------------------- + + + + +/* + * PHP QR Code encoder + * + * Image output of code using GD2 + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + define('QR_VECT', true); + + class QRvect { + + //---------------------------------------------------------------------- + public static function eps($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) + { + $vect = self::vectEPS($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color, $cmyk); + + if ($filename === false) { + header("Content-Type: application/postscript"); + header('Content-Disposition: filename="qrcode.eps"'); + echo $vect; + } else { + if($saveandprint===TRUE){ + QRtools::save($vect, $filename); + header("Content-Type: application/postscript"); + header('Content-Disposition: filename="qrcode.eps"'); + echo $vect; + }else{ + QRtools::save($vect, $filename); + } + } + } + + + //---------------------------------------------------------------------- + private static function vectEPS($frame, $pixelPerPoint = 4, $outerFrame = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false) + { + $h = count($frame); + $w = strlen($frame[0]); + + $imgW = $w + 2*$outerFrame; + $imgH = $h + 2*$outerFrame; + + if ($cmyk) + { + // convert color value into decimal eps format + $c = round((($fore_color & 0xFF000000) >> 16) / 255, 5); + $m = round((($fore_color & 0x00FF0000) >> 16) / 255, 5); + $y = round((($fore_color & 0x0000FF00) >> 8) / 255, 5); + $k = round(($fore_color & 0x000000FF) / 255, 5); + $fore_color_string = $c.' '.$m.' '.$y.' '.$k.' setcmykcolor'."\n"; + + // convert color value into decimal eps format + $c = round((($back_color & 0xFF000000) >> 16) / 255, 5); + $m = round((($back_color & 0x00FF0000) >> 16) / 255, 5); + $y = round((($back_color & 0x0000FF00) >> 8) / 255, 5); + $k = round(($back_color & 0x000000FF) / 255, 5); + $back_color_string = $c.' '.$m.' '.$y.' '.$k.' setcmykcolor'."\n"; + } + else + { + // convert a hexadecimal color code into decimal eps format (green = 0 1 0, blue = 0 0 1, ...) + $r = round((($fore_color & 0xFF0000) >> 16) / 255, 5); + $b = round((($fore_color & 0x00FF00) >> 8) / 255, 5); + $g = round(($fore_color & 0x0000FF) / 255, 5); + $fore_color_string = $r.' '.$b.' '.$g.' setrgbcolor'."\n"; + + // convert a hexadecimal color code into decimal eps format (green = 0 1 0, blue = 0 0 1, ...) + $r = round((($back_color & 0xFF0000) >> 16) / 255, 5); + $b = round((($back_color & 0x00FF00) >> 8) / 255, 5); + $g = round(($back_color & 0x0000FF) / 255, 5); + $back_color_string = $r.' '.$b.' '.$g.' setrgbcolor'."\n"; + } + + $output = + '%!PS-Adobe EPSF-3.0'."\n". + '%%Creator: PHPQrcodeLib'."\n". + '%%Title: QRcode'."\n". + '%%CreationDate: '.date('Y-m-d')."\n". + '%%DocumentData: Clean7Bit'."\n". + '%%LanguageLevel: 2'."\n". + '%%Pages: 1'."\n". + '%%BoundingBox: 0 0 '.$imgW * $pixelPerPoint.' '.$imgH * $pixelPerPoint."\n"; + + // set the scale + $output .= $pixelPerPoint.' '.$pixelPerPoint.' scale'."\n"; + // position the center of the coordinate system + + $output .= $outerFrame.' '.$outerFrame.' translate'."\n"; + + + + + // redefine the 'rectfill' operator to shorten the syntax + $output .= '/F { rectfill } def'."\n"; + + // set the symbol color + $output .= $back_color_string; + $output .= '-'.$outerFrame.' -'.$outerFrame.' '.($w + 2*$outerFrame).' '.($h + 2*$outerFrame).' F'."\n"; + + + // set the symbol color + $output .= $fore_color_string; + + // Convert the matrix into pixels + + for($i=0; $i<$h; $i++) { + for($j=0; $j<$w; $j++) { + if( $frame[$i][$j] == '1') { + $y = $h - 1 - $i; + $x = $j; + $output .= $x.' '.$y.' 1 1 F'."\n"; + } + } + } + + + $output .='%%EOF'; + + return $output; + } + + //---------------------------------------------------------------------- + public static function svg($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color, $fore_color) + { + $vect = self::vectSVG($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color); + + if ($filename === false) { + header("Content-Type: image/svg+xml"); + //header('Content-Disposition: attachment, filename="qrcode.svg"'); + echo $vect; + } else { + if($saveandprint===TRUE){ + QRtools::save($vect, $filename); + header("Content-Type: image/svg+xml"); + //header('Content-Disposition: filename="'.$filename.'"'); + echo $vect; + }else{ + QRtools::save($vect, $filename); + } + } + } + + + //---------------------------------------------------------------------- + private static function vectSVG($frame, $pixelPerPoint = 4, $outerFrame = 4, $back_color = 0xFFFFFF, $fore_color = 0x000000) + { + $h = count($frame); + $w = strlen($frame[0]); + + $imgW = $w + 2*$outerFrame; + $imgH = $h + 2*$outerFrame; + + + $output = + ''."\n". + ''."\n". + ''."\n"; + + $output = + ''."\n". + ''."\n". + ''."\n". + ''."\n"; + + if(!empty($back_color)) { + $backgroundcolor = str_pad(dechex($back_color), 6, "0", STR_PAD_LEFT); + $output .= ''."\n"; + } + + $output .= + ''."\n". + ''."\n". + ''."\n". + ''."\n"; + + + // Convert the matrix into pixels + + for($i=0; $i<$h; $i++) { + for($j=0; $j<$w; $j++) { + if( $frame[$i][$j] == '1') { + $y = ($i + $outerFrame) * $pixelPerPoint; + $x = ($j + $outerFrame) * $pixelPerPoint; + $output .= ''."\n"; + } + } + } + $output .= + ''."\n". + ''; + + return $output; + } + } + + + + diff --git a/style.less b/style.less index dc27feb..6a58ac2 100755 --- a/style.less +++ b/style.less @@ -1,13 +1,50 @@ +/* + +Ce fichier fait partie de LibreQR. + + LibreQR est un logiciel libre ; vous pouvez le redistribuer ou le modifier + suivant les termes de la GNU Affero General Public License + telle que publiée par la Free Software Foundation ; soit la version 3 + de la licence, soit (à votre gré) toute version ultérieure. + + LibreQR est distribué dans l'espoir qu'il sera utile, + mais SANS AUCUNE GARANTIE ; sans même la garantie tacite de + QUALITÉ MARCHANDE ou d'ADÉQUATION à UN BUT PARTICULIER. + Consultez la GNU Affero General Public License pour plus de détails. + + Vous devez avoir reçu une copie de la GNU Affero General Public License + en même temps que LibreQR ; si ce n'est pas le cas, + consultez . + +*/ + * { font-family: "Ubuntu", sans-serif; + scrollbar-color: @text @bg; + scrollbar-width: auto; +} + +a { + color: @text; + text-decoration: underline; + + &:hover { + text-decoration: none; + } } h1 { - font-weight: 700; + font-weight: 500; +} + +#firstWrapper { + display: flex; + flex-direction: row; } #menusDeroulants { text-align: center; + margin-left: 20px; } #codeQR { @@ -22,35 +59,35 @@ h1 { text-align: center; } -.topRight { - position: fixed; - top: 5px; - right: 5px; -} - .bouton { padding: 3px 10px 3px 10px; + text-decoration: none; } form { + display: block; + margin-bottom: 30px; +} + +.center { display: flex; flex-direction: column; - display: inline; - padding: 0px; - margin: 0px; + justify-content: center; + margin-left: auto; + margin-right: auto; + width: 814px; } html, body { - width: 500px; margin-left: auto; margin-right: auto; - background-color: @fond; - color: @texte; + background-color: @bg; + color: @text; font-weight: normal; font-size: 1em; & h1 { - color: @texte; + color: @text; text-decoration: none; } @@ -58,19 +95,6 @@ html, body { label { font-size: 20px; - height: 60px; -} - -.topRight { - color: @texteLienCodeSource; - font-size: 12px; - margin-bottom: -20px; - text-align: right; - transition: color 0.2s; - - &:hover { - color: lighten(@texteLienCodeSource, 10%); - } } header { @@ -81,15 +105,26 @@ header { } header > a { + text-decoration: none; display: flex; flex-direction: row; } h1, #logo { - margin: auto; + margin: 0px; font-size: 35px; } +h1 { + padding: auto; + margin-left: 10px; +} + +#titre { + text-align: center; + justify-content: center; +} + .param { padding: 10px; padding-left: 0px; @@ -98,23 +133,6 @@ h1, #logo { margin-right: 0px; } -@media (max-width: 640px) { // Version mobile - - html { - margin: 10px; - width: 100%; - } - - #texte { - width: 90%; - } - - h1 { - font-size: 25px; - } - -} - #logo { width: 48px; height: 48px; @@ -124,16 +142,11 @@ h1, #logo { display: flex; flex-direction: row; justify-content: center; - width: 250px; } ::selection { - color: @fond; - background-color: @texte; -} - -:link { - text-decoration: none; + color: @bg; + background-color: @text; } #couleurs { @@ -141,90 +154,171 @@ h1, #logo { flex-direction: row; justify-content: space-between; text-align: center; + + & .param { + text-align: center; + display: flex; + justify-content: center; + flex-direction: column; + width: 100%; + } +} + +footer, .info { + color: @secondaryText; + text-align: left; + transition: color 0.12s cubic-bezier(0.42, 0.0, 1.0, 1.0); + position: fixed; + width: 400px; + + & a:link { + transition: color 0.12s cubic-bezier(0.42, 0.0, 1.0, 1.0); + color: @secondaryText; + text-decoration: underline; + } + + &:hover, &:hover a:link { + color: @text; + } + +} + +footer { + font-size: 14px; + bottom: 20px; + left: 20px; } .info { - color: grey; - position: absolute; + font-size: 16px; bottom: 20px; right: 20px; - width: 300px; - & a { - color: grey; + & strong { + font-size: 18px; + } +} + +@media (max-width: 850px) { // Version écran moyen + + footer, .info { + width: 100%; + position: relative; + bottom: 0px; + left: 0px; + right: 0px; + top: 0px; + margin: 0px; + font-size: 20px; + } + + .info { + color: @text; + margin-bottom: 20px; + + & a:link { + color: @text; + } + } + + #firstWrapper { + flex-direction: column; + } + +} + +@media (max-width: 500px) { // Version mobile + + #couleurs { + flex-direction: column; + } + + .center { + width: auto; } - &:hover, &:hover a { - color: @texte; + html, body { + width: 95%; + } + + h1 { + font-size: 28px; + padding-top: 6px; } } +@media (max-width: 415px) { + + h1 { + padding: 0px; + } + + +} /* Inputs */ -#redondance, #marge, #texte, #taille, input[type=color], input[type=submit], .bouton { - border: 2px @bordure solid; +#redondancy, #margin, #text, #size, input[type=color], input[type=submit], .bouton { + border: 2px @border solid; border-radius: 10px; font-size: 20px; padding-left: 10px; font-weight: normal; - color: @texteForm; + color: @text; transition: border 0.1s linear; - background-color: @fondChamp; + background-color: @bgField; margin-top: 8px; &:hover { - border: 2px @bordureHover solid; + border: 2px @borderHover solid; } &:focus { - border: 2px @bordureFocus solid; + border: 2px @borderFocus solid; + outline: none; } } -#redondance, #taille, #marge { - background-color: @fondChamp; +#redondancy, #size, #margin { + background-color: @bgField; width: 250px; height: 40px; } -#texte { - background-color: @fondChampTexte; - color: @texteForm; - padding-top: 6px; +#text { + background-color: @bgTextField; + color: @text; + padding: 10px; + margin: 10px; width: 500px; -} - -#redondance:hover, #marge:hover, #texte:hover, #taille:hover, input[type=submit]:hover, .bouton:hover { + scrollbar-color: @text @bgTextField; + scrollbar-width: auto; + @media (max-width: 500px) { + width: 85%; + } } -#texte:focus, input[type=submit]:focus, .bouton:focus { - +input[type=submit] { + font-size: 34px; + padding: 10px; + padding-left: 14px; + padding-right: 14px; } -#texte::placeholder { - color: lighten(@fondChampTexte, 40%); +#text::placeholder { + color: lighten(@bgTextField, 40%); opacity: 1; - font-family: "Ubuntu"; + font-family: "Ubuntu", sans-serif; font-weight: normal; font-size: 1em; } input[type=color] { - height: 50px; - width: 50px; + height: 60px; + width: 84px; padding: 5px; - background-color: @fondChamp; - border: 2px @bordure solid; -} - -input[type=color]:hover { - border: 2px @bordureHover solid; -} - -input[type=color]:focus { - border: 2px @bordureFocus solid; + border: 2px @border solid; } /* Infobulle */ @@ -235,44 +329,36 @@ svg { } .boutonAide { - height: 18px; - width: 18px; - color: @texte; + height: 0px; + width: 0px; + color: @text; cursor: help; } .contenuAide { max-width: 500px; -} -.conteneurAide { - color: #ccc; -} + @media (max-width: 500px) { + width: 100%; + } -.conteneurAide:hover, .conteneurAide:focus { - background: rgba(0,0,0,.4); } .conteneurAide .contenuAide { position: absolute; transform: scale(0) rotate(-12deg); - color: #FFFFFF; - background: rgba(0,0,0,1); + color: @text; + background: @bgHelp; padding: 15px; border-radius: 3px; - box-shadow: 0 0 2px rgba(0,0,0,.5); + box-shadow: 0 0 10px rgba(0,0,0,.5); margin-top: 23px; margin-left: -35px; transition: all .25s; opacity: 0; } -.conteneurAide:hover .contenuAide, .conteneurAide:focus .contenuAide { +.conteneurAide:hover .contenuAide, .conteneurAide:focus-within .contenuAide { transform: scale(1) rotate(0); opacity: 1; } - -.conteneurAide, .conteneurAide:hover { - background-color: @fond; - text-decoration: none; -} diff --git a/temp/6MBFnPdqJOHR6SrkUx5hTlzXLuNkt96TFSTtbmnLkyyuvB8Feu.png b/temp/6MBFnPdqJOHR6SrkUx5hTlzXLuNkt96TFSTtbmnLkyyuvB8Feu.png deleted file mode 100644 index 897d0f4..0000000 Binary files a/temp/6MBFnPdqJOHR6SrkUx5hTlzXLuNkt96TFSTtbmnLkyyuvB8Feu.png and /dev/null differ diff --git a/themes/defaut/favicons/128.png b/themes/dark/favicons/128.png similarity index 100% rename from themes/defaut/favicons/128.png rename to themes/dark/favicons/128.png diff --git a/themes/defaut/favicons/16.png b/themes/dark/favicons/16.png similarity index 100% rename from themes/defaut/favicons/16.png rename to themes/dark/favicons/16.png diff --git a/themes/defaut/favicons/192.png b/themes/dark/favicons/192.png similarity index 100% rename from themes/defaut/favicons/192.png rename to themes/dark/favicons/192.png diff --git a/themes/defaut/favicons/256.png b/themes/dark/favicons/256.png similarity index 100% rename from themes/defaut/favicons/256.png rename to themes/dark/favicons/256.png diff --git a/themes/defaut/favicons/32.png b/themes/dark/favicons/32.png similarity index 100% rename from themes/defaut/favicons/32.png rename to themes/dark/favicons/32.png diff --git a/themes/defaut/favicons/384.png b/themes/dark/favicons/384.png similarity index 100% rename from themes/defaut/favicons/384.png rename to themes/dark/favicons/384.png diff --git a/themes/defaut/favicons/48.png b/themes/dark/favicons/48.png similarity index 100% rename from themes/defaut/favicons/48.png rename to themes/dark/favicons/48.png diff --git a/themes/defaut/favicons/512.png b/themes/dark/favicons/512.png similarity index 100% rename from themes/defaut/favicons/512.png rename to themes/dark/favicons/512.png diff --git a/themes/defaut/favicons/64.png b/themes/dark/favicons/64.png similarity index 100% rename from themes/defaut/favicons/64.png rename to themes/dark/favicons/64.png diff --git a/themes/defaut/favicons/96.png b/themes/dark/favicons/96.png similarity index 100% rename from themes/defaut/favicons/96.png rename to themes/dark/favicons/96.png diff --git a/themes/dark/theme.php b/themes/dark/theme.php new file mode 100755 index 0000000..107ac1a --- /dev/null +++ b/themes/dark/theme.php @@ -0,0 +1,17 @@ + "#2D2F34", + "bgField" => "#31363B", + "bgTextField" => "#232629", + "bgHelp" => "#151616", + "border" => "#5f5f5f", + "borderHover" => "#808080", + "borderFocus" => "white", + "text" => "white", + "secondaryText" => "#868686" +); // Définit les couleurs du thème + +?> diff --git a/themes/defaut/defaut.php b/themes/defaut/defaut.php deleted file mode 100644 index 234c4c3..0000000 --- a/themes/defaut/defaut.php +++ /dev/null @@ -1,17 +0,0 @@ - "#2D2F34", - "fondChamp" => "#31363B", - "fondChampTexte" => "#232629", - "bordure" => "#5f5f5f", - "bordureHover" => "#808080", - "bordureFocus" => "#b6b6b6", - "texte" => "white", - "texteForm" => "white", - "texteLienCodeSource" => "#868686" -); // Définit les couleurs du thème - -?> diff --git a/themes/defaut/theme.php b/themes/defaut/theme.php deleted file mode 100644 index 234c4c3..0000000 --- a/themes/defaut/theme.php +++ /dev/null @@ -1,17 +0,0 @@ - "#2D2F34", - "fondChamp" => "#31363B", - "fondChampTexte" => "#232629", - "bordure" => "#5f5f5f", - "bordureHover" => "#808080", - "bordureFocus" => "#b6b6b6", - "texte" => "white", - "texteForm" => "white", - "texteLienCodeSource" => "#868686" -); // Définit les couleurs du thème - -?> diff --git a/themes/parinux/parinux.php b/themes/parinux/parinux.php deleted file mode 100644 index 6df427f..0000000 --- a/themes/parinux/parinux.php +++ /dev/null @@ -1,17 +0,0 @@ - "#157097", - "fondChamp" => "#2794c2", - "fondChampTexte" => "#2794c2", - "bordure" => "#48aed9", - "bordureHover" => "#87d1f1", - "bordureFocus" => "#e2f6ff", - "texte" => "#d5f3ff", - "texteForm" => "#e2f6ff", - "texteLienCodeSource" => "#3da3cf" -); // Définit les couleurs du thème - -?> diff --git a/themes/parinux/theme.php b/themes/parinux/theme.php old mode 100644 new mode 100755 index 6df427f..7121942 --- a/themes/parinux/theme.php +++ b/themes/parinux/theme.php @@ -3,15 +3,15 @@ $themeDimensionsFavicons = array(16, 32, 48, 64, 96, 128, 192, 256, 384, 512); // Liste les dimensions des favicons $variablesTheme = array( - "fond" => "#157097", - "fondChamp" => "#2794c2", - "fondChampTexte" => "#2794c2", - "bordure" => "#48aed9", - "bordureHover" => "#87d1f1", - "bordureFocus" => "#e2f6ff", - "texte" => "#d5f3ff", - "texteForm" => "#e2f6ff", - "texteLienCodeSource" => "#3da3cf" + "bg" => "#157097", + "bgField" => "#2794c2", + "bgTextField" => "#2794c2", + "bgHelp" => "#118abe", + "border" => "#48aed9", + "borderHover" => "#87d1f1", + "borderFocus" => "#e2f6ff", + "text" => "#d5f3ff", + "secondaryText" => "#65b7da" ); // Définit les couleurs du thème ?> diff --git a/ubuntu/ubuntu.min.css b/ubuntu/ubuntu.min.css index 49b00c6..c9cee06 100755 --- a/ubuntu/ubuntu.min.css +++ b/ubuntu/ubuntu.min.css @@ -1,2 +1,2 @@ /* Ubuntu Font Family Bower-ready v0.1.13 */ -@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-light-webfont.eot);src:url(ubuntu/fonts/ubuntu-light-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-light-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-light-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-light-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-light-webfont.svg#ubuntulight) format('svg');font-weight:300;font-style:normal}@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-light-italic-webfont.eot);src:url(ubuntu/fonts/ubuntu-light-italic-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-light-italic-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-light-italic-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-light-italic-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-light-italic-webfont.svg#ubuntulight_italic) format('svg');font-weight:300;font-style:italic}@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-regular-webfont.eot);src:url(ubuntu/fonts/ubuntu-regular-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-regular-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-regular-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-regular-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-regular-webfont.svg#ubunturegular) format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-regular-italic-webfont.eot);src:url(ubuntu/fonts/ubuntu-regular-italic-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-regular-italic-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-regular-italic-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-regular-italic-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-regular-italic-webfont.svg#ubuntuitalic) format('svg');font-weight:normal;font-style:italic}@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-medium-webfont.eot);src:url(ubuntu/fonts/ubuntu-medium-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-medium-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-medium-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-medium-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-medium-webfont.svg#ubuntumedium) format('svg');font-weight:500;font-style:normal}@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-medium-italic-webfont.eot);src:url(ubuntu/fonts/ubuntu-medium-italic-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-medium-italic-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-medium-italic-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-medium-italic-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-medium-italic-webfont.svg#ubuntumedium_italic) format('svg');font-weight:500;font-style:italic}@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-bold-webfont.eot);src:url(ubuntu/fonts/ubuntu-bold-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-bold-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-bold-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-bold-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-bold-webfont.svg#ubuntubold) format('svg');font-weight:bold;font-style:normal}@font-face{font-family:'Ubuntu';src:url(ubuntu/fonts/ubuntu-bold-italic-webfont.eot);src:url(ubuntu/fonts/ubuntu-bold-italic-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-bold-italic-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-bold-italic-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-bold-italic-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-bold-italic-webfont.svg#ubuntubold_italic) format('svg');font-weight:bold;font-style:italic}@font-face{font-family:'Ubuntu Condensed';src:url(ubuntu/fonts/ubuntu-condensed-webfont.eot);src:url(ubuntu/fonts/ubuntu-condensed-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntu-condensed-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntu-condensed-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntu-condensed-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntu-condensed-webfont.svg#ubuntu_condensedregular) format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu Monospace';src:url(ubuntu/fonts/ubuntumono-regular-webfont.eot);src:url(ubuntu/fonts/ubuntumono-regular-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntumono-regular-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntumono-regular-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntumono-regular-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntumono-regular-webfont.svg#ubuntu_monoregular) format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu Monospace';src:url(ubuntu/fonts/ubuntumono-regular-italic-webfont.eot);src:url(ubuntu/fonts/ubuntumono-regular-italic-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntumono-regular-italic-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntumono-regular-italic-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntumono-regular-italic-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntumono-regular-italic-webfont.svg#ubuntu_monoitalic) format('svg');font-weight:normal;font-style:italic}@font-face{font-family:'Ubuntu Monospace';src:url(ubuntu/fonts/ubuntumono-bold-webfont.eot);src:url(ubuntu/fonts/ubuntumono-bold-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntumono-bold-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntumono-bold-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntumono-bold-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntumono-bold-webfont.svg#ubuntu_monobold) format('svg');font-weight:bold;font-style:normal}@font-face{font-family:'Ubuntu Monospace';src:url(ubuntu/fonts/ubuntumono-bold-italic-webfont.eot);src:url(ubuntu/fonts/ubuntumono-bold-italic-webfont.eot?#iefix) format('embedded-opentype'),url(ubuntu/fonts/ubuntumono-bold-italic-webfont.woff2) format('woff2'),url(ubuntu/fonts/ubuntumono-bold-italic-webfont.woff) format('woff'),url(ubuntu/fonts/ubuntumono-bold-italic-webfont.ttf) format('truetype'),url(ubuntu/fonts/ubuntumono-bold-italic-webfont.svg#ubuntu_monobold_italic) format('svg');font-weight:bold;font-style:italic} +@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-light-webfont.eot);src:url(fonts/ubuntu-light-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-light-webfont.woff2) format('woff2'),url(fonts/ubuntu-light-webfont.woff) format('woff'),url(fonts/ubuntu-light-webfont.ttf) format('truetype'),url(fonts/ubuntu-light-webfont.svg#ubuntulight) format('svg');font-weight:300;font-style:normal}@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-light-italic-webfont.eot);src:url(fonts/ubuntu-light-italic-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-light-italic-webfont.woff2) format('woff2'),url(fonts/ubuntu-light-italic-webfont.woff) format('woff'),url(fonts/ubuntu-light-italic-webfont.ttf) format('truetype'),url(fonts/ubuntu-light-italic-webfont.svg#ubuntulight_italic) format('svg');font-weight:300;font-style:italic}@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-regular-webfont.eot);src:url(fonts/ubuntu-regular-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-regular-webfont.woff2) format('woff2'),url(fonts/ubuntu-regular-webfont.woff) format('woff'),url(fonts/ubuntu-regular-webfont.ttf) format('truetype'),url(fonts/ubuntu-regular-webfont.svg#ubunturegular) format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-regular-italic-webfont.eot);src:url(fonts/ubuntu-regular-italic-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-regular-italic-webfont.woff2) format('woff2'),url(fonts/ubuntu-regular-italic-webfont.woff) format('woff'),url(fonts/ubuntu-regular-italic-webfont.ttf) format('truetype'),url(fonts/ubuntu-regular-italic-webfont.svg#ubuntuitalic) format('svg');font-weight:normal;font-style:italic}@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-medium-webfont.eot);src:url(fonts/ubuntu-medium-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-medium-webfont.woff2) format('woff2'),url(fonts/ubuntu-medium-webfont.woff) format('woff'),url(fonts/ubuntu-medium-webfont.ttf) format('truetype'),url(fonts/ubuntu-medium-webfont.svg#ubuntumedium) format('svg');font-weight:500;font-style:normal}@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-medium-italic-webfont.eot);src:url(fonts/ubuntu-medium-italic-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-medium-italic-webfont.woff2) format('woff2'),url(fonts/ubuntu-medium-italic-webfont.woff) format('woff'),url(fonts/ubuntu-medium-italic-webfont.ttf) format('truetype'),url(fonts/ubuntu-medium-italic-webfont.svg#ubuntumedium_italic) format('svg');font-weight:500;font-style:italic}@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-bold-webfont.eot);src:url(fonts/ubuntu-bold-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-bold-webfont.woff2) format('woff2'),url(fonts/ubuntu-bold-webfont.woff) format('woff'),url(fonts/ubuntu-bold-webfont.ttf) format('truetype'),url(fonts/ubuntu-bold-webfont.svg#ubuntubold) format('svg');font-weight:bold;font-style:normal}@font-face{font-family:'Ubuntu';src:url(fonts/ubuntu-bold-italic-webfont.eot);src:url(fonts/ubuntu-bold-italic-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-bold-italic-webfont.woff2) format('woff2'),url(fonts/ubuntu-bold-italic-webfont.woff) format('woff'),url(fonts/ubuntu-bold-italic-webfont.ttf) format('truetype'),url(fonts/ubuntu-bold-italic-webfont.svg#ubuntubold_italic) format('svg');font-weight:bold;font-style:italic}@font-face{font-family:'Ubuntu Condensed';src:url(fonts/ubuntu-condensed-webfont.eot);src:url(fonts/ubuntu-condensed-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntu-condensed-webfont.woff2) format('woff2'),url(fonts/ubuntu-condensed-webfont.woff) format('woff'),url(fonts/ubuntu-condensed-webfont.ttf) format('truetype'),url(fonts/ubuntu-condensed-webfont.svg#ubuntu_condensedregular) format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu Monospace';src:url(fonts/ubuntumono-regular-webfont.eot);src:url(fonts/ubuntumono-regular-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntumono-regular-webfont.woff2) format('woff2'),url(fonts/ubuntumono-regular-webfont.woff) format('woff'),url(fonts/ubuntumono-regular-webfont.ttf) format('truetype'),url(fonts/ubuntumono-regular-webfont.svg#ubuntu_monoregular) format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu Monospace';src:url(fonts/ubuntumono-regular-italic-webfont.eot);src:url(fonts/ubuntumono-regular-italic-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntumono-regular-italic-webfont.woff2) format('woff2'),url(fonts/ubuntumono-regular-italic-webfont.woff) format('woff'),url(fonts/ubuntumono-regular-italic-webfont.ttf) format('truetype'),url(fonts/ubuntumono-regular-italic-webfont.svg#ubuntu_monoitalic) format('svg');font-weight:normal;font-style:italic}@font-face{font-family:'Ubuntu Monospace';src:url(fonts/ubuntumono-bold-webfont.eot);src:url(fonts/ubuntumono-bold-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntumono-bold-webfont.woff2) format('woff2'),url(fonts/ubuntumono-bold-webfont.woff) format('woff'),url(fonts/ubuntumono-bold-webfont.ttf) format('truetype'),url(fonts/ubuntumono-bold-webfont.svg#ubuntu_monobold) format('svg');font-weight:bold;font-style:normal}@font-face{font-family:'Ubuntu Monospace';src:url(fonts/ubuntumono-bold-italic-webfont.eot);src:url(fonts/ubuntumono-bold-italic-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/ubuntumono-bold-italic-webfont.woff2) format('woff2'),url(fonts/ubuntumono-bold-italic-webfont.woff) format('woff'),url(fonts/ubuntumono-bold-italic-webfont.ttf) format('truetype'),url(fonts/ubuntumono-bold-italic-webfont.svg#ubuntu_monobold_italic) format('svg');font-weight:bold;font-style:italic}