Skip to content

Commit

Permalink
Monochrome UI
Browse files Browse the repository at this point in the history
  • Loading branch information
snehesht committed Jul 28, 2018
1 parent 8c26279 commit e05a009
Show file tree
Hide file tree
Showing 31 changed files with 4,010 additions and 609 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,4 @@
{
"python.pythonPath": "/home/warlock/.local/share/virtualenvs/blog-AAp6Teun/bin/python",
"python.linting.enabled": false
}
26 changes: 21 additions & 5 deletions Pipfile
@@ -1,13 +1,29 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]


arrow = "==0.10.0"
cffi = "==1.9.1"
click = "==6.6"
dateparser = "==0.6.0"
itsdangerous = "==0.24"
misaka = "==2.0.0"
mistune = "==0.7.3"
pycparser = "==2.17"
python-dateutil = "==2.6.0"
pytz = "==2017.2"
regex = "==2017.6.7"
"ruamel.yaml" = "==0.15.9"
six = "==1.10.0"
tornado = "==4.5.1"
tzlocal = "==1.4"
Flask = "==0.11.1"
"Jinja2" = "==2.8"
Markdown = "==2.6.6"
MarkupSafe = "==0.23"
Pigments = "==1.6"
Werkzeug = "==0.11.10"

[dev-packages]

246 changes: 246 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 17 additions & 5 deletions app/app.py
@@ -1,17 +1,29 @@
from flask import Flask
from config import *
import os

# Initilize Flask App
app = Flask(__name__,static_folder='static', static_url_path='')

# Import views after the app is initilized
from views import *

# @app.after_request
# def add_header(response):
# response.cache_control.max_age = 360000
# response.cache_control.no_store = True
# return response
ENV = 'production'
DEBUG_STATUS = False
if ('ENV' in os.environ):
if (os.environ['ENV'] == 'dev'):
DEBUG_STATUS = True

print(ENV)

@app.after_request
def add_header(response):
if (DEBUG_STATUS):
response.cache_control.no_store = True
response.cache_control.no_cache = True
else:
response.cache_control.max_age = 360000
return response

if __name__=="__main__":
app.run(debug=DEBUG_STATUS,host=HOST,port=PORT)
52 changes: 17 additions & 35 deletions app/static/js/app.js
Expand Up @@ -4,49 +4,31 @@


// Toggle the Navigation Menubar based on previous state
function toggleNavbar(){
const screenWidth = screen.width;

if(screenWidth > 767){
if (document.querySelector('#navbar-desktop').style.display == "none"){
document.querySelector("#navbar-desktop").style.display = "block"
localStorage.setItem('menu',1);
} else {
document.querySelector("#navbar-desktop").style.display = "none"
localStorage.setItem('menu',0);
}
function toggleNavbar() {
if (document.querySelector('.navbar').style.display != "block") {
document.querySelector(".navbar").style.display = "block"
} else {
if (document.querySelector('#navbar-mobile').style.display == "none"){
document.querySelector("#navbar-mobile").style.display = "block"
localStorage.setItem('menu',1);
} else {
document.querySelector("#navbar-mobile").style.display = "none"
localStorage.setItem('menu',0);
}
document.querySelector(".navbar").style.display = "none"
}
}

// Attach an EventListener to the "Menu" icon, to listen for mouse clicks
document.querySelector("#navbutton").addEventListener( "click", function() {
this.classList.toggle("open");
toggleNavbar();
});
// document.querySelector("#mobile-menu").addEventListener("click", function () {
// console.log('Clicked Menu')
// // this.classList.toggle("open");
// // toggleNavbar();
// });


// Execute the script once the webpage is loaded
document.addEventListener('DOMContentLoaded', function() {
var menu = localStorage.getItem('menu');
if(menu != null){
if(menu == 1){
document.querySelector("#navbutton").classList.toggle("open");
toggleNavbar();
}
} else {
localStorage.setItem('menu',0);
}
document.addEventListener('DOMContentLoaded', function () {
Array.from(document.querySelectorAll(".post-content a")).forEach(function (a) {
console.log(a.href)
a.target = "_blank";
});
});

// Adding target="_blank" to <a href=""></a> URL's in the blogpost
Array.from(document.querySelectorAll(".content a")).forEach(function (a) {
a.target = "_blank";
});
// Array.from(document.querySelectorAll(".content a")).forEach(function (a) {
// a.target = "_blank";
// });
1 change: 1 addition & 0 deletions app/static/public/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added app/static/public/bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/email.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/facebook.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/github.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/github_cute.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/keybase.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/linkedin.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/location.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/profile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/snehesh.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/public/snehesh_sq.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e05a009

Please sign in to comment.