This commit is contained in:
aymm 2021-04-17 17:05:13 +02:00
parent 52ee54f5f9
commit 6880b8221b
Signed by: phlaym
GPG Key ID: A06651BAB6777237
3 changed files with 56 additions and 9 deletions

View File

@ -39,29 +39,57 @@ function get_page_header(
$script_str .= '<script src="scripts/' . $script . '.js"></script>'; $script_str .= '<script src="scripts/' . $script . '.js"></script>';
} }
$home_link = get_icon_link(
'index.php',
'Home',
'home',
'homelink'
);
$new_poll_link = get_icon_link(
'new_poll.php',
'New Poll',
'plus',
'newpolllink'
);
return '<html><head><meta charset="utf-8"><title>'.$title.'</title><link rel="stylesheet" href="styles/style.css">' return '<html><head><meta charset="utf-8"><title>'.$title.'</title><link rel="stylesheet" href="styles/style.css">'
. $script_str . $script_str
. '</head><body><header>' . '</head><body><header>'
. '<a href="index.php" class="homelink" title="Home"><div class="linkcontents">' . $home_link
. file_get_contents(__DIR__.'/icons/home.svg') . $new_poll_link
. '<span class="linklabel">Home</span></div></a>'
. '<a href="new_poll.php" class="newpolllink '.$newpoll_class.'" title="New Poll"><div class="linkcontents">'
. file_get_contents(__DIR__.'/icons/plus.svg')
. '<span class="linklabel">New Poll</span></div></a>'
. $greeting . $greeting
. '<div class="spacer"></div>' . '<div class="spacer"></div>'
. $logout_link . $logout_link
. '</header><main>'; . '</header><main>';
} }
function get_icon_link(string $href, string $label, string $icon, string $class)
{
return '<a href="'.$href.'" title="'.$label.'" class="'.$class.'">'
. '<div class="linkcontents">'
. file_get_contents(__DIR__.'/icons/'.$icon.'.svg')
. '<span class="linklabel">'.$label.'</span></div></a>';
}
function get_page_footer() function get_page_footer()
{ {
$version = json_decode(file_get_contents(__DIR__ . '/composer.json'), true)['version']; $version = json_decode(file_get_contents(__DIR__ . '/composer.json'), true)['version'];
$repo_link = get_icon_link(
'https://phlaym.net/git/phlaym/Dragonpolls',
'Source Code',
'src',
'sourcecode'
);
$issues_link = get_icon_link(
'https://github.com/hutattedonmyarm/Dragonpolls/issues',
'Issues',
'issues',
'issues'
);
return '</main><footer>' return '</main><footer>'
. '<a href="https://phlaym.net/git/phlaym/Dragonpolls/releases/tag/'.$version.'">Version ' . $version . '</a>' . '<a href="https://phlaym.net/git/phlaym/Dragonpolls/releases/tag/'.$version.'">Version ' . $version . '</a>'
. '<a href="https://phlaym.net/git/phlaym/Dragonpolls" title="Source" class="sourcecode"><div class="linkcontents">' . $repo_link
. file_get_contents(__DIR__.'/icons/src.svg') . $issues_link
. '<span class="linklabel">Source Code</span></div></a>'
. '</footer></body></html>'; . '</footer></body></html>';
} }

15
icons/issues.svg Normal file
View File

@ -0,0 +1,15 @@
<?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 width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
<g transform="matrix(1.35206,0,0,1.35206,-74.2829,-59.7839)">
<circle cx="128.901" cy="118.178" r="66.565" style="fill:none;"/>
</g>
<g transform="matrix(1,0,0,1,0,3.53095)" class="filled">
<g transform="matrix(-0.903127,1.10601e-16,-1.10601e-16,-0.903127,192.517,175.685)">
<path d="M102.441,58.588C102.441,58.588 91.63,125.231 91.63,153.793C91.63,159.759 96.475,164.603 102.441,164.603C108.408,164.603 113.252,159.759 113.252,153.793C113.252,125.231 102.441,58.588 102.441,58.588Z"/>
</g>
<g transform="matrix(0.762846,0,0,0.762846,23.9482,35.356)">
<circle cx="99.695" cy="160.113" r="11.029"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -27,6 +27,10 @@ a svg {
stroke-width: 0.5em; stroke-width: 0.5em;
} }
a svg .filled {
fill: var(--main-accent-color);
}
body { body {
background: var(--main-bg-color); background: var(--main-bg-color);
color: var(--main-fg-color); color: var(--main-fg-color);