made the page a little prettier

This commit is contained in:
tigerbot 2017-04-24 11:19:39 -06:00
parent 4af4487846
commit c6952b54c7
3 changed files with 24 additions and 1 deletions

View File

@ -29,6 +29,11 @@ events.forEach(function (event) {
}); });
document.body.addEventListener('drop', function (ev) { 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) { var files = Array.prototype.map.call(ev.dataTransfer.files, function (file) {
return file.path; return file.path;
}); });

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<link href="./style.css" type="text/css" rel="stylesheet" media="screen">
<meta charset="UTF-8"> <meta charset="UTF-8">
</head> </head>
<body> <body>
@ -8,7 +9,7 @@
<script>require('./notifications')</script> <script>require('./notifications')</script>
<script>require('./drag-drop-render')</script> <script>require('./drag-drop-render')</script>
<div> <div class="notify">
<h3>Notifications</h3> <h3>Notifications</h3>
<button class="start-notify">Start</button> <button class="start-notify">Start</button>
<button class="stop-notify">Stop</button> <button class="stop-notify">Stop</button>

17
style.css Normal file
View File

@ -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%;
}