From 0ad696d333958c085c79272a83e9ff07a85501de Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 14 Nov 2023 16:05:56 +0800 Subject: [PATCH] feat: add code animation Signed-off-by: Frost Ming --- assets/static/custom.css | 30 +++++++++++------ templates/home.html | 70 ++++++++++++++++++++++++++++++++++++++-- templates/layout.html | 2 ++ 3 files changed, 91 insertions(+), 11 deletions(-) diff --git a/assets/static/custom.css b/assets/static/custom.css index 7bd1315..a6ec3d7 100644 --- a/assets/static/custom.css +++ b/assets/static/custom.css @@ -1,8 +1,3 @@ -@font-face { - font-family: Bitmap; - src: url('./fonts/DinkieBitmap-9px.woff2') format('woff2'); -} - .text-shadow { text-shadow: -1px -1px 0 #ffbb06, 1px -1px 0 #ffbb06, -1px 1px 0 #ffbb06, 1px 1px 0 #ffbb06; } @@ -10,10 +5,6 @@ text-shadow: -1px -1px 0 #ffbb06, 1px -1px 0 #ffbb06, -1px 1px 0 #ffbb06, 1px 1px 0 #ffbb06; } -.font-bitmap { - font-family: Bitmap, sans-serif; -} - .menu { position: relative; } @@ -34,3 +25,24 @@ body { background-repeat: repeat; background-size: 2rem; } + +/* Blinking cursor */ +#code:after{ + content: "|"; + animation: blink 500ms linear infinite alternate; +} + +@-webkit-keyframes blink{ + 0%{opacity: 0;} + 100%{opacity: 1;} +} + +@-moz-keyframes blink{ + 0%{opacity: 0;} + 100%{opacity: 1;} +} + +@keyframes blink{ + 0%{opacity: 0;} + 100%{opacity: 1;} +} diff --git a/templates/home.html b/templates/home.html index dc05ba2..a7a089c 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,5 +1,19 @@ -{% extends "layout.html" %} {% block title %}{{ this.title }}{% endblock %} {% block body %} +{% extends "layout.html" %} +{% block title %}{{ this.title }}{% endblock %} +{% block head %} + + + +{% endblock %} +{% block body %}
PyConChina 2023
+
+import openai
+
+openai.chat.completions.create(messages=[
+    {"role": "assistant", "message": "Welcome to PyCon China 2023!"},
+])
+
{% for city in this.children.filter(F._model == 'city') %} {{ city.title }} @@ -10,4 +24,56 @@

{{item.title}}

{{item.body}}
-{% endfor %} {% endblock %} +{% endfor %} +{% endblock %} +{% block scripts %} + +{% endblock %} diff --git a/templates/layout.html b/templates/layout.html index 825a2f6..d2330e8 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -8,6 +8,7 @@ {% block title %}Welcome{% endblock %} | PyConChina 2023 + {% block head %}{% endblock %}
@@ -15,5 +16,6 @@
{% block body %}{% endblock %}
{% include "components/footer.html" %}
+ {% block scripts %}{% endblock %}