Skip to content

Commit

Permalink
env test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaTerenz committed Feb 19, 2024
1 parent b4c29bf commit fa96f6e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 235 deletions.
3 changes: 3 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from dataclasses import dataclass
from datetime import date

Expand Down Expand Up @@ -64,6 +65,8 @@ def index():

age = calculateAge(date(1999, 10, 30))

age = os.environ["TEST"]

return flask.render_template("better-index.html",
age=age,
share_socials=share_socials,
Expand Down
24 changes: 0 additions & 24 deletions static/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,11 @@ String.prototype.capitalize = function () {
return this.charAt(0).toUpperCase() + this.slice(1);
}

function cloneTemplate(t) {
let templ = undefined

if (typeof (t) === "string")
templ = document.querySelector(`#${t}`)
else if (typeof (t) === "object")
templ = t
else
return templ

return templ.content.firstElementChild.cloneNode(true)
}

function copyURLToClipboard() {
/* Copy the text inside the text field */
navigator.clipboard.writeText("www.terenz.dev");
}

function getAge(yy, mm, dd) {
let today = new Date();
let birthDate = new Date(yy, mm - 1, dd);
let age = today.getFullYear() - birthDate.getFullYear();
let m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
return age;
}

function repeatInterval(callback, delay, interval, repeats, callback_end) {
setTimeout(() => {
let i = 0
Expand Down
7 changes: 4 additions & 3 deletions templates/better-index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set PARAGRAPH_CLASSES = "py-3 px-0 px-sm-3 mx-auto mx-md-5" %}
{% set FAVICON = url_for('static', filename='icons/favicon2.svg') %}

<!DOCTYPE html>
<html lang="en">
Expand All @@ -8,7 +9,7 @@
<meta content="black" media="(prefers-color-scheme: dark)" name="theme-color">
<meta content="width=device-width, initial-scale=1" name="viewport">

<link href="{{ url_for('static', filename='icons/favicon2.svg') }}" rel="icon" type="image/svg">
<link href="{{ FAVICON }}" rel="icon" type="image/svg">

<!--Bootstrap-->
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
Expand Down Expand Up @@ -43,8 +44,8 @@
<body id="index-body">
<nav class="autohide-nav navbar navbar-expand-md navbar-dark bg-dark fixed-top border-bottom border-2 border-white shadow">
<div class="container-fluid">
<a class="navbar-brand me-2 ms-1" href="index.html">
<img class="py-auto" height="30" src="../static/icons/favicon2.svg" width="30">
<a class="navbar-brand me-2 ms-1" href="{{ url_for(request.endpoint) }}">
<img class="py-auto" height="30" src="{{ FAVICON }}" width="30">
</a>
<button aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation"
class="navbar-toggler"
Expand Down
208 changes: 0 additions & 208 deletions templates/index.html

This file was deleted.

0 comments on commit fa96f6e

Please sign in to comment.