logos and favicon resizer

logo
Thibault Duplessis 2019-12-01 08:23:07 -06:00
parent d089136979
commit 4570b62969
14 changed files with 112 additions and 22 deletions

View File

@ -43,9 +43,9 @@ object layout {
private val jsLicense = raw("""<link rel="jslicense" href="/source"/>""")
private val favicons = raw {
List(256, 128, 64) map { px =>
s"""<link rel="icon" type="image/png" href="${staticUrl(s"favicon.$px.png")}" sizes="${px}x${px}">"""
} mkString ("", "", s"""<link id="favicon" rel="icon" type="image/png" href="${staticUrl("images/favicon-32-white.png")}" sizes="32x32">""")
List(512, 256, 128, 64) map { px =>
s"""<link rel="icon" type="image/png" href="${staticUrl(s"lichess-favicon-$px-png")}" sizes="${px}x${px}">"""
} mkString ("", "", s"""<link id="favicon" rel="icon" type="image/png" href="${staticUrl("logo/lichess-favicon-32.png")}" sizes="32x32">""")
}
private def blindModeForm(implicit ctx: Context) = raw(s"""<form id="blind-mode" action="${routes.Main.toggleBlindMode}" method="POST"><input type="hidden" name="enable" value="${if (ctx.blind) 0 else 1}" /><input type="hidden" name="redirect" value="${ctx.req.path}" /><button type="submit">Accessibility: ${if (ctx.blind) "Disable" else "Enable"} blind mode</button></form>""")
private val zenToggle = raw("""<a data-icon="E" id="zentog" class="text fbt active">ZEN MODE</a>""")

8
bin/gen/favicons 100755
View File

@ -0,0 +1,8 @@
#!/bin/sh
file=public/logo/lichess-favicon-1024.png
thumb_file=$2
for px in 512 256 128 64 32; do
convert $file -scale ${px}x${px} public/logo/lichess-favicon-${px}.png
done

View File

@ -1,19 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="45" height="45">
<g style="opacity:1; fill:none; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;">
<path
d="M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18"
style="fill:#ffffff; stroke:#000000;" />
<path
d="M 24,18 C 24.38,20.91 18.45,25.37 16,27 C 13,29 13.18,31.34 11,31 C 9.958,30.06 12.41,27.96 11,28 C 10,28 11.19,29.23 10,30 C 9,30 5.997,31 6,26 C 6,24 12,14 12,14 C 12,14 13.89,12.1 14,10.5 C 13.27,9.506 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.28,8.008 21,7 C 22,7 22,10 22,10"
style="fill:#ffffff; stroke:#000000;" />
<path
d="M 9.5 25.5 A 0.5 0.5 0 1 1 8.5,25.5 A 0.5 0.5 0 1 1 9.5 25.5 z"
style="fill:#000000; stroke:#000000;" />
<path
d="M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z"
transform="matrix(0.866,0.5,-0.5,0.866,9.693,-5.173)"
style="fill:#000000; stroke:#000000;" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="50mm" height="50mm" version="1.1" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<metadata>
<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/>
</cc:Work>
</rdf:RDF>
</metadata>
<path d="m38.956 0.49996c-3.5298 0.41803-6.452 0.90223-9.2864 2.9838-24.136-1.6977-30.362 15.049-28.99 25.881 2.8129 20.848 31.238 26.42 40.649 12.335-7.4439 7.6963-19.276 8.7525-28.323 3.0844-9.0468-5.6679-13.512-17.392-8.3227-27.217 5.1893-9.825 14.313-13.032 24.348-11.162 2.4304-1.4179 5.2251-3.2198 7.6555-3.1874l-1.6949 4.8593 12.752 21.371c-0.4384 5.6537-5.4583 6.112-5.4583 6.112-0.5746-1.4709-1.6344-2.9416-4.8419-6.0361-3.2076-3.0944-17.465-10.177-15.788-16.207-2.0017 6.9673 10.311 14.152 14.04 17.663 3.7288 3.5109 5.4255 6.0393 5.7947 6.7564 0 0 9.3924-2.504 7.8379-8.9274l-11.927-21.638z" stroke="#000" stroke-linejoin="round" style="paint-order:normal"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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"
width="50.296772mm"
height="51.676773mm"
version="1.1"
viewBox="0 0 50.296772 51.676773"
id="svg20"
sodipodi:docname="lichess-new-bw.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<defs
id="defs24" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1005"
id="namedview22"
showgrid="false"
inkscape:zoom="1.1103369"
inkscape:cx="177.12284"
inkscape:cy="-44.075439"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg20"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata2">
<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>
<path
inkscape:connector-curvature="0"
id="path10"
style="stroke:none;stroke-linejoin:round;paint-order:normal"
d="m 39.751202,0 c -3.5298,0.41803 -6.452,0.90223 -9.2864,2.9838 C 6.3288021,1.2861 0.10280214,18.0328 1.4748021,28.8648 c 2.8129,20.848 31.2379999,26.42 40.6489999,12.335 -7.4439,7.6963 -19.276,8.7525 -28.323,3.0844 C 4.7540021,38.6163 0.28880214,26.8922 5.4781021,17.0672 10.667402,7.2422 19.791102,4.0352 29.826102,5.9052 c 2.4304,-1.4179 5.2251,-3.2198 7.6555,-3.1874 l -1.6949,4.8593 12.752,21.371 c -0.4384,5.6537 -5.4583,6.112 -5.4583,6.112 -0.5746,-1.4709 -1.6344,-2.9416 -4.8419,-6.0361 -3.2076,-3.0944 -17.465,-10.177 -15.788,-16.207 -2.0017,6.9673 10.311,14.152 14.04,17.663 3.7288,3.5109 5.4255,6.0393 5.7947,6.7564 0,0 9.3924,-2.504 7.8379,-8.9274 l -11.927,-21.638 z"
inkscape:export-filename="D:\path10-2.png"
inkscape:export-xdpi="16.160082"
inkscape:export-ydpi="16.160082" />
<path
inkscape:connector-curvature="0"
id="path10-2"
style="stroke:#ffffff;stroke-width:0.99999994;stroke-linejoin:round;stroke-opacity:1;paint-order:normal"
d="M 38.956002,2.1763 C 35.426202,2.59433 32.504005,3.07853 29.669606,5.1601 5.5336051,3.4624 -0.69239486,20.2091 0.67960514,31.0411 3.4925051,51.88909 31.917604,57.4611 41.328602,43.3761 33.884704,51.07239 22.052605,52.1286 13.005605,46.4605 3.9588061,40.7926 -0.50639486,29.0685 4.6829051,19.2435 9.8722051,9.4185 18.995905,6.2115 29.030905,8.0815 31.461306,6.6636 34.256002,4.8617 36.686402,4.8941 l -1.6949,4.8593 12.752,21.371 c -0.4384,5.65369 -5.4583,6.112 -5.4583,6.112 -0.5746,-1.4709 -1.6344,-2.9416 -4.8419,-6.0361 -3.2076,-3.0944 -17.464997,-10.177 -15.787997,-16.207 -2.0017,6.9673 10.311001,14.152 14.039997,17.663 3.7288,3.5109 5.4255,6.0393 5.7947,6.7564 0,0 9.3924,-2.504 7.8379,-8.9274 l -11.927,-21.638 z"
inkscape:export-filename="D:\path10-2.png"
inkscape:export-xdpi="16.160082"
inkscape:export-ydpi="16.160082" />
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="50mm" height="50mm" version="1.1" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<metadata>
<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/>
</cc:Work>
</rdf:RDF>
</metadata>
<path d="m38.956 0.49996c-3.5298 0.41803-6.452 0.90223-9.2864 2.9838-24.136-1.6977-30.362 15.049-28.99 25.881 2.8129 20.848 31.238 26.42 40.649 12.335-7.4439 7.6963-19.276 8.7525-28.323 3.0844-9.0468-5.6679-13.512-17.392-8.3227-27.217 5.1893-9.825 14.313-13.032 24.348-11.162 2.4304-1.4179 5.2251-3.2198 7.6555-3.1874l-1.6949 4.8593 12.752 21.371c-0.4384 5.6537-5.4583 6.112-5.4583 6.112-0.5746-1.4709-1.6344-2.9416-4.8419-6.0361-3.2076-3.0944-17.465-10.177-15.788-16.207-2.0017 6.9673 10.311 14.152 14.04 17.663 3.7288 3.5109 5.4255 6.0393 5.7947 6.7564 0 0 9.3924-2.504 7.8379-8.9274l-11.927-21.638z" stroke="#000" stroke-linejoin="round" style="paint-order:normal"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.