diff options
author | Gregor Kikelj <gregor1234567890@gmail.com> | 2023-03-18 20:37:18 +0100 |
---|---|---|
committer | Gregor Kikelj <gregor1234567890@gmail.com> | 2023-03-18 22:00:36 +0100 |
commit | ef703bdf734c1c3da44eb3859d2c3d572e418fdb (patch) | |
tree | f086525d81523dd9fc9480799604ed91f6129db2 | |
parent | Public cleanup (diff) | |
download | eVinjeta-ef703bdf734c1c3da44eb3859d2c3d572e418fdb.tar eVinjeta-ef703bdf734c1c3da44eb3859d2c3d572e418fdb.tar.gz eVinjeta-ef703bdf734c1c3da44eb3859d2c3d572e418fdb.tar.bz2 eVinjeta-ef703bdf734c1c3da44eb3859d2c3d572e418fdb.tar.lz eVinjeta-ef703bdf734c1c3da44eb3859d2c3d572e418fdb.tar.xz eVinjeta-ef703bdf734c1c3da44eb3859d2c3d572e418fdb.tar.zst eVinjeta-ef703bdf734c1c3da44eb3859d2c3d572e418fdb.zip |
-rw-r--r-- | helpers.py | 46 | ||||
-rw-r--r-- | server.py | 118 | ||||
-rw-r--r-- | templates/index.html | 389 | ||||
-rw-r--r-- | templates/index_global.html | 234 |
4 files changed, 565 insertions, 222 deletions
@@ -3,6 +3,7 @@ import json from datetime import datetime, timezone, timedelta from functools import lru_cache + def formatEndDate(st): if st is None: return (None, None) @@ -26,30 +27,51 @@ def get_headers(): headers = {h[0]: h[1].strip() for h in hdump} return headers + +country_codes = { + "SI": "Slovenija", + "HR": "Hrvaška", + "AT": "Avstrija", + "HU": "Madžarska", + "IT": "Italija", + "DE": "Nemčija", + "RS": "Srbija", + "CH": "Švica", + "BA": "Bosna in Hercegovina", +} + + @lru_cache(maxsize=None) -def veljavnost(registrska: str): +def veljavnost(registrska: str, drzava: str): + print(registrska, drzava) today = datetime.now() one_year_after = today + timedelta(days=365) payload["registrationNumber"] = registrska payload["registrationNumberAgain"] = registrska payload["vignetteValidityStart"] = today.strftime("%Y-%m-%dT%H:%M:%S.%fZ") - payload["vignetteValidityEnd"] = one_year_after.strftime( - "%Y-%m-%dT%H:%M:%S.%f0%z") + payload["vignetteValidityEnd"] = one_year_after.strftime("%Y-%m-%dT%H:%M:%S.%f0%z") + payload["registrationCountryCode"] = { + "text": country_codes[drzava], + "value": drzava, + "codebook": "Country", + } + print("\n", payload, "\n------------------\n\n\n") r = requests.post(purl, json=payload, headers=get_headers(), verify=False) # print("\n"+r.text+"\n------------------\n\n\n") print(r.status_code, r.reason, r.url) return r.json() -def aux(registrska): - registrska = registrska.upper().replace(" ", "").replace("-", "").strip() - if len(registrska) > 8 or len(registrska) < 5 or not registrska.isalnum(): - return None - if registrska == "FTEST": - t = 1/0 - if registrska[:3] == "XXX": - return None - jdump = veljavnost(registrska)["vignetteValidationResult"] +def aux(registrska, drzava="SI"): + if drzava == "SI": + registrska = registrska.upper().replace(" ", "").replace("-", "").strip() + if len(registrska) > 8 or len(registrska) < 5 or not registrska.isalnum(): + return None + if registrska == "FTEST": + t = 1 / 0 + if registrska[:3] == "XXX": + return None + jdump = veljavnost(registrska, drzava)["vignetteValidationResult"] if "exemptedVehicles" in jdump and len(jdump["exemptedVehicles"]) > 0: return f'Oproščeno {jdump["exemptedVehicles"][0]["exemptionReasonId"]["text"]}' @@ -1,5 +1,4 @@ -from flask import Flask, jsonify, render_template, request, send_from_directory -import os +from flask import Flask, render_template, request, send_from_directory from helpers import aux from discord_webhook import DiscordWebhook import datetime @@ -8,36 +7,53 @@ from flask_limiter.util import get_remote_address import logging # Logs to both console and app.log file -logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s") -formatter = logging.Formatter("%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s") -logger = logging.getLogger('server') -handler = logging.FileHandler('app.log') +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s", +) +formatter = logging.Formatter( + "%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s" +) +logger = logging.getLogger("server") +handler = logging.FileHandler("app.log") handler.setFormatter(formatter) handler.setLevel(logging.INFO) logger.addHandler(handler) + def niceDateTime(): - time = datetime.datetime.now() - return time.strftime("%H:%M:%S -- %d/%m/%Y") + time = datetime.datetime.now() + return time.strftime("%H:%M:%S -- %d/%m/%Y") + + def niceTime(): - time = datetime.datetime.now() - return time.strftime("%H:%M:%S") + time = datetime.datetime.now() + return time.strftime("%H:%M:%S") -def spamDiscord(logs = ""): - content = f"@everyone, napaka na strani ob {niceDateTime()}: \n {logs}" - webhook = DiscordWebhook(url='https://discord.com/api/webhooks/1062432166950219838/tgl04gFFIMkrASeWX2AlETdsgdTHU3CWufzE1NZQMLQ2eZGVeQyGXj4AAt0k4Dj467B'+'d', content=content) - webhook.execute() + +def spamDiscord(logs=""): + content = f"@everyone, napaka na strani ob {niceDateTime()}: \n {logs}" + webhook = DiscordWebhook( + url="https://discord.com/api/webhooks/1062432166950219838/tgl04gFFIMkrASeWX2AlETdsgdTHU3CWufzE1NZQMLQ2eZGVeQyGXj4AAt0k4Dj467B" + + "d", + content=content, + ) + webhook.execute() def discordLog(msg): - DiscordWebhook(url="https://discord.com/api/webhooks/1062474351196262571/V6M_vfhPy9QEEbM-b1W7qxBr2k5olpyeOY1O2RoKZ178c0Fs9_vYzKqJwES3o3suLSF"+"o", content=msg).execute() + DiscordWebhook( + url="https://discord.com/api/webhooks/1062474351196262571/V6M_vfhPy9QEEbM-b1W7qxBr2k5olpyeOY1O2RoKZ178c0Fs9_vYzKqJwES3o3suLSF" + + "o", + content=msg, + ).execute() app = Flask(__name__, static_folder="static") limiter = Limiter( get_remote_address, app=app, - default_limits=["50 per minute"], + default_limits=["50 per minute"], storage_uri="memory://", ) @@ -49,34 +65,68 @@ def setHeaders(request): discordLog(f"Headers so bili spremenjeni ob {niceDateTime()}") return "OK" -@app.route('/favicon.ico') -@app.route('/robots.txt') -@app.route('/sitemap.xml') + +@app.route("/favicon.ico") +@app.route("/robots.txt") +@app.route("/sitemap.xml") def static_from_root(): return send_from_directory(app.static_folder, request.path[1:]) -@app.route('/', methods=['POST']) + +@app.route("/", methods=["POST"]) def apcall(): if "headers" in request.form: - setHeaders(request) - return "OK" + setHeaders(request) + return "OK" registrska = request.form["registrska"] try: - ar = aux(registrska) - app.logger.info(f"Registrska \"{registrska}\" je veljavna do {ar} ob {niceTime()}") - # discordLog(f"Registrska \"{registrska}\" je veljavna do {ar} ob {niceTime()}") - return render_template('index.html', valid_until = ar, license_plate = registrska) + ar = aux(registrska) + app.logger.info( + f'Registrska "{registrska}" je veljavna do {ar} ob {niceTime()}' + ) + # discordLog(f"Registrska \"{registrska}\" je veljavna do {ar} ob {niceTime()}") + return render_template("index.html", valid_until=ar, license_plate=registrska) except Exception as e: - spamDiscord(str(e)) - app.logger.error(f"\nNapaka pri {registrska} ob {niceTime()}") - # discordLog(f"!!!!!!!!!!!!!!!!!!!!!!!!!!!\nNapaka pri {registrska} ob {niceTime()}") - return render_template('failure.html') + spamDiscord(str(e)) + app.logger.error(f"\nNapaka pri {registrska} ob {niceTime()}") + # discordLog(f"!!!!!!!!!!!!!!!!!!!!!!!!!!!\nNapaka pri {registrska} ob {niceTime()}") + return render_template("failure.html") + -@app.route('/', methods=['GET']) +@app.route("/global", methods=["POST"]) +def apcall_global(): + print(request.form) + registrska = request.form["registrska"] + drzava = request.form["drzava"] + try: + ar = aux(registrska, drzava) + app.logger.info( + f'Registrska "{registrska}" je veljavna do {ar} ob {niceTime()}' + ) + # discordLog(f"Registrska \"{registrska}\" je veljavna do {ar} ob {niceTime()}") + return render_template( + "index_global.html", valid_until=ar, license_plate=registrska + ) + except Exception as e: + spamDiscord(str(e)) + app.logger.error(f"\nNapaka pri {registrska} ob {niceTime()}") + # discordLog(f"!!!!!!!!!!!!!!!!!!!!!!!!!!!\nNapaka pri {registrska} ob {niceTime()}") + return render_template("failure.html") + + +@app.route("/", methods=["GET"]) def index(): app.logger.info("Zahteva za domačo stran") # discordLog(f"Zahteva za domačo stran ob {niceTime()}") - return render_template('index.html') + return render_template("index.html") + + +@app.route("/global", methods=["GET"]) +def global_index(): + app.logger.info("Zahteva za globalno stran") + # discordLog(f"Zahteva za globalno stran ob {niceTime()}") + return render_template("index_global.html") + -if __name__ == '__main__': - app.run()
\ No newline at end of file +if __name__ == "__main__": + app.run() diff --git a/templates/index.html b/templates/index.html index d552e94..a6c365c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,182 +1,219 @@ <!doctype html> <html> - <head> - <meta charset="utf-8"> - - <!-- Google tag (gtag.js) --> - <script async src="https://www.googletagmanager.com/gtag/js?id=G-FJS1R8KSQD"></script> - <script> - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - - gtag('config', 'G-FJS1R8KSQD'); - </script> - <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6895462190731164" - crossorigin="anonymous"></script> - </script> - - <style> - body { - font-family: 'Courier New', Courier, monospace; - font-size: 1.6rem; - width: 100%; - height: 100%; - margin: auto; - justify-content: center; - align-items: center; - display: flex; - } - .input { - font-size: 1.6rem; - border-radius: 5px; - outline: none; - padding: 0.4rem; - height: 1.6rem; - max-width: 90%; - } - .inner-content { - display: flex; - flex-direction: column; - margin: 10px; - padding: 7px; - max-width: 800px; - width: 95%; - } - .button { - height: 45px; - padding: 5px 20px; - border: 1px solid; - border-radius: 5px; - font-size: 1.7rem; - margin-top: 15px; - } - .input:focus { - outline: auto; - border-color: none; - } - .info { - background-color: lightgoldenrodyellow; - border: 1px solid yellow; - border-radius: 10px; - padding: 20px; - margin-bottom: 10px; - display: flex; - flex-direction: column; - font-size: 1.6rem; - } - .message { - padding: 10px 20px; - margin-top: 2rem; - border: 2px solid rgb(190, 190, 190); - border-radius: 5px; - } - .error { - border-color: lightcoral; - } - .label { - margin: 15px 0px ; - margin-right: 20px; - font-weight: 700; - } - .title { - text-align: center; - font-size: 3rem; - } - .share-icon { - border-radius: 5px; - height: 2rem; - width: 2rem; - display: flex; - justify-content: center; - align-items: center; - } - .share-icon:hover { - cursor: pointer; - transform: scale(1.2); - transition-duration: 200ms; - } - .share-icons-container { - width: 90%; - display: flex; - justify-content: center; - align-items: center; - margin-top: 40px; - padding-left: 5%; - } - a { - text-decoration: none; - } - .input-container { - display: flex; - flex-direction: row; - align-items: center; - } - - @media screen and (max-width: 700px) { - .input-container { - flex-direction: column; - justify-content: center; - } - .label { - margin-right: 0px; - } - } - </style> - <title>eVinjeta: Hitro preveri veljavnost evinjete</title> - <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> - <meta name="description" content="Preveri evinjeto. Brez registracije, potrebujemo le registrsko številko. Rezultat takoj. Kdaj kupiti evinjeto?" /> - <meta name="keywords" content="vinjeta evinjeta veljavnost DARS" /> - <meta property="og:url" content="http://evinjeta.eu" /> - <meta property="og:type" content="website" /> - <meta property="og:title" content="eVinjeta" /> - <meta property="og:description" content="Preveri evinjeto. Brez registracije, potrebujemo le registrsko številko. Rezultat takoj. Kdaj kupiti evinjeto?" /> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> - </head> - <body> - <div class="inner-content"> - <h1 class="title">eVINJETA</h1> - <div class="info"> - Preveri veljavnost svoje eVinjete: - <span style="font-size: 0.8rem; font-weight: 200;">* Podatke dobimo iz DARS strežnikov. Nismo povezani z DARSom.</span> - </div> - <form method="POST"> - <div class="input-container"> - <p class="label">Registrska tablica:</p> - <input class="input" type="text" name="registrska" placeholder="Primer: LJABC23" /> - </div> - <div style="justify-content: center; display: flex;"> - <input type="submit" value="Preveri" class="button" /> - </div> - </form> - {% if valid_until %} - <div class="message"> - <p>Vinjeta za registrsko tablico <b>{{ license_plate }}</b> je veljavna vključno do: <b>{{ valid_until }}</b></p> - </div> - {% elif license_plate %} - <div class="message error"> - <p>Registrska tablica "<b>{{ license_plate }}</b>" nima veljavne vinjete!</p> - </div> - {% endif %} - <div class="share-icons-container"> - <div> - <span style="font-size: 1.4rem;">Če vam je spletna stran prišla prav, jo prosim delite z ostalimi:</span> - <div style="display: flex; justify-content: center; margin-top: 10px;"> - <a href="https://twitter.com/intent/tweet?text=Enostavno%20preveri%20veljavnost%20svoje%20vinjete%21%0Ahttp%3A%2F%2Fevinjeta.eu%0A%23vinjeta%20%23evinjeta" onclick="window.open(this.href, 'newwindow1', 'width=600,height=600'); return false;"> - <div class="share-icon" id="twitter"><i class="fa fa-twitter" style="font-size:32px; color: #1DA1F2"></i></div> - </a> - <div style="width: 10px;"></div> - <a href="https://www.facebook.com/sharer/sharer.php?u=http://evinjeta.eu" onclick="window.open(this.href, 'newwindow2', 'width=600,height=600'); return false;"> - <div class="share-icon" id="facebook"><i class="fa fa-facebook" style="font-size:32px; color: #4267B2"></i></div> - </a> - </div> - </div> + +<head> + <meta charset="utf-8"> + + <!-- Google tag (gtag.js) --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-FJS1R8KSQD"></script> + <script> + window.dataLayer = window.dataLayer || []; + function gtag() { dataLayer.push(arguments); } + gtag('js', new Date()); + + gtag('config', 'G-FJS1R8KSQD'); + </script> + <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6895462190731164" + crossorigin="anonymous"></script> + </script> + + <style> + body { + font-family: 'Courier New', Courier, monospace; + font-size: 1.6rem; + width: 100%; + height: 100%; + margin: auto; + justify-content: center; + align-items: center; + display: flex; + } + + .input { + font-size: 1.6rem; + border-radius: 5px; + outline: none; + padding: 0.4rem; + height: 1.6rem; + max-width: 90%; + } + + .inner-content { + display: flex; + flex-direction: column; + margin: 10px; + padding: 7px; + max-width: 800px; + width: 95%; + } + + .button { + height: 45px; + padding: 5px 20px; + border: 1px solid; + border-radius: 5px; + font-size: 1.7rem; + margin-top: 15px; + } + + .input:focus { + outline: auto; + border-color: none; + } + + .info { + background-color: lightgoldenrodyellow; + border: 1px solid yellow; + border-radius: 10px; + padding: 20px; + margin-bottom: 10px; + display: flex; + flex-direction: column; + font-size: 1.6rem; + } + + .message { + padding: 10px 20px; + margin-top: 2rem; + border: 2px solid rgb(190, 190, 190); + border-radius: 5px; + } + + .error { + border-color: lightcoral; + } + + .label { + margin: 15px 0px; + margin-right: 20px; + font-weight: 700; + } + + .title { + text-align: center; + font-size: 3rem; + } + + .share-icon { + border-radius: 5px; + height: 2rem; + width: 2rem; + display: flex; + justify-content: center; + align-items: center; + } + + .share-icon:hover { + cursor: pointer; + transform: scale(1.2); + transition-duration: 200ms; + } + + .share-icons-container { + width: 90%; + display: flex; + justify-content: center; + align-items: center; + margin-top: 40px; + padding-left: 5%; + } + + a { + text-decoration: none; + } + + .input-container { + display: flex; + flex-direction: row; + align-items: center; + } + + @media screen and (max-width: 700px) { + .input-container { + flex-direction: column; + justify-content: center; + } + + .label { + margin-right: 0px; + } + } + </style> + <title>eVinjeta: Hitro preveri veljavnost evinjete</title> + <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> + <meta name="description" + content="Preveri evinjeto. Brez registracije, potrebujemo le registrsko številko. Rezultat takoj. Kdaj kupiti evinjeto?" /> + <meta name="keywords" content="vinjeta evinjeta veljavnost DARS" /> + <meta property="og:url" content="http://evinjeta.eu" /> + <meta property="og:type" content="website" /> + <meta property="og:title" content="eVinjeta" /> + <meta property="og:description" + content="Preveri evinjeto. Brez registracije, potrebujemo le registrsko številko. Rezultat takoj. Kdaj kupiti evinjeto?" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> +</head> + +<body> + <div class="inner-content"> + <h1 class="title">eVINJETA</h1> + <div class="info"> + Preveri veljavnost svoje eVinjete: + <span style="font-size: 0.8rem; font-weight: 200;">* Podatke dobimo iz DARS strežnikov. Nismo povezani z + DARSom.</span> + </div> + <form method="POST"> + <div class="input-container"> + <p class="label">Registrska tablica:</p> + <input class="input" type="text" name="registrska" placeholder="Primer: LJABC23" /> + </div> + <div style="justify-content: center; display: flex;"> + <input type="submit" value="Preveri" class="button" /> + </div> + </form> + {% if valid_until %} + <div class="message"> + <p>Vinjeta za registrsko tablico <b>{{ license_plate }}</b> je veljavna vključno do: <b>{{ valid_until }}</b></p> + </div> + {% elif license_plate %} + <div class="message error"> + <p>Registrska tablica "<b>{{ license_plate }}</b>" nima veljavne vinjete!</p> + </div> + {% endif %} + <div class="share-icons-container"> + <div> + <span style="font-size: 1rem;">Podpirajte nas tako, da spletno stran delite z ostalimi lahko pa + nam tudi donirate kavo 😋</span> + <div style="display: flex; justify-content: center; margin-top: 10px;"> + <a href="https://twitter.com/intent/tweet?text=Enostavno%20preveri%20veljavnost%20svoje%20vinjete%21%0Ahttp%3A%2F%2Fevinjeta.eu%0A%23vinjeta%20%23evinjeta" + onclick="window.open(this.href, 'newwindow1', 'width=600,height=600'); return false;"> + <div class="share-icon" id="twitter"><i class="fa fa-twitter" style="font-size:32px; color: #1DA1F2"></i> </div> - <div style="align-self: center; margin-top: 20px; max-width: 100%;"> - <blockquote class="twitter-tweet"><p lang="sl" dir="ltr">[E-VINJETA] 🤔🧾 Ste izgubili potrdilo o nakupu letne e-vinjete in se sprašujete, do kdaj vam velja? 📆 V kratkem videu si oglejte, kako lahko na hiter in enostaven način preverite veljavnost vaše e-vinjete! 👇 <a href="https://t.co/buHbFp9NgV">pic.twitter.com/buHbFp9NgV</a></p>— DARS (@DARS_SI) <a href="https://twitter.com/DARS_SI/status/1613109303648346114?ref_src=twsrc%5Etfw">January 11, 2023</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> + </a> + <div style="width: 10px;"></div> + <a href="https://www.facebook.com/sharer/sharer.php?u=http://evinjeta.eu" + onclick="window.open(this.href, 'newwindow2', 'width=600,height=600'); return false;"> + <div class="share-icon" id="facebook"><i class="fa fa-facebook" style="font-size:32px; color: #4267B2"></i> </div> + </a> + <div style="color: #121661"> + <a href="https://www.paypal.com/donate/?hosted_button_id=7XAMRH69JLSZN"> + <span class="donate-button"> Doniraj </span> + </a> + </div> </div> - </body> + </div> + </div> + <div style="align-self: center; margin-top: 20px; max-width: 100%;"> + <blockquote class="twitter-tweet"> + <p lang="sl" dir="ltr">[E-VINJETA] 🤔🧾 Ste izgubili potrdilo o nakupu letne e-vinjete in se sprašujete, do kdaj + vam velja? 📆 V kratkem videu si oglejte, kako lahko na hiter in enostaven način preverite veljavnost vaše + e-vinjete! 👇 <a href="https://t.co/buHbFp9NgV">pic.twitter.com/buHbFp9NgV</a></p>— DARS (@DARS_SI) <a + href="https://twitter.com/DARS_SI/status/1613109303648346114?ref_src=twsrc%5Etfw">January 11, 2023</a> + </blockquote> + <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> + </div> + </div> +</body> + </html>
\ No newline at end of file diff --git a/templates/index_global.html b/templates/index_global.html new file mode 100644 index 0000000..3597bac --- /dev/null +++ b/templates/index_global.html @@ -0,0 +1,234 @@ +<!doctype html> +<html> + +<head> + <meta charset="utf-8"> + + <!-- Google tag (gtag.js) --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-FJS1R8KSQD"></script> + <script> + window.dataLayer = window.dataLayer || []; + function gtag() { dataLayer.push(arguments); } + gtag('js', new Date()); + + gtag('config', 'G-FJS1R8KSQD'); + </script> + <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6895462190731164" + crossorigin="anonymous"></script> + </script> + + <style> + body { + font-family: 'Courier New', Courier, monospace; + font-size: 1.6rem; + width: 100%; + height: 100%; + margin: auto; + justify-content: center; + align-items: center; + display: flex; + } + + .input { + font-size: 1.6rem; + border-radius: 5px; + outline: none; + padding: 0.4rem; + height: 2.6rem; + max-width: 90%; + } + + .inner-content { + display: flex; + flex-direction: column; + margin: 10px; + padding: 7px; + max-width: 800px; + width: 95%; + } + + .button { + height: 45px; + padding: 5px 20px; + border: 1px solid; + border-radius: 5px; + font-size: 1.7rem; + margin-top: 15px; + } + + .input:focus { + outline: auto; + border-color: none; + } + + .info { + background-color: lightgoldenrodyellow; + border: 1px solid yellow; + border-radius: 10px; + padding: 20px; + margin-bottom: 10px; + display: flex; + flex-direction: column; + font-size: 1.6rem; + } + + .message { + padding: 10px 20px; + margin-top: 2rem; + border: 2px solid rgb(190, 190, 190); + border-radius: 5px; + } + + .error { + border-color: lightcoral; + } + + .label { + margin: 15px 0px; + margin-right: 20px; + font-weight: 700; + } + + .title { + text-align: center; + font-size: 3rem; + } + + .share-icon { + border-radius: 5px; + height: 2rem; + width: 2rem; + display: flex; + justify-content: center; + align-items: center; + } + + .share-icon:hover { + cursor: pointer; + transform: scale(1.2); + transition-duration: 200ms; + } + + .share-icons-container { + width: 90%; + display: flex; + justify-content: center; + align-items: center; + margin-top: 40px; + padding-left: 5%; + } + + a { + text-decoration: none; + } + + .input-container { + display: flex; + flex-direction: row; + align-items: center; + } + + @media screen and (max-width: 700px) { + .input-container { + flex-direction: column; + justify-content: center; + } + + .label { + margin-right: 0px; + } + } + </style> + <title>eVinjeta: Hitro preveri veljavnost evinjete</title> + <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> + <meta name="description" + content="Preveri evinjeto. Brez registracije, potrebujemo le registrsko številko. Rezultat takoj. Kdaj kupiti evinjeto?" /> + <meta name="keywords" content="vinjeta evinjeta veljavnost DARS" /> + <meta property="og:url" content="http://evinjeta.eu" /> + <meta property="og:type" content="website" /> + <meta property="og:title" content="eVinjeta" /> + <meta property="og:description" + content="Preveri evinjeto. Brez registracije, potrebujemo le registrsko številko. Rezultat takoj. Kdaj kupiti evinjeto?" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> +</head> + +<body> + <div class="inner-content"> + <h1 class="title">eVINJETA</h1> + <div class="info"> + Preveri veljavnost svoje eVinjete: + <span style="font-size: 0.8rem; font-weight: 200;">* Podatke dobimo iz DARS strežnikov. Nismo povezani z + DARSom.</span> + </div> + <form method="POST"> + <div class="input-container"> + <p class="label">Registrska tablica:</p> + <input class="input" type="text" name="registrska" placeholder="Primer: LJABC23" /> + </div> + <div class="input-container"> + <p class="label">Država:</p> + <select class="input" name="drzava"> + <option value="SI">Slovenija</option> + <option value="AT">Avstrija</option> + <option value="HR">Hrvaška</option> + <option value="IT">Italija</option> + <option value="HU">Madžarska</option> + <option value="RS">Srbija</option> + <option value="CH">Švica</option> + <option value="DE">Nemčija</option> + <option value="BA">Bosna in Hercegovina</option> + </select> + </div> + <div style="justify-content: center; display: flex;"> + <input type="submit" value="Preveri" class="button" /> + </div> + </form> + + {% if valid_until %} + <div class="message"> + <p>Vinjeta za registrsko tablico <b>{{ license_plate }}</b> je veljavna vključno do: <b>{{ valid_until }}</b></p> + </div> + {% elif license_plate %} + <div class="message error"> + <p>Registrska tablica "<b>{{ license_plate }}</b>" nima veljavne vinjete!</p> + </div> + {% endif %} + <div class="share-icons-container"> + <div> + <span style="font-size: 1rem;">Podpirajte nas tako, da spletno stran delite z ostalimi lahko pa + nam tudi donirate kavo 😋</span> + <div style="display: flex; justify-content: center; margin-top: 10px;"> + <a href="https://twitter.com/intent/tweet?text=Enostavno%20preveri%20veljavnost%20svoje%20vinjete%21%0Ahttp%3A%2F%2Fevinjeta.eu%0A%23vinjeta%20%23evinjeta" + onclick="window.open(this.href, 'newwindow1', 'width=600,height=600'); return false;"> + <div class="share-icon" id="twitter"><i class="fa fa-twitter" style="font-size:32px; color: #1DA1F2"></i> + </div> + </a> + <div style="width: 10px;"></div> + <a href="https://www.facebook.com/sharer/sharer.php?u=http://evinjeta.eu" + onclick="window.open(this.href, 'newwindow2', 'width=600,height=600'); return false;"> + <div class="share-icon" id="facebook"><i class="fa fa-facebook" style="font-size:32px; color: #4267B2"></i> + </div> + </a> + <div style="color: #121661"> + <a href="https://www.paypal.com/donate/?hosted_button_id=7XAMRH69JLSZN"> + <span class="donate-button"> Doniraj </span> + </a> + </div> + </div> + </div> + </div> + <div style="align-self: center; margin-top: 20px; max-width: 100%;"> + <blockquote class="twitter-tweet"> + <p lang="sl" dir="ltr">[E-VINJETA] 🤔🧾 Ste izgubili potrdilo o nakupu letne e-vinjete in se sprašujete, do kdaj + vam velja? 📆 V kratkem videu si oglejte, kako lahko na hiter in enostaven način preverite veljavnost vaše + e-vinjete! 👇 <a href="https://t.co/buHbFp9NgV">pic.twitter.com/buHbFp9NgV</a></p>— DARS (@DARS_SI) <a + href="https://twitter.com/DARS_SI/status/1613109303648346114?ref_src=twsrc%5Etfw">January 11, 2023</a> + </blockquote> + <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> + </div> + </div> +</body> + +</html>
\ No newline at end of file |