Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gachouchani1999 committed Sep 19, 2021
2 parents 855e12c + ad270ba commit 606b046
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 47 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# hackriceproject
This is our Hackrice project
## Setup
`python3 -m venv venv`
`source venv/bin/activate`
`pip install -r requirements.txt`
restart so bootstrap-flask loads

`export FLASK_APP=flaskr`
`export FLASK_ENV=development`
`flask run`
# EZ PowerPoint



## Local Instructions
1. `python3 -m venv venv`
1. `source venv/bin/activate`
1. `pip install -r requirements.txt`
1. restart so bootstrap-flask loads

1. `export FLASK_APP=flaskr`
1. `export FLASK_ENV=development`
1. `flask run`
8 changes: 0 additions & 8 deletions flaskr/doc_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,3 @@ def find_title(heading_text):
word_frequencies[word] += 1
max_freq = max(word_frequencies.values())
return (list(word_frequencies.keys())[list(word_frequencies.values()).index(max_freq)])








11 changes: 1 addition & 10 deletions flaskr/static/download.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
document.addEventListener('DOMContentLoaded', function() {
setTimeout(changeDisplay, 5000);
setTimeout(displaySuccess, 750);
});

function changeDisplay() {
{
displaySuccess()
}



function displaySuccess() {
document.getElementById("loading").style.display = "none";
document.getElementById("success").style.display = "block";
document.getElementById("downloadBtn").style.display = "inline";
document.getElementById("pptx-status").innerHTML = "All done, click below to get your powerpoint!"
}

}
2 changes: 1 addition & 1 deletion flaskr/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ button {
.center {
margin-left: auto;
margin-right: auto;
width: 50%;
width: 60%;
}

#theme {
Expand Down
9 changes: 3 additions & 6 deletions flaskr/static/upload.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
var fileBool = false;
var themeBool = false;
var acceptedFileTypes = [
"application/doc",
"application/ms-doc",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
]

function updateGenerateBtn() {
Expand Down Expand Up @@ -59,10 +56,10 @@ document.querySelectorAll(".drop-zone__input").forEach((inputElement) => {
updateThumbnail(dropZoneElement, file);
fileBool = true; updateGenerateBtn();
} else {
alert("FileType must be .doc or .docx");
alert("Please upload a .docx extension");
}
} else {
alert("You can only upload one file!");
alert("Please upload a single file");
}

dropZoneElement.classList.remove("drop-zone--over");
Expand Down
6 changes: 3 additions & 3 deletions flaskr/templates/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
<img src="{{url_for('static', filename='media/failure.png')}}">
</div>
<div class="text-center">
<h3 id="pptx-status"> Analyzing ... </h3>
<h3 id="pptx-status">Analyzing File...</h3>
<form action="/download">
<button id="downloadBtn" class="btn btn-success" style="display:none;">Download PPTX</button>
</form>


</div>
</div>
<script src="{{url_for('static', filename='download.js')}}"></script>
Expand Down
15 changes: 7 additions & 8 deletions flaskr/templates/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
<p class="intro text-center center">
Tired of making powerpoints and losing hours that could be put into deep work?
You've come to the right place. EZ PowerPoint uses natural language processing algorithms to
pick out the most important points and summarizes the report or paper. Simply upload your files, click generate, and wait for your work
to be done for you!
pick out the most important points and summarizes the report or paper. Simply upload your file,
choose a theme, click generate, and wait for your work to be done for you!
</p>
<form action="/uploader" method="post" enctype = "multipart/form-data">
<div class="center">
<div class="drop-zone">
<span class="drop-zone__prompt">Drop Files Here or Click to Upload</span>
<input type="file" name="file" accept="application/doc, application/ms-doc, application/msword,
application/vnd.openxmlformats-officedocument.wordprocessingml.document"
<input type="file" name="file" accept="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
class="drop-zone__input" style="display:none;">
</div>
</div>
Expand All @@ -43,13 +42,13 @@ <h4 class="text-center">Select Your Theme</h4>
<img src="{{url_for('static', filename='media/gallery.png')}}">
</div>
<div class="td" data-theme-num="2">
<p>Ion Boardroom</p>
<img src="{{url_for('static', filename='media/ion-boardroom.png')}}">
</div>
<div class="td" data-theme-num="3">
<p>Ion</p>
<img src="{{url_for('static', filename='media/ion.png')}}">
</div>
<div class="td" data-theme-num="3">
<p>Ion Boardroom</p>
<img src="{{url_for('static', filename='media/ion-boardroom.png')}}">
</div>
<div class="td" data-theme-num="4">
<p>Organic</p>
<img src="{{url_for('static', filename='media/organic.png')}}">
Expand Down

0 comments on commit 606b046

Please sign in to comment.