Redesign navbar and landing page

This commit is contained in:
Markus Wang Halvorsen 2017-11-13 13:21:51 +01:00
parent 518ee8baf2
commit c6cd02486d
4 changed files with 229 additions and 276 deletions

View File

@ -1,22 +1,20 @@
<?php
function navbar($depth, $active = NULL) {
$result = "\n\t<ul>\n";
$result = "<ul>\n";
$menuItems = [
'hjem' => '',
'kalender' => 'kalender',
'aktiviteter' => 'aktiviteter',
'prosjekter' => 'prosjekt',
'kontakt' => 'kontakt',
'wiki' => 'pvv',
'wiki' => 'pvv'
];
foreach($menuItems as $caption => $link) {
$result .= "\t\t<li" . ($active === $link ? ' class="active"' : '') . '>'
. '<a href="' . rtrim(str_repeat('../', $depth) . $link, '/') . '/">'
. $caption
. "</a></li>\n"
$result .= "\t\t\t<a href=\"" . rtrim(str_repeat('../', $depth) . $link, '/') . "/\"" . ($active === $link ? ' class="active"' : '') . ">"
. "<li>" . $caption . "</li></a>\n"
;
}
return $result . "\t</ul>\n";
return $result . "\t\t</ul>\n";
}
function loginBar($sp = 'default-sp') {
@ -27,9 +25,9 @@ function loginBar($sp = 'default-sp') {
$attr = $as->getAttributes();
if($attr) {
$uname = $attr['uid'][0];
$result .= "\t<p class=\"login\">logget inn som: " . htmlspecialchars($uname) . "</p>\n";
$result .= "\t\t<p class=\"login\">logget inn som: " . htmlspecialchars($uname) . "</p>\n";
} else {
$result .= "\t<a class=\"login\" href=\"" . htmlspecialchars($as->getLoginURL()) . "\">logg inn</a>\n";
$result .= "\t\t<a class=\"login\" href=\"" . htmlspecialchars($as->getLoginURL()) . "\">logg inn</a>\n";
}
return $result;

49
www/css/landing.css Normal file
View File

@ -0,0 +1,49 @@
header {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 50px;
padding: 2em 0;
width: 100vw;
height: 40vh;
background-color: #002244;
color: #fff;
}
header img {
width: 30vh;
height: 30vh;
}
main {
margin-top: 0;
}
.intro {
text-align: center;
}
.essentials {
margin: 1.8em 0;
padding: .2em 0;
list-style: none;
display: flex;
justify-content: center;
align-items: center;
}
.essentials li {
display: inline-block;
}
.essentials a {
margin: 0 2em;
height: 100%;
}
.essentials .join {
padding: 1em;
font-size: 1.2em;
}

View File

@ -1,216 +1,119 @@
nav ul {
body {
overflow-y: scroll;
overflow-x: hidden;
}
* {
font-style: -apple-system, 'avenir next', avenir, roboto, noto, ubuntu, 'helvetica neue', helvetica, arial, sans-serif;
}
nav {
position: fixed;
z-index: 99;
top: 0;
left: 0;
right: 0;
margin: .1em auto 0 auto;
text-align: center;
background: rgba(255,255,255,.8);
margin: 0;
z-index: 3;
}
nav li {
display: inline-block;
line-height: 3em;
margin: auto 1em;
}
nav a {
display: inline-block;
margin: auto;
color: gray;
text-decoration: none;
}
nav li.active a {
color: #048;
}
nav .login{
position: fixed;
top: .8em;
right: .8em;
margin: auto;
z-index: 3;
color: gray;
}
header {
margin-top: 3rem;
height: 16rem;
width: 100vw;
height: 50px;
background-color: #002244;
overflow: hidden;
text-align: right;
color: #fff;
font-family: monospace;
padding: 1rem;
font-size: 4em;
background: url('pvv-background.png') no-repeat 1% 50% #024;
background-size: contain;
box-shadow: 0 0 5px #000;
}
main {
max-width: 60rem;
margin: -7rem auto 0 auto;
nav * {
background-color: #002244;
color: #fff;
margin: 0;
padding: 0;
}
article {
padding: .1rem 1rem 1rem 1rem;
margin: 0 1rem 0 1rem;
background: white;
z-index: 2;
position: relative;
}
article p {
text-align: justify;
hyphens: auto;
}
article:first-child {
border-radius: .5rem .5rem 0 0;
}
main:before {
content: " ";
display: block;
position: absolute;
top: 16rem;
left: 1rem;
right: 1rem;
margin: 0 auto;
height: 8em;
z-index: 1;
max-width: 58rem;
box-shadow: 0 -.2rem .15rem rgba(0,0,0,.3);
border-radius: 0 0 .3em .3em;
background: white;
nav h2 {
display: inline-block;
position: fixed;
top: 0;
margin-left: .65em;
line-height: 5vh;
color: #002244;
}
.split {
nav img{
width: 50px;
height: 50px;
}
nav ul {
display: table;
width: 100%;
table-layout: fixed;
border-spacing: 1em;
position: fixed;
top: 0;
left: 15vw;
right: 15vw;
width: 70vw;
height: 50px;
list-style: none;
}
.split > * {
nav a {
display: table-cell;
}
height: 100%;
margin: 0;
.subtitle {
font-weight: bold;
}
.ruler {
border: none;
border-bottom: 1px dotted rgba(0,0,0,.5);
}
a.btn {
text-decoration: none;
border: 1px solid #048;
color: #048;
padding: .2em 1em;
border-radius: .2em;
white-space: nowrap;
display: inline-block;
margin-bottom: .25em;
}
a.btn:hover {
border-color: #084;
background: #eee;
color: #084;
}
a.btn:active {
border-color: #084;
background: #084;
color: white;
}
.boxinput {
text-decoration: none;
border: 1px solid #048;
color: #048;
padding: .2em .4em;
border-radius: .2em;
display: inline-block;
margin-bottom: .25em;
resize: none;
}
.noborder {
border: none !important;
}
.subnote {
margin-top: 0;
color: gray;
font-size: .7em;
font-style: italic;
}
.no-chin {
margin-bottom: 0;
}
.icon.subscribe {
color: white;
background: #082;
border-radius: 1em;
width: 1em;
line-height: 1em;
font-size: 1.2em;
text-align: center;
line-height: 48px;
border-bottom: 2px solid rgba(255, 255, 255, 0);
transition: border-bottom .3s ease;
}
@media screen and (max-width: 50rem) {
.split, .split > * {
display: block;
nav a:hover {
border-bottom: 2px solid rgba(255, 255, 255, 1);
transition: border-bottom .3s ease;
}
img.float-right {
display: none;
nav a.active {
border-bottom: 2px solid rgba(255, 255, 255, 1);
transition: none;
}
nav li {
margin: auto .5em;
}
header {
font-size: 2em;
nav .login {
position: fixed;
top: 0;
right: 0;
height: 48px;
padding: 0 1em;
}
main {
margin: -13rem auto 0 auto;
}
article {
margin: 0 .5rem 0 .5rem;
}
main:before {
left: .5rem;
right: .5rem;
}
}
@media screen and (max-width: 23rem) {
body {
font-size: 0.8em;
}
header {
margin-top: 2.4rem;
}
main:before {
top: 13rem;
height: 13em;
}
padding: 1em 15vw;
height: 100vh;
margin-top: 5vh;
background-color: #fff;
}
.collapsable {
display: none;
}
.collapsable:target {
display: block;
main h2 {
color: #002244;
}
.noselect {
/* iOS Safari */
-webkit-touch-callout: none;
/* Safari */
-webkit-user-select: none;
/* Konqueror HTML */
-khtml-user-select: none;
/* Firefox */
-moz-user-select: none;
/* Internet Explorer/Edge */
-ms-user-select: none;
/* Non-prefixed version, currently supported by Chrome and Opera */
user-select: none;
.btn {
padding: .5em;
border-radius: 4px;
text-decoration: none;
color: #fff;
background-color: #002244;
transition: background-color .2s ease;
}
.btn:hover {
background-color: #00407F;
transition: background-color .2s ease;
}

View File

@ -14,32 +14,41 @@ $agenda = new \pvv\side\Agenda([
new \pvv\side\DBActivity($pdo),
]);
?>
<!DOCTYPE html>
<html lang="no">
<head>
<title>Programvareverkstedet</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/splash.css">
<link rel="stylesheet" href="css/landing.css">
</head>
<header>Program&shy;vare&shy;verk&shy;stedet</header>
<body>
<nav>
<?php echo navbar(0, ''); ?>
<?php echo loginbar(); ?>
</nav>
<header>
<img src="css/pvv-background.png"/>
<h2>Velkommen til Programvareverkstedet</h2>
</header>
<main>
<article class="threed">
<img src="pvv-logo.png" class="float-right">
<div class="intro">
<h2>Velkommen til Program&shy;vare&shy;verk&shy;stedet</h2>
<p>Programvareverkstedet (PVV) vil skape et miljø for datainteresserte personer tilknyttet universitetet. Nåværende og tidligere studenter ved NTNU, samt ansatte ved NTNU og tilstøtende miljø, kan bli medlemmer. </p>
<p>
<a class="btn" href="om/">Om PVV</a>
<a class="btn" href="paamelding/">Bli medlem</a>
<a class="btn" href="https://use.mazemap.com/?v=1&amp;left=10.4032&amp;right=10.4044&amp;top=63.4178&amp;bottom=63.4172&amp;campusid=1&amp;zlevel=2&amp;sharepoitype=point&amp;sharepoi=10.40355%2C63.41755%2C2&amp;utm_medium=longurl">Veibeskrivelse</a>
</p>
</article>
<p>Programvareverkstedet (PVV) er en studentorganisasjon ved NTNU som vil skape et miljø for datainteresserte personer tilknyttet universitetet. Nåværende og tidligere studenter ved NTNU, samt ansatte ved NTNU og tilstøtende miljø, kan bli medlemmer.</p>
<ul class="essentials">
<a class="btn" href="om/"><li>Om PVV</li></a>
<a class="btn join" href="paamelding/"><li>Bli medlem</li></a>
<a class="btn" href="https://use.mazemap.com/?v=1&amp;left=10.4032&amp;right=10.4044&amp;top=63.4178&amp;bottom=63.4172&amp;campusid=1&amp;zlevel=2&amp;sharepoitype=point&amp;sharepoi=10.40355%2C63.41755%2C2&amp;utm_medium=longurl"><li>Veibeskrivelse</li></a>
</ul>
</div>
<div class="split">
<article>
<h2>Kommende arrangement</h2>
<ul class="calendar-events">
<?php $counter1 = 0; ?>
@ -66,11 +75,11 @@ $agenda = new \pvv\side\Agenda([
</li>
<?php } ?>
</ul>
</li>
<?php } ?>
</ul>
<p><a class="btn" href="kalender/">Flere aktiviteter</a></p>
</article>
<article>
<h2>Opptak</h2>
<p>
Alle med tilknytning til NTNU kan bli medlem hos oss
@ -86,12 +95,6 @@ For å bli med i våre prosjekter og komitéer må du søke.
<a class="btn" href="prosjekt/">Søk komité</a>
-->
</p>
</article>
</div>
</main>
<nav>
<?php echo navbar(0, ''); ?>
<?php echo loginbar(); ?>
</nav>
</body>
</html>