feat: add website icon/project avatar

This commit is contained in:
Philipp Matthias Schaefer 2021-02-25 22:00:59 +01:00
parent 1b6835eddb
commit b7c0b84274
7 changed files with 44 additions and 18 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
/target/
/icon.png

3
build_icon.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
inkscape -o icon.png -w 200 -h 200 -b white src/static/icon.svg

View File

@ -43,6 +43,7 @@ fn main() -> Result<()> {
r#static::js,
r#static::checkmark,
r#static::cross,
r#static::icon,
r#static::hourglass,
api::update])
.manage(config)

View File

@ -32,6 +32,11 @@ pub fn hourglass() -> Svg<&'static str> {
Svg(include_str!("static/hourglass.svg"))
}
#[get("/icon.svg")]
pub fn icon() -> Svg<&'static str> {
Svg(include_str!("static/icon.svg"))
}
#[get("/legal.html")]
pub fn legal() -> content::Html<&'static str> {
content::Html(include_str!("static/legal.html"))

View File

@ -1,18 +0,0 @@
<svg width="100"
height="100"
viewBox="-1 -1 2 2"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<path stroke-width="0.2"
stroke="black"
stroke-linejoin="round"
fill="none"
d="
M 0 -0.705
L 0.303 -0.705
L 0 0
L -0.303 0.705
L 0.303 0.705
L -0.303 -0.705
L 0 -0.705"/>
</svg>

Before

Width:  |  Height:  |  Size: 458 B

32
src/static/icon.svg Normal file
View File

@ -0,0 +1,32 @@
<svg width="100"
height="100"
viewBox="-1 -1 2 2"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="-1" y="-1" width="2" height="2" fill="white"/>
<path stroke-width="0.1"
stroke="black"
fill="none"
stroke-linejoin="round"
stroke-linecap="round"
d="M -0.65 0
A 0.65 0.65 0 0 1 0.46 -0.46
M -0.85 -0.1
l 0.2 0.2
l 0.2 -0.2
M 0.65 0
A 0.65 0.65 0 0 1 -0.46 0.46
M 0.85 0.1
l -0.2 -0.2
l -0.2 0.2
M -0.1 -0.173
L 0.1 0.173
M 0.1 -0.173
L -0.1 0.173
M -0.2 0
L 0.2 0"/>
</svg>

After

Width:  |  Height:  |  Size: 776 B

View File

@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>WebLDAPPasswd</title>
<link rel="stylesheet" href="webldappasswd.css">
<link rel="icon" type="image/svg+xml" href="icon.svg">
<script src="webldappasswd.js"></script>
</head>
<body>