From 30a21270e3d67a1bbdc41af27d275b7e1f2b8286 Mon Sep 17 00:00:00 2001 From: thematdev Date: Sat, 7 Nov 2020 15:10:52 +0300 Subject: [PATCH] Added projects section --- config/json/projects.json | 20 +++++++ main.py | 23 ++++++-- static/assets/css/style.css | 75 +++++++++++++++++++++++++-- static/assets/images/chatmanager.png | Bin 0 -> 3426 bytes static/assets/images/soon.jpg | Bin 0 -> 4821 bytes static/assets/images/thissite.png | Bin 0 -> 778 bytes static/js/projects.js | 13 +++++ templates/index.html | 21 +++++++- templates/texindex.html | 11 ++-- 9 files changed, 148 insertions(+), 15 deletions(-) create mode 100644 config/json/projects.json create mode 100644 static/assets/images/chatmanager.png create mode 100644 static/assets/images/soon.jpg create mode 100644 static/assets/images/thissite.png create mode 100644 static/js/projects.js diff --git a/config/json/projects.json b/config/json/projects.json new file mode 100644 index 0000000..c46f3bb --- /dev/null +++ b/config/json/projects.json @@ -0,0 +1,20 @@ +{ + "cols": 3, + "projects" : [ + { + "title": "Этот сайт", + "description": "Текст", + "image": "images/thissite.png" + }, + { + "title": "ChatManager", + "description": "Плагин для работы с чатом в Minecraft.", + "image": "images/chatmanager.png" + }, + { + "title": "Скоро, совсем скоро, текст", + "description": "Скоро", + "image": "images/soon.jpg" + } + ] +} diff --git a/main.py b/main.py index c6f5592..525067a 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,10 @@ -import flask +from flask import Flask, url_for, render_template import os +import json import numpy.random as gaussian_rnd -app = flask.Flask(__name__, subdomain_matching=True) +app = Flask(__name__, subdomain_matching=True) app.config['SERVER_NAME'] = 'thematdev.local:22837' @@ -22,17 +23,29 @@ def dated_url_for(endpoint, **values): if filename: file_path = os.path.join(app.root_path, endpoint, filename) values['q'] = int(os.stat(file_path).st_mtime) - return flask.url_for(endpoint, **values) + return url_for(endpoint, **values) @app.route('/') def index(): - return flask.render_template('index.html', random_number=generate_iq()) + with open('config/json/projects.json') as file: + data = json.loads(file.read()) + cols = data['cols'] + projects = data['projects'] + length = len(projects) + rows = [] + for i in range(0, length, cols): + row = [] + for j in range(i, min(i + cols, length)): + row.append(projects[j]) + rows.append(row) + + return render_template('index.html', random_number=generate_iq(), rows=rows) @app.route('/', subdomain='tex') def texindex(): - return "Fuck you, leatherman!" + return render_template('texindex.html') def main(): diff --git a/static/assets/css/style.css b/static/assets/css/style.css index 74cdafd..9c60239 100644 --- a/static/assets/css/style.css +++ b/static/assets/css/style.css @@ -21,12 +21,12 @@ body { .pagehead-inner { position: inherit; margin: 0; - width: 456px; - height: 600px; + width: 24%; + height: 55vh; top: 50%; left: 50%; - margin-left: -228px; - margin-top: -300px; + margin-left: -12%; + margin-top: -27vh; display: flex; align-items: center; justify-content: center; @@ -53,6 +53,8 @@ body { background: #222; color: white; border-radius: 15px; + border: none; + outline: none; } .btn-container button:hover { @@ -62,6 +64,11 @@ body { color: green; } +.btn-container button:active { + transform: scale(0.8); + -webkit-transition: transform 0.2s ease-in-out; +} + .mainh { color: white; font-family: "Overpass Mono", monospace; @@ -69,4 +76,64 @@ body { margin: 0; } +.pagebody { + width: 100%; + height: 100vh; + position: relative; + background: #222; + display: flex; + flex-direction: column; + margin: 0; +} + +.pagebody-inner-section { + margin-top: 100px; margin-left: 300px; +} + +.pagebody-inner-section > h1 { + color: white; + font-family: "Overpass Mono", monospace; + font-weight: 700; +} + +.project-container { + position: inherit; + display: flex; + flex-direction: column; +} + +.project-container-row { + display: flex; + position: inherit; + flex-direction: row; +} + +.project-element { + position: inherit; + width: 300px; + margin-right: 70px; + display: flex; + flex-direction: column; +} + +.project-element > h1 { + color: white; + font-family: "Overpass Mono", monospace; + font-weight: 700; + margin: 0; +} + +.project-element > p { + color: white; + font-family: "Overpass Mono", monospace; + font-weight: 400; + margin: 0; +} + +.project-element > img { + background: #222; + margin-top: 20px; + margin-bottom: 20px; +} + . diff --git a/static/assets/images/chatmanager.png b/static/assets/images/chatmanager.png new file mode 100644 index 0000000000000000000000000000000000000000..c8a49a376a787bbbf77c035b6991ea81a07b6e05 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.style.height = maxHeight + 'px' + ) + console.log(maxHeight); +} + +var table = document.getElementById("pbic"); +alignHeadersByHeight(table); diff --git a/templates/index.html b/templates/index.html index 1aa7ebe..048658a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -24,6 +24,25 @@ +
+
+

Мои проекты

+
+ {% for row in rows %} +
+ {% for project in row %} +
+

{{ project.title }}

+ +

{{ project.description }}

+
+ {% endfor %} +
+ {% endfor %} +
+
+
+ + Идея про Гауссово распределение вместо обычного рандома: Prentor и pavel_the_best - Идея про Гауссово распределение вместо обычного рандома: Prentor и pavel_the_best diff --git a/templates/texindex.html b/templates/texindex.html index d9eaacd..db32f0d 100644 --- a/templates/texindex.html +++ b/templates/texindex.html @@ -1,8 +1,9 @@ - - - - - + + + +

Fuck you, leatherman!

+ Hey buddy, i think you got the wrong door the leather-club is two blocks down. +