CSS in static file

This commit is contained in:
Midgard 2020-07-22 17:16:04 +02:00
parent 033226a96f
commit 4a17d4b9c0
Signed by: midgard
GPG key ID: 511C112F1331BBB4
5 changed files with 158 additions and 153 deletions

View file

@ -124,6 +124,9 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
# Custom stuff
@ -140,4 +143,4 @@ OAUTH = {
'REDIRECT_URI': f'{SERVER_URL}/login/zeus/authorized',
'CLIENT_ID': 'tomtest',
'CLIENT_SECRET': 'blargh',
}
}

View file

@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}Events{% endblock %}
{% block content %}
<ul>
{% for x in events %}

148
static/main.css Normal file
View file

@ -0,0 +1,148 @@
body {
background: #141313;
color: #999;
margin: 0;
}
nav {
width: 100vw;
background-color: #ff8000;
margin-bottom: 1em;
padding-top: 1rem;
padding-bottom: 1em;
}
nav ul {
margin: 0;
padding: 0;
}
nav li {
list-style-type: none;
display: inline-block;
margin: 0 1.5vw;
/* 3% of the height of the viewport */
font-size: 2vh;
}
nav span {
padding: 2vw;
font-family: monospace;
}
nav a {
text-decoration: none;
color: black;
padding: 2vw;
font-family: monospace;
}
nav a:hover, nav a:focus, nav button:hover, nav buttton:focus {
background-color: rgba(255, 255, 255, 0.5);
}
button {
display: none;
}
/*change the layout of the navigation bar for all the screens
that have a width less or equal than 500px*/
@media only screen and (max-width: 750px) {
nav li {
display: block;
margin: 0;
}
nav a {
display: block;
}
button {
display: block;
padding: 2vw;
font-size: 3vh;
background-color: #ff8000;
border: none;
cursor: pointer;
}
}
main {
margin: auto;
width: 50%;
padding: 10px;
}
input {
width: 100%;
}
input[type=text] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
}
.alignLeft {
float: left;
}
.alignRight {
float: right;
}
.accentuated {
color: #66351d;
}
:root {
--white: #afafaf;
--soft-grey: #808080;
--red: #e31b23;
--bodyColor: #292a2b;
--borderFormEls: hsl(0, 0%, 10%);
--bgFormEls: hsl(0, 0%, 14%);
--bgFormElsFocus: hsl(0, 7%, 20%);
}
select,
input,
textarea,
button {
width: 100%;
line-height: 1.5;
padding: 15px 10px;
border: 1px solid var(--borderFormEls);
color: var(--white);
background: var(--bgFormEls);
transition: background-color 0.3s cubic-bezier(0.57, 0.21, 0.69, 1.25),
transform 0.3s cubic-bezier(0.57, 0.21, 0.69, 1.25);
}
textarea {
height: 170px;
}
::placeholder {
color: var(--soft-grey);
opacity: 0.8;
}
/* On focus styling */
select:focus,
input:focus,
textarea:focus,
button:focus {
background: var(--bgFormElsFocus);
}
select:focus,
input:focus,
textarea:focus {
transform: scale(1.02);
}

View file

@ -1,160 +1,12 @@
{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<title>{% block title %}Zeus WPI Kelderregistratiesysteem™{% endblock %}</title>
<title>{% block title %}{% endblock %} KeRS</title>
<link rel="stylesheet" type="text/css" href="{% static 'main.css' %}"/>
{% block styles %}{% endblock %}
<style>
body {
background: #141313;
color: #999;
margin: 0;
}
nav {
width: 100vw;
background-color: #ff8000;
margin-bottom: 1em;
padding-top: 1rem;
padding-bottom: 1em;
}
nav ul {
margin: 0;
padding: 0;
}
nav li {
list-style-type: none;
display: inline-block;
margin: 0 1.5vw;
/* 3% of the height of the viewport */
font-size: 2vh;
}
nav span {
padding: 2vw;
font-family: monospace;
}
nav a {
text-decoration: none;
color: black;
padding: 2vw;
font-family: monospace;
}
nav a:hover, nav a:focus, nav button:hover, nav buttton:focus {
background-color: rgba(255, 255, 255, 0.5);
}
button {
display: none;
}
/*change the layout of the navigation bar for all the screens
that have a width less or equal than 500px*/
@media only screen and (max-width: 750px) {
nav li {
display: block;
margin: 0;
}
nav a {
display: block;
}
button {
display: block;
padding: 2vw;
font-size: 3vh;
background-color: #ff8000;
border: none;
cursor: pointer;
}
}
main {
margin: auto;
width: 50%;
padding: 10px;
}
input {
width: 100%;
}
input[type=text] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
}
.alignLeft {
float: left;
}
.alignRight {
float: right;
}
.accentuated {
color: #66351d;
}
:root {
--white: #afafaf;
--soft-grey: #808080;
--red: #e31b23;
--bodyColor: #292a2b;
--borderFormEls: hsl(0, 0%, 10%);
--bgFormEls: hsl(0, 0%, 14%);
--bgFormElsFocus: hsl(0, 7%, 20%);
}
select,
input,
textarea,
button {
width: 100%;
line-height: 1.5;
padding: 15px 10px;
border: 1px solid var(--borderFormEls);
color: var(--white);
background: var(--bgFormEls);
transition: background-color 0.3s cubic-bezier(0.57, 0.21, 0.69, 1.25),
transform 0.3s cubic-bezier(0.57, 0.21, 0.69, 1.25);
}
textarea {
height: 170px;
}
::placeholder {
color: var(--soft-grey);
opacity: 0.8;
}
/* On focus styling */
select:focus,
input:focus,
textarea:focus,
button:focus {
background: var(--bgFormElsFocus);
}
select:focus,
input:focus,
textarea:focus {
transform: scale(1.02);
}
</style>
</head>
<body>

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block title %}KeRS - Profile{% endblock %}
{% block title %}Profile{% endblock %}
{% block content %}
<h1>Profile</h1>