JSFiddle - React, Tailwind, and code Playground
HTML
<body id="drop">
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="inner cover text-center">
<h1 class="cover-heading" id="promo-text">Drop file somewhere here.</h1>
<p id="progress" hidden="hidden">
<progress id="uploadprogress" min="0" max="100" value="0">0</progress>
</p>
</div>
</div>
</div>
</div>
</body>
CSS
a,
a:focus,
a:hover {
color: #fff;
}
html,
body {
height: 100%;
background-color: #333;
}
body {
color: #fff;
text-align: center;
text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
/* Extra markup and styles for table-esque vertical and horizontal centering */
.site-wrapper {
display: table;
width: 100%;
height: 100%; /* For at least Firefox */
min-height: 100%;
-webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5);
box-shadow: inset 0 0 100px rgba(0,0,0,.5);
}
.site-wrapper-inner {
display: table-cell;
vertical-align: top;
}
.cover-container {
margin-right: auto;
margin-left: auto;
}
/* Padding for spacing */
.inner {
padding: 30px;
}
#drop-overlay {
position: absolute;
top: 0;
width:100px;
height:100px;
background:url('/img/drop.png') center center no-repeat;
background-color: rgba(129, 126, 126, .9);
}
/*
* Header
*/
.masthead-brand {
margin-top: 10px;
margin-bottom: 10px;
}
.masthead-nav > li {
display: inline-block;
}
.masthead-nav > li + li {
margin-left: 20px;
}
.masthead-nav > li > a {
padding-right: 0;
padding-left: 0;
font-size: 16px;
font-weight: bold;
color: #fff; /* IE8 proofing */
color: rgba(255,255,255,.75);
border-bottom: 2px solid transparent;
}
.masthead-nav > li > a:hover,
.masthead-nav > li > a:focus {
background-color: transparent;
border-bottom-color: #a9a9a9;
border-bottom-color: rgba(255,255,255,.25);
}
.masthead-nav > .active > a,
.masthead-nav > .active > a:hover,
.masthead-nav > .active > a:focus {
color: #fff;
border-bottom-color: #fff;
}
@media (min-width: 768px) {
.masthead-brand {
float: left;
}
.masthead-nav {
float: right;
}
}
.cover {
padding: 0 20px;
}
.cover .btn-lg {
padding: 10px 20px;
font-weight: bold;
}
.mastfoot {
color: #999; /* IE8 proofing */
color: rgba(255,255,255,.5);
}
@media (min-width: 768px) {
...
JavaScript
var drop = document.getElementById('drop'),
text = document.getElementById('promo-text');
drop.ondragenter = function () {
console.log('dragged!');
text.innerHTML = 'Drop it here!';
return false;
};