diff --git a/.gitignore b/.gitignore index 2ff1484e..d00cce35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ .DS_Store node_modules +<<<<<<< HEAD public/bundle.js +======= +>>>>>>> add gitignore static/* !static/info.txt diff --git a/frontend/src/upload.js b/frontend/src/upload.js index e86ea819..ba2021e4 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -3,18 +3,21 @@ const FileSender = require('./fileSender'); let onChange = event => { const file = event.target.files[0]; - let li = document.createElement('li'); - let name = document.createElement('p'); - name.innerText = file.name; - li.appendChild(name); + var row = document.createElement("tr"); + var name = document.createElement("td"); + var link = document.createElement("td"); + var expiry = document.createElement("td"); - let link = document.createElement('a'); - li.appendChild(link); + var cellText = document.createTextNode(file.name); - let progress = document.createElement('p'); - li.appendChild(progress); + name.appendChild(cellText); - document.getElementById('uploaded_files').appendChild(li); + var progress = document.createElement("p"); + + row.appendChild(name); + row.appendChild(link); + row.appendChild(expiry); + document.getElementById("uploaded-files").appendChild(row); const fileSender = new FileSender(file); fileSender.on('progress', percentComplete => { @@ -24,20 +27,21 @@ let onChange = event => { const url = `${window.location .origin}/download/${info.fileId}/#${info.secretKey}`; localStorage.setItem(info.fileId, info.deleteToken); - link.innerText = url; - link.setAttribute('href', url); - let btn = document.createElement('button'); - btn.innerText = 'Delete from server'; + var del = document.createElement("td"); + var btn = document.createElement("button"); + btn.innerHTML = "x"; + btn.style = "padding: 0; border: none; background: none; cursor: pointer" btn.addEventListener('click', () => { FileSender.delete( info.fileId, localStorage.getItem(info.fileId) ).then(() => { - document.getElementById('uploaded_files').removeChild(li); + document.getElementById('uploaded-files').removeChild(row); localStorage.removeItem(info.fileId); }); }); - li.appendChild(btn); + del.appendChild(btn); + row.appendChild(del); }); }; diff --git a/public/index.html b/public/index.html index e258c9f1..987ae210 100644 --- a/public/index.html +++ b/public/index.html @@ -3,16 +3,48 @@ Firefox Fileshare - + + - + -
- -
+
+
+
+ Share your files quickly, privately and securely. +
+
+
+
+ DRAG & DROP +
+
+
+ your file/folder here or +
+
+
+ + +
+
+
+
+
- +
+ + + + + + + + +
FileCopy URLExpires inDelete
+
+ +
- + diff --git a/public/main.css b/public/main.css new file mode 100644 index 00000000..e26643a4 --- /dev/null +++ b/public/main.css @@ -0,0 +1,91 @@ +/*** index.html ***/ + +/** page-one **/ +body { + font-family: 'Fira Sans'; + font-weight: 300; + font-style: normal; + background-size: cover; +} +.main-window{ + border: 1px solid; + width: 606px; + height: 447px; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + background-color: white; + border-radius: 5px; +} +.title{ + font-size: 14px; + width: 50%; + margin: 50px auto ; +} +.upload-window{ + border: 1px dashed; + width: 50%; + margin: 0 auto; + width: 470px; + height: 250px; + border-radius: 5px; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} +#browse{ + float: right; + color: blue; +} +#browse-text{ + float: left; + width: 128px; +} +#upload-img{ + padding-right: 20px; +} +.upload-window>div:nth-child(2){ + font-size: 26px; +} +.upload{ + font-size: 12px; + width: auto; + overflow: hidden; +} +.file-upload{ + cursor: pointer; +} +input[type="file"] { + display: none; +} +form{ + width: 45px; + float: right; +} + +/** file-list **/ +th{ + font-size: 10px; + color: #737373; + font-weight: normal; + text-align: left; +} +td{ + font-size: 12px; + vertical-align: top; +} +#uploaded-files{ + width: 472px; + margin: 10px auto ; + float: top; + table-layout: fixed; + overflow-y: scroll; +} +#file-list{ + overflow-y: scroll; + height: 90px; +} diff --git a/public/resources/background.png b/public/resources/background.png new file mode 100644 index 00000000..634b72a2 Binary files /dev/null and b/public/resources/background.png differ diff --git a/public/resources/upload.svg b/public/resources/upload.svg new file mode 100644 index 00000000..d731adba --- /dev/null +++ b/public/resources/upload.svg @@ -0,0 +1,93 @@ + + + + Group 14 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +