From c6952b54c7a402ed3f70467653d5e44404a9933f Mon Sep 17 00:00:00 2001 From: tigerbot Date: Mon, 24 Apr 2017 11:19:39 -0600 Subject: [PATCH] made the page a little prettier --- drag-drop-render.js | 5 +++++ index.html | 3 ++- style.css | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 style.css diff --git a/drag-drop-render.js b/drag-drop-render.js index ad71f36..257daca 100644 --- a/drag-drop-render.js +++ b/drag-drop-render.js @@ -29,6 +29,11 @@ events.forEach(function (event) { }); document.body.addEventListener('drop', function (ev) { + var area = document.body.getElementsByClassName('drag-n-drop')[0]; + if (!area.contains(ev.target)) { + return; + } + var files = Array.prototype.map.call(ev.dataTransfer.files, function (file) { return file.path; }); diff --git a/index.html b/index.html index 1faf0dc..40a11e2 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,7 @@ + @@ -8,7 +9,7 @@ -
+

Notifications

diff --git a/style.css b/style.css new file mode 100644 index 0000000..01ebf62 --- /dev/null +++ b/style.css @@ -0,0 +1,17 @@ +body > div { + padding: 1em; +} +body > div > h3 { + margin-top: 0em; + text-align: center; +} + +.drag-n-drop { + background: rgb(200, 200, 255); + border: 1px dotted black; + min-height: 150px; +} + +.notify button { + width:40%; +}