diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/base.html | 60 | ||||
| -rw-r--r-- | templates/download.html | 125 | ||||
| -rw-r--r-- | templates/index.html | 42 |
3 files changed, 125 insertions, 102 deletions
diff --git a/templates/base.html b/templates/base.html index 17c28f2..576f264 100644 --- a/templates/base.html +++ b/templates/base.html | |||
| @@ -1,39 +1,45 @@ | |||
| 1 | <!doctype html> | 1 | <!doctype html> |
| 2 | <html lang="en"> | 2 | <html lang="en"> |
| 3 | <head> | 3 | |
| 4 | <title>MAT2</title> | 4 | <head> |
| 5 | <meta charset="UTF-8"> | 5 | <title>MAT2</title> |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 6 | <meta charset="UTF-8"> |
| 7 | <link href="{{ url_for('static', filename='raleway.woff2') }}" as="font" type="font/woff2" rel="preload"> | 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 8 | <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.png') }}"> | 8 | <link href="{{ url_for('static', filename='raleway.woff2') }}" as="font" type="font/woff2" rel="preload"> |
| 9 | {% assets 'css' %} | 9 | <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.png') }}"> |
| 10 | <link rel="stylesheet" href="{{ ASSET_URL }}"> | 10 | {% assets 'css' %} |
| 11 | {% endassets %} | 11 | <link rel="stylesheet" href="{{ ASSET_URL }}"> |
| 12 | </head> | 12 | {% endassets %} |
| 13 | </head> | ||
| 14 | |||
| 13 | <body class="flex flex-col h-screen justify-between"> | 15 | <body class="flex flex-col h-screen justify-between"> |
| 14 | <header class="h-20 w-full bg-blue-100 my-0 flex justify-center"> | 16 | <header class="h-20 w-full bg-blue-100 my-0 flex justify-center"> |
| 15 | <a href='.' class="mt-8"> | 17 | <a href='.' class="mt-8"> |
| 16 | <img class='max-h-28' src="{{ url_for('static', filename='logo.png') }}" alt="mat2 logo"/> | 18 | <img class='max-h-28' src="{{ url_for('static', filename='logo.png') }}" alt="mat2 logo" /> |
| 17 | </a> | 19 | </a> |
| 18 | </header> | 20 | </header> |
| 19 | 21 | ||
| 20 | <div class="container h-10 mt-8"> | 22 | |
| 21 | <div> | 23 | |
| 22 | {% with messages = get_flashed_messages() %} | 24 | <section class="mb-auto mt-8 pt-8"> |
| 23 | {% if messages %} | 25 | {% with messages = get_flashed_messages() %} |
| 24 | {% for message in messages %} | 26 | {% if messages %} |
| 25 | <div> | 27 | {% for message in messages %} |
| 26 | <p> | 28 | <div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500"> |
| 27 | {{ message }} | 29 | <span class="text-xl inline-block mr-5 align-middle"> |
| 28 | </p> | 30 | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 29 | </div> | 31 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" |
| 30 | {% endfor %} | 32 | d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> |
| 31 | {% endif %} | 33 | </svg> |
| 32 | {% endwith %} | 34 | </span> |
| 35 | <span class="inline-block align-middle mr-8"> | ||
| 36 | {{ message }} | ||
| 37 | </span> | ||
| 33 | </div> | 38 | </div> |
| 34 | </div> | 39 | {% endfor %} |
| 40 | {% endif %} | ||
| 41 | {% endwith %} | ||
| 35 | 42 | ||
| 36 | <section class="container mb-auto mx-auto mt-8"> | ||
| 37 | {% block content %}{% endblock %} | 43 | {% block content %}{% endblock %} |
| 38 | </section> | 44 | </section> |
| 39 | 45 | ||
| @@ -42,4 +48,4 @@ | |||
| 42 | <a href='https://0xacab.org/jvoisin/mat2-web'>source</a> - | 48 | <a href='https://0xacab.org/jvoisin/mat2-web'>source</a> - |
| 43 | ♥ | 49 | ♥ |
| 44 | </footer> | 50 | </footer> |
| 45 | </body> | 51 | </body> \ No newline at end of file |
diff --git a/templates/download.html b/templates/download.html index 8100623..2313d04 100644 --- a/templates/download.html +++ b/templates/download.html | |||
| @@ -1,69 +1,86 @@ | |||
| 1 | {% extends "base.html" %} | 1 | {% extends "base.html" %} |
| 2 | 2 | ||
| 3 | {% block content %} | 3 | {% block content %} |
| 4 | <div class="shadowed-box u-text-center u-center-block"> | 4 | <div class="grid grid-rows-1 w-50"> |
| 5 | <h2 class="uk-text-center">Metadata removed</h2> | 5 | <div class="flex justify-center"> |
| 6 | {% if not meta_after %} | 6 | <div class="rounded overflow-hidden shadow-lg p-4"> |
| 7 | <p class="uk-text-center"> | 7 | {% if not meta_after %} |
| 8 | <div class="px-6 py-4 grid grid-rows-1"> | ||
| 9 | <h1 class="font-bold text-xl mb-2">Metadata removed</h1> | ||
| 10 | </div> | ||
| 11 | <p class="text-gray-700 text-base text-center"> | ||
| 8 | Successfully removed the metadata | 12 | Successfully removed the metadata |
| 13 | <svg class="max-h-40 fill-current text-green-600" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" | ||
| 14 | fill="currentColor"> | ||
| 15 | <path fill-rule="evenodd" | ||
| 16 | d="M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" | ||
| 17 | clip-rule="evenodd" /> | ||
| 18 | </svg> | ||
| 9 | </p> | 19 | </p> |
| 10 | {% endif %} | 20 | {% endif %} |
| 11 | <div class="uk-flex uk-flex-center"> | 21 | |
| 12 | <div> | 22 | {% if meta_after %} |
| 13 | <a class="uk-flex-1" href='{{ download_uri }}'> | 23 | <div class="px-6 py-4 grid grid-rows-1"> |
| 14 | <button class="uk-button uk-button-primary"> | 24 | <h1 class="font-bold text-xl mb-2">Metadata partially removed</h1> |
| 15 | ⇩ download cleaned file | ||
| 16 | </button> | ||
| 17 | </a> | ||
| 18 | </div> | 25 | </div> |
| 19 | </div> | 26 | <p class="text-gray-700 text-base text-center"> |
| 27 | Could not remove all the metadata | ||
| 28 | <svg class="max-h-40 fill-current text-yellow-600" xmlns="http://www.w3.org/2000/svg" | ||
| 29 | viewBox="0 0 20 20" fill="currentColor"> | ||
| 30 | <path fill-rule="evenodd" | ||
| 31 | d="M10 1.944A11.954 11.954 0 012.166 5C2.056 5.649 2 6.319 2 7c0 5.225 3.34 9.67 8 11.317C14.66 16.67 18 12.225 18 7c0-.682-.057-1.35-.166-2.001A11.954 11.954 0 0110 1.944zM11 14a1 1 0 11-2 0 1 1 0 012 0zm0-7a1 1 0 10-2 0v3a1 1 0 102 0V7z" | ||
| 32 | clip-rule="evenodd" /> | ||
| 33 | </svg> | ||
| 20 | 34 | ||
| 35 | </p> | ||
| 36 | {% endif %} | ||
| 21 | 37 | ||
| 22 | <p> | 38 | <a class="uk-flex-1" href='{{ download_uri }}'> |
| 23 | {% if meta_after %} | 39 | <button |
| 24 | <div class="uk-alert uk-alert-warning" uk-alert> | 40 | class="w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded flex justify-center" |
| 25 | <p> | 41 | > |
| 26 | <b>Could not</b> remove all the metadata | 42 | <svg class="w-4 h-4 mr-2 text-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> |
| 27 | </p> | 43 | <path style="fill: white" d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z" /> |
| 44 | </svg> | ||
| 45 | <span>Download Cleaned File</span> | ||
| 46 | </button> | ||
| 47 | </a> | ||
| 48 | </div> | ||
| 49 | </div> | ||
| 50 | {% if meta_after %} | ||
| 51 | <div class="mx-auto w-full"> | ||
| 52 | <div class="bg-white shadow-md rounded my-6"> | ||
| 53 | <table class="text-left w-full border-collapse"> | ||
| 54 | <div class="px-6 py-4 grid grid-rows-1"> | ||
| 55 | <h1 class="font-bold text-xl mb-2">Remaining Metadata</h1> | ||
| 28 | </div> | 56 | </div> |
| 29 | <h3> | 57 | <thead> |
| 30 | Remaining Metadata | 58 | <tr> |
| 31 | </h3> | 59 | <th |
| 32 | <dl class="uk-description-list uk-description-list-divider"> | 60 | class="py-4 px-6 bg-grey-lightest font-bold uppercase text-sm text-grey-dark border-b border-grey-light"> |
| 61 | Key | ||
| 62 | </th> | ||
| 63 | <th | ||
| 64 | class="py-4 px-6 bg-grey-lightest font-bold uppercase text-sm text-grey-dark border-b border-grey-light"> | ||
| 65 | Value | ||
| 66 | </th> | ||
| 67 | </tr> | ||
| 68 | </thead> | ||
| 69 | <tbody> | ||
| 33 | {% for key, value in meta_after.items() %} | 70 | {% for key, value in meta_after.items() %} |
| 34 | <dt> | 71 | <tr class="hover:bg-grey-lighter"> |
| 72 | <td class="py-4 px-6 border-b border-grey-light"> | ||
| 35 | {{ key }} | 73 | {{ key }} |
| 36 | </dt> | 74 | </td> |
| 37 | <dd> | 75 | <td class="py-4 px-6 border-b border-grey-light"> |
| 38 | {{ value }} | 76 | {{ value }} |
| 39 | </dd> | 77 | </td> |
| 78 | </tr> | ||
| 40 | {% endfor %} | 79 | {% endfor %} |
| 41 | </dl> | 80 | </tbody> |
| 42 | {% endif %} | 81 | </table> |
| 43 | </p> | ||
| 44 | |||
| 45 | {% if meta %} | ||
| 46 | <h3> | ||
| 47 | Removed Metadata | ||
| 48 | </h3> | ||
| 49 | <dl class="uk-description-list uk-description-list-divider"> | ||
| 50 | {% for key, value in meta.items() %} | ||
| 51 | <dt> | ||
| 52 | {{ key }} | ||
| 53 | </dt> | ||
| 54 | <dd> | ||
| 55 | {{ value }} | ||
| 56 | </dd> | ||
| 57 | {% endfor %} | ||
| 58 | </dl> | ||
| 59 | {% else %} | ||
| 60 | <div class="uk-alert uk-alert-success"> | ||
| 61 | <p> | ||
| 62 | Not a single metadata was found, odds are that your file was already clean! | ||
| 63 | </p> | ||
| 64 | </div> | 82 | </div> |
| 65 | {% endif %} | ||
| 66 | </div> | 83 | </div> |
| 67 | 84 | {% endif %} | |
| 68 | {% endblock %} | 85 | </div> |
| 69 | 86 | {% endblock %} \ No newline at end of file | |
diff --git a/templates/index.html b/templates/index.html index 008f5f3..f0268f3 100644 --- a/templates/index.html +++ b/templates/index.html | |||
| @@ -1,26 +1,26 @@ | |||
| 1 | {% extends "base.html" %} | 1 | {% extends "base.html" %} |
| 2 | {% block content %} | 2 | {% block content %} |
| 3 | <div class="flex justify-center"> | 3 | <div class="flex justify-center"> |
| 4 | <div class="max-w-lg rounded overflow-hidden shadow-lg pb-4"> | 4 | <div class="w-50 rounded overflow-hidden shadow-lg pb-4"> |
| 5 | <div class="px-6 py-4"> | 5 | <div class="px-6 py-4"> |
| 6 | <div class="font-bold text-xl mb-2">Remove Metadata</div> | 6 | <div class="font-bold text-xl mb-2">Remove Metadata</div> |
| 7 | <p class="text-gray-700 text-base"> | 7 | <p class="text-gray-700 text-base"> |
| 8 | The file you see is just the tip of the iceberg. Remove the hidden metadata. | 8 | The file you see is just the tip of the iceberg. Remove the hidden metadata. |
| 9 | </p> | 9 | </p> |
| 10 | </div> | 10 | </div> |
| 11 | <div class="px-6 pt-4 pb-2 grid grid-rows-1"> | 11 | <div class="px-6 pt-4 pb-2 grid grid-rows-1"> |
| 12 | <form method="post" enctype="multipart/form-data" class="grid grid-rows-1"> | 12 | <form method="post" enctype="multipart/form-data" class="grid grid-rows-1"> |
| 13 | <input type="file" name="file" id="upload_file" accept="{{ mimetypes | join(', ') }}"> | 13 | <input type="file" name="file" id="upload_file" accept="{{ mimetypes | join(', ') }}"> |
| 14 | <button class="mt-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" type="submit" value="Upload">Remove Metadata</button> | 14 | <button class="mt-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" type="submit" |
| 15 | </form> | 15 | value="Upload">Remove Metadata</button> |
| 16 | </div> | 16 | </form> |
| 17 | </div> | 17 | </div> |
| 18 | </div> | 18 | </div> |
| 19 | <button | 19 | </div> |
| 20 | class="p-0 w-10 h-10 absolute sm:bottom-8 md:bottom-16 sm:right-8 md:right-16 bg-blue-300 hover:bg-blue-400 rounded-full active:shadow-lg mouse shadow transition ease-in duration-200 focus:outline-none" | 20 | <button |
| 21 | > | 21 | class="p-0 w-10 h-10 absolute sm:bottom-8 md:bottom-16 sm:right-8 md:right-16 bg-blue-300 hover:bg-blue-400 rounded-full active:shadow-lg mouse shadow transition ease-in duration-200 focus:outline-none"> |
| 22 | <a href="/info" role="link" class="w-6 h-6 text-white inline-block font-bold"> | 22 | <a href="/info" role="link" class="w-6 h-6 text-white inline-block font-bold"> |
| 23 | ? | 23 | ? |
| 24 | </a> | 24 | </a> |
| 25 | </button> | 25 | </button> |
| 26 | {% endblock %} | 26 | {% endblock %} \ No newline at end of file |
