From cbcda35161685d6d4231ea7a75dbde517cf5d472 Mon Sep 17 00:00:00 2001 From: Yamozha Date: Mon, 8 Feb 2021 23:30:16 +0200 Subject: [PATCH] idk what happened but this is the static files eureka moment commit --- website/home/admin.py | 3 ++ website/home/apps.py | 5 ++ website/home/models.py | 3 ++ website/home/static/css/style.css | 68 ++++++++++++++++++++++++++++ website/home/templates/home.html | 23 ++++++++++ website/home/templates/underline.svg | 8 ++++ website/home/tests.py | 3 ++ website/home/views.py | 10 ++++ 8 files changed, 123 insertions(+) create mode 100644 website/home/admin.py create mode 100644 website/home/apps.py create mode 100644 website/home/models.py create mode 100644 website/home/static/css/style.css create mode 100644 website/home/templates/home.html create mode 100644 website/home/templates/underline.svg create mode 100644 website/home/tests.py create mode 100644 website/home/views.py diff --git a/website/home/admin.py b/website/home/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/website/home/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/website/home/apps.py b/website/home/apps.py new file mode 100644 index 00000000..90dc7137 --- /dev/null +++ b/website/home/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class HomeConfig(AppConfig): + name = 'home' diff --git a/website/home/models.py b/website/home/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/website/home/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/website/home/static/css/style.css b/website/home/static/css/style.css new file mode 100644 index 00000000..21bbb5dc --- /dev/null +++ b/website/home/static/css/style.css @@ -0,0 +1,68 @@ +@import url(https://fonts.googleapis.com/css?family=Roboto:300); + +:root { + --base-grid: 8px; + --colour-white: #fff; + --colour-black: #1a1a1a; +} +@viewport { + width: device-width ; + zoom: 1.0 ; +} + +*, +:after, +:before { + box-sizing: border-box; +} + +html { + margin: 0; + padding: 0; + background-position: 100%; +} + +body { + position: absolute; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + top: 50%; + font-size: 1.2em; + font-family: 'Roboto', sans-serif; + line-height: 1.4; + +} + +strong { + position: relative; + + &::after { + content: ''; + position: absolute; + bottom: -0.125rem; + left: -0.5rem; + right: -0.5rem; + height: 0.75rem; + + + background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/664131/underline.svg'); + background-repeat: no-repeat; + + background-size: cover; + } +} + +p > strong { + font-weight: 400; + + &::after { + // Specific positioning for smaller text + bottom: -0.2rem; + height: 0.5rem; + left: -0.25rem; + right: -0.25rem; + } +} + + diff --git a/website/home/templates/home.html b/website/home/templates/home.html new file mode 100644 index 00000000..24feec72 --- /dev/null +++ b/website/home/templates/home.html @@ -0,0 +1,23 @@ + + + + + {% load static %} + + + Home + + + + + + + + {% block content %} + {% endblock %} +{% csrf_token %} + +

Test!

+

{{ currencyTotal }}

+ + diff --git a/website/home/templates/underline.svg b/website/home/templates/underline.svg new file mode 100644 index 00000000..7bbe7581 --- /dev/null +++ b/website/home/templates/underline.svg @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/website/home/tests.py b/website/home/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/website/home/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/website/home/views.py b/website/home/views.py new file mode 100644 index 00000000..0558d1d8 --- /dev/null +++ b/website/home/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render +import os.path + +def homePage(request): + currencyTotal = open(os.path.dirname(__file__) + "/../currency.txt","r") + currencyTotal = currencyTotal.readline() + context = { + "currencyTotal" : currencyTotal + } + return render(request, "home.html", context)