summaryrefslogtreecommitdiff
path: root/templates/partials/code/textarea.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/partials/code/textarea.html')
-rw-r--r--templates/partials/code/textarea.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/templates/partials/code/textarea.html b/templates/partials/code/textarea.html
new file mode 100644
index 0000000..a13ba69
--- /dev/null
+++ b/templates/partials/code/textarea.html
@@ -0,0 +1,34 @@
+
+<textarea id="code" name="code" class="w-full">
+from base64 import b64decode
+from datetime import datetime
+from time import sleep
+
+# Внимание, пасхалка !
+# Выполни код что бы увидеть расшифрованное сообщение
+b64message = '0K3RgtC+0YIg0LrQvtC0LCDQsdGL0Lsg0LLRi9C/0L7Qu9C90LXQvSwg0L3QsCDQsdC10LrQtdC90LTQtS4='
+
+def decode_message(b64message: str):
+ sleep(.5) # Удали эту строку если жалко пол секунды
+ return b64decode(b64message.encode()).decode('utf-8')
+
+start_time = datetime.now()
+print(f'Время начала: {start_time}')
+print(decode_message(b64message))
+print(f'Время выполнения: {(datetime.now() - start_time)}')
+</textarea>
+
+<script>
+ document.addEventListener("DOMContentLoaded", function () {
+ document.codeEditor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ value: "blah",
+ lineNumbers: true,
+ mode: "python",
+ theme: "default", // Вы можете изменить тему на любую другую из доступных в CodeMirror
+ indentUnit: 4,
+ matchBrackets: true,
+ });
+ document.codeEditor.setSize('100%','100%')
+ });
+
+</script>