Layout be less bad

This commit is contained in:
Midgard 2020-07-22 14:06:16 +02:00
parent ce46a6ecae
commit 2f50efb5d4
Signed by: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 50 additions and 73 deletions

View file

@ -6,6 +6,12 @@
<title>{% block title %}Zeus WPI Kelderregistratiesysteem™{% endblock %}</title> <title>{% block title %}Zeus WPI Kelderregistratiesysteem™{% endblock %}</title>
{% block styles %}{% endblock %} {% block styles %}{% endblock %}
<style> <style>
body {
background: #141313;
color: #999;
margin: 0;
}
nav { nav {
width: 100vw; width: 100vw;
background-color: #ff8000; background-color: #ff8000;
@ -14,91 +20,83 @@
padding-bottom: 1em; padding-bottom: 1em;
} }
body {
margin: 0;
}
nav ul { nav ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
/*this option by default dispose the elements in a row (flex-direction: row)*/
display: flex;
} }
nav li { nav li {
list-style-type: none; list-style-type: none;
display: inline-block;
margin: 0 2vw; margin: 0 2vw;
/* our font-size will be 3% of the height of the viewport */ /* 3% of the height of the viewport */
font-size: 3vh; font-size: 3vh;
} }
nav a { nav a {
text-decoration: none; text-decoration: none;
/*below I changed the color*/
color: black; color: black;
/*I added some padding*/
padding: 2vw; padding: 2vw;
/*also changed the font family but that's totally irrelevant*/
font-family: monospace; font-family: monospace;
} }
nav a:hover { nav a:hover, nav a:focus, nav button:hover, nav buttton:focus {
background-color: rgba(255, 128, 0, 0.53); background-color: rgba(255, 255, 255, 0.5);
}
button {
display: none;
} }
/*change the layout of the navigation bar for all the screens /*change the layout of the navigation bar for all the screens
that have a width less or equal than 500px*/ that have a width less or equal than 500px*/
@media only screen and (max-width: 750px) { @media only screen and (max-width: 750px) {
/*shows elements in a column*/ nav li {
ul { display: block;
flex-direction: column;
}
/* deletes margin on top or bottom of the a tag*/
li {
margin: 0; margin: 0;
} }
/* makes sure that the a tag will take the entire screen*/ nav a {
a {
display: block; display: block;
} }
button { button {
/*makes the button visible*/
display: block; display: block;
/*since we are here, we can style it a little bit!*/
padding: 2vw; padding: 2vw;
font-size: 3vh; font-size: 3vh;
background-color: #AFE0FF; background-color: #ff8000;
border: none; border: none;
/*outline none removes the default blue border that appears anytime you click on the button*/
outline: none;
cursor: pointer; cursor: pointer;
/*this put the button on the left*/
align-self: flex-start;
} }
} }
button { main {
display: none; margin: auto;
width: 50%;
padding: 10px;
}
input {
width: 100%;
}
input[type=text] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
} }
</style> </style>
</head> </head>
<body> <body>
<nav> <nav>
<button id="nav-button"></button>
<ul> <ul>
<button id="nav-button">🞬</button>
<li> <li>
<a href="{% url 'events:index' %}"> <a href="{% url 'events:index' %}">
Home</a> Home</a>
@ -111,8 +109,9 @@
</ul> </ul>
</nav> </nav>
<h1>Zeus WPI Kelderregistratiesysteem™</h1> <h1>Zeus WPI Kelderregistratiesysteem™</h1>
<main>
{% block content %}{% endblock %} {% block content %}{% endblock %}
</body> </main>
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
let button = document.getElementById('nav-button') let button = document.getElementById('nav-button')
@ -125,4 +124,5 @@
}) })
}); });
</script> </script>
</body>
</html> </html>

View file

@ -2,42 +2,19 @@
{% block title %}KeRS - Profile{% endblock %} {% block title %}KeRS - Profile{% endblock %}
{% block styles %}
<style>
.container {
margin: auto;
width: 50%;
padding: 10px;
}
input {
width: 100%;
}
input[type=text] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
}
</style>
{% endblock %}
{% block content %} {% block content %}
<div class="container"> <h1>Profile</h1>
<h1>Profile</h1> {% if user.is_authenticated %}
{% if user.is_authenticated %} <p>Username: {{ username }}</p>
<p>Username: {{ username }}</p> <label>Student number</label>
<label>Student number</label> <input type="text" value="{{ user.student_number }}"/>
<input type="text" value="{{ user.student_number }}"/> <label>Real name</label>
<label>Real name</label> <input type="text" value="{{ user.real_name }}">
<input type="text" value="{{ user.real_name }}"> <input type="submit" value="Save"/>
<input type="submit" value="Save"/> <a href="/user/logout">Logout</a>
<a href="/user/logout">Logout</a> {% else %}
{% else %} <p>Not logged in</p>
<p>Not logged in</p> <a href="/login/zeus/register">Login</a>
<a href="/login/zeus/register">Login</a> {% endif %}
{% endif %}
</div>
{% endblock %} {% endblock %}