Ajout des logos en SVG

parent eff4282c
......@@ -20,6 +20,8 @@ http(s)://votredomaine.tld/votre_chemin/iframe.php?pubkey=78ZwwgpgdH5uLZLbThUQH7
http(s)://votredomaine.tld/votre_chemin/image.php?pubkey=78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8&target=10000
http(s)://votredomaine.tld/votre_chemin/svg.php?pubkey=78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8&target=10000
## Liste des paramètres obligatoires
......@@ -42,4 +44,14 @@ http(s)://votredomaine.tld/votre_chemin/image.php?pubkey=78ZwwgpgdH5uLZLbThUQH7L
* **font_color** (Couleur de la police, en hexadecimal. Valeur par défaut : *212529*)
* **progress_color** (Couleur de la barre de progression, en hexadecimal. Valeur par défaut : *ffc107*)
* **border_color** (Couleur de bordure de la barre de progression, en hexadecimal. Valeur par défaut : *343a40*)
* **lang** (identifiant de langue de l'interface correspondant au [standard BCP 47](https://fr.wikipedia.org/wiki/%C3%89tiquette_d'identification_de_langues_IETF). Valeur par défaut : fr. Valeurs disponibles pour l'instant : fr|en|eo)
\ No newline at end of file
* **lang** (identifiant de langue de l'interface correspondant au [standard BCP 47](https://fr.wikipedia.org/wiki/%C3%89tiquette_d'identification_de_langues_IETF). Valeur par défaut : fr. Valeurs disponibles pour l'instant : fr|en|eo)
## Intégration dans votre code HTML
### Image PNG
`<img src="http(s)://votredomaine.tld/votre_chemin/image.php?pubkey=78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8&target=10000" />`
### Image SVG
`<object type="image/svg+xml" data="http(s)://votredomaine.tld/votre_chemin/svg.php?pubkey=78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8&target=10000" border="1"></object>`
### Iframe
`<iframe src="http(s)://votredomaine.tld/votre_chemin/iframe.php?pubkey=78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8&target=10000" width="X" height="Y" border="0"></iframe>`
**N.B :** Pour l'iframe, il faut renseigner les attributs width et height, en relatif (%) ou en absolu. L'attribut border permet d'afficher ou de masquer une bordure autour des balises `object` et `iframe`.
\ No newline at end of file
......@@ -68,7 +68,7 @@ $display_qrcode = (!empty($_GET['display_qrcode']));
$titre = (!empty($_GET['title'])) ? $_GET['title'] : utf8_decode(tr('title_default'));
$node = (!empty($_GET['node'])) ? $_GET['node'] : 'g1.duniter.org';
$logo = (!empty($_GET['logo'])) ? $_GET['logo'] : 'no-logo';
$logo = 'img/logos/' . $logo . '.png';
$logo = 'img/logos/png/' . $logo . '.png';
if (!file_exists($logo)){$logo='no-logo';}
$whitespace = 25;
$content_x = $whitespace;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
width="1500pt"
height="1500pt"
viewBox="0 0 1500 1500"
preserveAspectRatio="xMidYMid meet"
id="svg10"
sodipodi:docname="Silkaj.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<defs
id="defs14" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1080"
inkscape:window-height="1857"
id="namedview12"
showgrid="false"
inkscape:zoom="0.17480153"
inkscape:cx="734.21214"
inkscape:cy="-235.68784"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g8"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata2">
Created by potrace 1.15, written by Peter Selinger 2001-2017
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="matrix(0.1,0,0,-0.1,0,1499.9995)"
id="g8"
style="fill:#000000;stroke:none">
<path
style="stroke-width:1"
d="M 7499.9925,14659.997 A 7505,7159.9999 0 0 1 -5.0022999,7500.0023 7505,7159.9999 0 0 1 7499.9925,339.99269 7505,7159.9999 0 0 1 15005.002,7500.0023 7505,7159.9999 0 0 1 7499.9925,14659.997 Z m -33.5008,-641.631 c 264.2503,0.375 528.509,-2.364 586.5088,-8.364 696.9997,-75 1174.002,-174.004 1732.0019,-359.004 344.0006,-115 620.9976,-230.996 967.9976,-405.996 463,-233 800.992,-449.009 1186.992,-759.009 424.001,-340 857.001,-789.001 1170,-1211.001 524.001,-706 918.006,-1565.9936 1105.005,-2408.9935 42,-190.0001 94.998,-509.0069 116.997,-707.0069 27,-241 27,-1146.9983 0,-1387.9981 -48.999,-435.9997 -139.992,-867.996 -267.993,-1260.996 -314,-962.9999 -826.008,-1801.9942 -1543.008,-2528.9939 -552.999,-559.0005 -1076.999,-942.012 -1758.999,-1287.012 -546.999,-275.9999 -993.9918,-439.9927 -1591.9915,-582.9929 -410.0003,-98.0003 -607.998,-129.99603 -1102.998,-180.99602 -135,-12.99975 -1026.0118,-13.00425 -1167.0118,0.996 -414.0001,39.99975 -528.9952,57.00374 -829.9952,119.00402 -686.9999,141.9997 -1241.996,332.9947 -1845.996,634.9949 -481,240.9998 -803.0039,447.9945 -1229.0039,788.994 -192.9999,155.0003 -247.9931,204.0008 -492.9931,446.001 -331.0001,324.9998 -589.0137,638.0107 -844.0137,1021.011 -425,636 -761.98827,1426.9979 -917.98824,2152.9979 -40.99999,189.9998 -112.00878,626.997 -129.00879,791.997 -21.99999,213 -21.99999,964.998 0,1177.998 17.00001,165 88.0088,602.997 129.00879,791.997 127.00002,591 387.99704,1262.0065 701.99704,1802.0065 277,479 599.997,900 1001.997,1305 231,234 361.0059,353.003 561.0059,513.003 415,334 751.999,549.999 1218.999,783.999 333,166 599.0009,277 941.0009,390 550,184 1027.9951,282.993 1714.9951,357.993 58,6.5 322.2441,9.996 586.4942,10.371 z m -7.4561,-633.384 c -79.7149,-0.08 -159.4082,-1.73 -239.0332,-4.98 -260,-11 -484.0049,-35.006 -760.0049,-81.006 -681,-114 -1402.0028,-365.005 -1968.0028,-685.005 -947,-536 -1697.0029,-1248.989 -2238.0029,-2128.989 -355.0001,-575.9997 -563.9932,-1074.9997 -717.9931,-1709.9997 -113.0001,-463.9999 -150.9962,-791.0048 -150.9962,-1300.0048 0,-507.9997 38,-836.0047 150,-1300.005 152,-627 354.9971,-1111.9889 701.9971,-1678.9889 426,-696 1087.0049,-1381.0042 1780.0048,-1844.004 510,-341.0002 966.998,-564 1537.998,-750 641,-209.0002 1237.9951,-303.999 1909.9951,-303.999 387.9997,0 646.005,20.9978 1015.005,82.998 683.0002,114 1407.0007,366.9998 1976.0005,690 882,500.0003 1581.989,1147.002 2102.988,1942.002 552,842.0002 854.007,1703.9969 951.006,2711.9969 23.001,231 23.001,709.0048 0,940.0048 -99,1027.0001 -409.002,1898.9951 -978.003,2749.9947 -81.999,123 -307.992,419.005 -406.992,535.005 -369,430 -796.009,803.99 -1295.01,1134.99 -976.8746,647.813 -2175.2335,1001.195 -3370.9564,999.99 z m -639.7119,-537.612 c 58.4531,0.346 97.9277,-6.501 119.6777,-20.376 21,-14 26.001,-24.997 26.001,-56.997 0,-56 -35.999,-80.005 -228.999,-145.005 -236,-80 -389.0009,-143.995 -626.001,-259.995 -532.9999,-262 -948.0049,-563.001 -1360.0048,-986.001 -362,-372 -641,-771.001 -870,-1241 -193,-398.0005 -307.0039,-728.0034 -404.0039,-1173.0034 -85,-391 -101.0009,-543.9952 -101.0009,-964.9951 0,-420 17.0048,-587.003 100.0048,-963.003 72,-323.0002 182,-680.0017 285,-922.002 116,-272.0002 318.0039,-640.9897 464.0039,-849.9899 210,-300.9998 597.0029,-745.005 648.0029,-745.005 24,0 558.9882,540.0045 2132.9883,2155.0049 282.9999,291 679.0048,695.9891 880.0048,898.9891 201,204 477.9997,488.0001 615,630 138,143 264.0052,268.0127 280.005,278.0127 39,23 142.998,24.9922 187.998,1.9922 39,-20 440.9909,-416.0039 500.9909,-494.0039 184.0005,-237 353.0078,-666 403.008,-1020.0001 27,-192.9997 23.994,-572.9947 -6.006,-739.995 -45.9997,-258.9997 -118.002,-484.005 -217.002,-685.005 -67.9995,-135.9997 -221.9902,-367.9957 -309.9899,-465.9959 -36.9998,-41.0003 -92.007,-104.994 -122.007,-143.994 -54.9998,-68.0003 -477.9923,-503.0048 -1306.992,-1345.005 -225,-228 -458.9982,-471.9997 -517.9981,-540 -146.0001,-167.0002 -878.0049,-893.007 -925.0049,-917.007 -68,-33 -186.9971,-23.9887 -401.9971,31.011 -387,101.0003 -686.0077,211.9958 -1048.0078,390.996 -836,413.0003 -1485.9989,950.0002 -2013.9989,1665 -353,479.0002 -654.9971,1085.0002 -821.9971,1649.9999 -99,336.9998 -166.9971,664.005 -206.997,1000.005 -19.0001,161.0003 -22.002,235.995 -22.002,574.995 0,339 3.0019,413.999 22.002,573.999 79.9999,666 257.0019,1268.0058 547.0019,1851.0058 281,565.9997 597,997.9997 1065,1454.9997 196,192 337.9882,313.99 512.9882,444.99 686,511 1456.0039,855.005 2264.0039,1015.005 208.75,41.25 358.9062,61.797 456.3281,62.373 z m 2062.7785,-158.774 c 63.1245,0.312 145.4003,-14.219 242.9003,-43.594 329.0002,-97 830.9902,-320.01 1164.9895,-515.01 459,-269 808.005,-540.991 1165.005,-905.991 398.001,-408 686.994,-812.009 938.994,-1314.0084 313.001,-621.0001 478.012,-1174.9903 567.012,-1899.9903 27,-213 26.997,-929.0098 0.996,-1145.0098 -71,-582 -199.008,-1078.9927 -403.008,-1557.993 -76.999,-180.9997 -247,-514.9972 -341.001,-671.9969 -477.999,-791.0003 -1154.994,-1448.0092 -1969.995,-1914.009 -225.999,-129 -315.9911,-169.0027 -410.9906,-183.003 -98.0002,-13.9995 -116.0002,-7.9995 -120,45 -5.0002,54 43.992,100.011 256.992,241.011 414.9996,275.0003 716.0006,528.9923 1016.0006,856.992 383.001,420 654.006,841.0095 880.005,1370.01 144,335.9999 251.991,729.0007 305.991,1121.0009 17.001,123 23.001,218.994 26.001,488.994 4,297.9998 2.008,356.0048 -16.992,520.0048 -45,391.0001 -149.011,805.9942 -282.012,1133.9942 -54,131 -202.989,441.0029 -268.989,558.0029 -84,148 -272.999,431.997 -378.999,566.997 -195,251.0001 -447.999,515.9952 -675,709.9956 -179,154 -192.009,163.005 -219.009,156.005 -12.999,-3 -130.002,-113.998 -262.002,-247.998 -130.9991,-133.9997 -391.9938,-398.0026 -578.9936,-588.0026 -188.0002,-189.9999 -369.9997,-376.0048 -404.9999,-415.0048 -35.0003,-38 -239.9948,-248.9922 -454.995,-466.9922 -213.9998,-218 -639.9998,-652.0097 -945,-965.0098 -305.0001,-312 -706.0099,-720.9983 -890.0098,-907.9981 -184.0001,-186.9997 -370.9942,-376.9882 -413.9942,-422.988 -43,-46.0005 -89.0078,-88.0027 -103.0078,-93.003 -13,-5.0002 -49.9912,-9.009 -80.9912,-9.009 -77,0 -126,30.006 -255,156.006 -125,122.0003 -199.999,229.9988 -303.999,438.999 -98,194.0003 -132.9961,286.005 -180.9961,475.0048 -64,251.0001 -77.0068,367.9952 -77.0068,709.9952 0,324 6,387 60,630 105.9999,476.9999 296.0039,888.9989 599.0039,1293.9989 127.9999,172.0006 230.997,281.0056 956.997,1011.0056 350,352 881.0047,888.994 1180.005,1193.994 369,375 556.989,560.003 583.989,573.003 23.25,10.875 54.2347,16.409 92.1097,16.597 z"
id="path4"
inkscape:connector-curvature="0" />
</g>
</svg>
......@@ -45,7 +45,7 @@ $background_color = (!empty($_GET['background_color'])) ? '#' . $_GET['backgroun
$border_color = (!empty($_GET['border_color'])) ? '#' . $_GET['border_color'] : '#343a40';
$progress_color = (!empty($_GET['progress_color'])) ? '#' . $_GET['progress_color'] : '#ffc107';
$logo = (!empty($_GET['logo'])) ? $_GET['logo'] : 'no-logo';
$logo = 'img/logos/' . $logo . '.png';
$logo = 'img/logos/svg/' . $logo . '.svg';
if (!file_exists($logo)){$logo='no-logo';}
if ($logo != 'no-logo'){
$largeur_logo = 150;
......@@ -199,8 +199,7 @@ $percentage = round($total/$target,2);
$percentage_bar = ($percentage>1) ? 1 : $percentage;
$bar_innerfill = $percentage_bar*($bar_width - 2*$bar_border);
?>
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<?xml version="1.0" encoding="utf-8"?>
<svg width="<?php echo $svg_width; ?>" height="<?php echo $svg_height; ?>" style="fill:<?php echo $font_color; ?>;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect
x="<?php echo $bar_border; ?>"
......@@ -215,7 +214,7 @@ $bar_innerfill = $percentage_bar*($bar_width - 2*$bar_border);
height="<?php echo $svg_height-8*$bar_border; ?>"
style="fill:<?php echo $background_color; ?>;stroke:<?php echo $border_color; ?>;stroke-width:<?php echo $bar_border; ?>;"/>
<?php if ($logo != 'no-logo'){ ?>
<image xlink:href="<?php echo base64_encode_image ($logo,'png');; ?>" x="<?php echo $whitespace; ?>" y="<?php echo ($svg_height-$largeur_logo)/2; ?>" />
<image xlink:href="<?php echo $logo; ?>" x="<?php echo $whitespace; ?>" y="<?php echo ($svg_height-$largeur_logo)/2; ?>" width="<?php echo $largeur_logo; ?>" height="<?php echo $largeur_logo; ?>" />
<?php } ?>
<g style="font-family:sans-serif;">
<text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment