Browse Source

fix style favicon. add some plugs

pull/5/head
Igor Elpin 3 years ago
parent
commit
d17d0e5553
  1. 11
      app.py
  2. 1
      cv.py
  3. 3
      employee/__init__.py
  4. BIN
      employee/__pycache__/__init__.cpython-310.pyc
  5. BIN
      static/favicon.png
  6. 45
      templates/cv.html
  7. 73
      templates/index.html
  8. 8
      templates/pycoral.html
  9. 26
      templates/resume.html

11
app.py

@ -3,6 +3,7 @@ from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
import os
def get_application():
_app = FastAPI(debug=False,title="MyHome",docs_url=None,redoc_url=None)
@ -21,15 +22,19 @@ app=get_application()
app.mount("/static",StaticFiles(directory="static"),name="static")
templates = Jinja2Templates(directory="templates")\
## TODO Сделать полноценный микроблок
## TODO Сделать полноценный микроблог
@app.get("/")
def index(request:Request):
return templates.TemplateResponse("index.html",{"request":request})
@app.get("/resume")
## TODO Сделать вывод через вебсокет
@app.get("/cv")
def resume(request:Request):
with open("cv.py") as cv:
return templates.TemplateResponse("resume.html",{"request":request,"cv":cv.read()})
code_result=os.popen("python3 cv.py").read()
return templates.TemplateResponse("cv.html",{"request":request,
"cv":cv.read(),
"code_result":code_result})
@app.get("/pycoral")
def index(request:Request):

1
cv.py

@ -1,4 +1,3 @@
"""
Шуточное кодовое представление моего резюме. Enjoy!
"""

3
employee/__init__.py

@ -20,7 +20,8 @@ class Employee(AbstractHuman):
@property
def summary(self):
return "\n".join(self.expirience)
return "\n".join(reversed(self.expirience))
def represent(self) -> None:
self.say(self.about())
self.say(self.summary) if self.summary else self.say("Немного занят, отвечу позднее.")

BIN
employee/__pycache__/__init__.cpython-310.pyc

Binary file not shown.

BIN
static/favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

45
templates/cv.html

@ -0,0 +1,45 @@
<html>
<head>
<title>Логово Игоря</title>
<link rel="stylesheet" href="{{ url_for('static', path='/prism.css') }}" rel="stylesheet">
<script src="{{ url_for('static', path='/prism.js')}}"></script>
<link href="https://unpkg.com/nes.css@2.3.0/css/nes.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
</head>
<body style="background-color: #212529">
<div class="nes-container with-title" style="background-color: #212529">
<div class="nes-balloon from-right is-dark"
<h1 style="color: #00aa00 ;">Wake up,HR... Follow the white rabbit... </h1>
</div>
<div class="about">
<img src="/static/rabbit.png">
<a href="/" class="nes-btn is-success ">Другие поделки</a>
<a href="tg://resolve?domain=@ElpinOfficial" class="nes-btn is-primary">Мой Телеграм: @ElpinOfficial </a>
</div>  
<table class="is-centered" style="width:100%">
<tr>
<div class="nes-text is-success">cv.py
<a href="git://git@ielpin.ru:ElpinPublic/resume_lulz.git" class="nes-text is-success is-small">Knock-knock,Neo...</a>
</div>
</tr>
<tr>
<td style="vertical-align: top;padding: 5px;width:50%">
<pre style="font-size: 15px">
<code class="language-python">
{{cv}}
</code>
</pre>
</td>
<td style="vertical-align: top;padding: 5px;width:50%">
<pre style="font-size: 15px">
<code class="language-python">
{{code_result}}
</code>
</pre>
</td>
</tr>
</tr>
</table>
</div>
</body>
</html>

73
templates/index.html

@ -2,12 +2,12 @@
<head>
<title>Логово Игоря</title>
<link rel="stylesheet" href="{{ url_for('static', path='/prism.css') }}" rel="stylesheet">
<link id="favicon" rel="icon" type="image/x-icon" href={{ url_for('static', path='/favicon.png') }}>
<script src="{{ url_for('static', path='/prism.js')}}"></script>
<link href="https://unpkg.com/nes.css@2.3.0/css/nes.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
</head>
<body style="background-color: #000000">
<body style="background-color: #212529">
<header class>
<div class="container" >
<div class="nav-brand">
@ -25,19 +25,66 @@
<img src="/static/rabbit.png">
<a href="/" class="nes-btn is-success ">Главная</a>
<a href="tg://resolve?domain=@ElpinOfficial" class="nes-btn is-primary">Мой Телеграм: @ElpinOfficial </a>
<a href="https://github.com/teleigran" class="nes-btn is-warning "><i class="nes-icon github is-medium"></i> GitHub</a>
<a href="https://github.com/teleigran" class="nes-btn is-warning "><i class="nes-icon github is-small"></i> GitHub</a>
<i>Rendered by <b>FastApi</b></i>
</div>  
<pre title="projects.py">
<code class="language-python">
def show_my_projects():
return [project for project in projects if project.sense is not None]
</code>
<a href="/resume" class="nes-btn is-primary"><i class="nes-icon github is-small"></i><b> `>>> class project <span style="color:#ac0909 ;">Resume</span>`</span>`</b></a>
<a href="/pycoral" class="nes-btn is-primary"><i class="nes-icon github is-small"></i><b> `>>> class project<span style="color:#ac0909 ;"> PYCORAL_CCTV</span>`</b></a>
</pre>
<table>
<tr>
<td>
<pre style="text-align: left; vertical-align: top;padding: 5px;height:100%;width:100%">
<!-- TODO Rewrite with REAL code as in main /cv-->
<code class="language-python">
from humans import Sex
from employee.applicants import Applicant
me = Applicant( first_name="Игорь",
last_name="Ельпин",
sex=Sex.MALE,
birthday="16-11-1989")
me.say(me.about())
me.say(me.hard_skills())
</code>
</pre>
</td>
<td>
<div class="nes-balloon from-right is-dark">
<p>Игорь Ельпин(говорит):
Игорь Ельпин. Мужчина 1989-11-16 (33 полных лет)
</p>
</div>
<div class="nes-balloon from-right is-dark">
<p>Игорь Ельпин(говорит):</p>
<div class="nes-container is-dark with-title">
<p class="title">Hard Skill: Linux = 85% </p>
<progress class="nes-progress is-success" value="85" max="100"></progress>
</div>
<div class="nes-container is-dark with-title">
<p class="title">Hard Skill: Docker = 55%</p>
<progress class="nes-progress is-primary" value="55" max="100"></progress>
</div>
<div class="nes-container is-dark with-title">
<p class="title">Hard Skill: Python = 35%</p>
<progress class="nes-progress is-warning" value="35" max="100"></progress>
</div>
</div>
</td>
</tr>
<tr>
<td>
<pre title="projects.py" style="vertical-align: top;padding: 5px;height:100%;width:100%">
<code class="language-python">
def show_my_projects():
return [project for project in projects if project.sense is not None]
</code>
</pre>
<td>
<a href="/cv" class="nes-btn is-primary"><i class="nes-icon github is-small"></i><b> `>>> class project <span style="color:#ac0909 ;">Resume</span>`</span>`</b></a>
<a href="/pycoral" class="nes-btn is-primary"><i class="nes-icon github is-small"></i><b> `>>> class project<span style="color:#ac0909 ;"> PYCORAL_CCTV</span>`</b></a>
</td>
</tr>
</table>
</div>
</body>
</html>

8
templates/pycoral.html

@ -6,15 +6,15 @@
<link href="https://unpkg.com/nes.css@2.3.0/css/nes.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
</head>
<body style="background-color: #000000">
<div class="nes-container with-title" style="background-color: #000000">
<body style="background-color: #212529">
<div class="nes-container with-title" style="background-color: #212529">
<div class="nes-balloon from-right is-dark"
<h1 style="color: #00ff00 ;">(Google Coral + RPi 4)*RTSPCam = CCTV?</h1>
<h1 style="color: #00aa00 ;">(Google Coral + RPi 4)*RTSPCam = CCTV?</h1>
</div>
<div class="about">
<img src="/static/rabbit.png">
<a href="/" class="nes-btn is-success ">Другие поделки</a>
<a href="tg://resolve?domain=@iElpin" class="nes-btn is-primary">Мой Телеграм: @iElpin </a>
<a href="tg://resolve?domain=@ElpinOfficial" class="nes-btn is-primary">Мой Телеграм: @ElpinOfficial </a>
</div>  
<pre title="cv.py" style="font-size: 20px">
<code class="language-python">

26
templates/resume.html

@ -1,26 +0,0 @@
<html>
<head>
<title>Логово Игоря</title>
<link rel="stylesheet" href="{{ url_for('static', path='/prism.css') }}" rel="stylesheet">
<script src="{{ url_for('static', path='/prism.js')}}"></script>
<link href="https://unpkg.com/nes.css@2.3.0/css/nes.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
</head>
<body style="background-color: #000000">
<div class="nes-container with-title" style="background-color: #000000">
<div class="nes-balloon from-right is-dark"
<h1 style="color: #00ff00 ;">Wake up,HR... Follow the white rabbit... </h1>
</div>
<div class="about">
<img src="/static/rabbit.png">
<a href="/" class="nes-btn is-success ">Другие поделки</a>
<a href="tg://resolve?domain=@iElpin" class="nes-btn is-primary">Мой Телеграм: @iElpin </a>
</div>  
<pre title="cv.py" style="font-size: 20px">
<code class="language-python">
{{cv}}
</code>
</pre>
</div>
</body>
</html>
Loading…
Cancel
Save