forked from crearo/portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 81ff1f9
Showing
67 changed files
with
2,391 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
*.DS_* | ||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
|
||
# idea | ||
.idea/ | ||
.idea/workspace.xml | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
|
||
#Translations | ||
*.mo | ||
|
||
#Mr Developer | ||
venv | ||
*.pyc | ||
build | ||
|
||
# some stuff people can upload | ||
static/uploads/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
MIT License + Addition | ||
|
||
Copyright (c) | ||
|
||
0. You can modify this repo and use for your own portfolio. | ||
1. USE THIS FOR GOOD. | ||
2. DO NOT USE MY NAME ANYWHERE. You have your own, please get yourself in trouble, not me. | ||
3. I AM NOT RESPONSIBLE FOR ANY CHANGES YOU MAKE. | ||
4. DON'T USE THIS REPOSITORY TO MAKE A PORTFOLIO FOR MALICE. | ||
5. This copyright notice and this permission notice shall be included in all copies or substantial portions of the software. | ||
6. You will notify rishextra at gmail dot com when you host your own website using software. | ||
7. Have a good day! | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: gunicorn app:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Screenshots | ||
<p float="middle"> | ||
<img src="https://raw.githubusercontent.com/crearo/portfolio/master/screenshots/home.png" width="400"> | ||
<img src="https://raw.githubusercontent.com/crearo/portfolio/master/screenshots/projects.png" width="400"> | ||
<img src="https://raw.githubusercontent.com/crearo/portfolio/master/screenshots/timeline.png" width="400"> | ||
</p> | ||
|
||
# Technology | ||
|
||
Developed using Python Flask, and a lot of CSS and Jinja2. | ||
|
||
Sidenote: Why isn't web UI as easy to make as Android's? | ||
|
||
# I want to use this! | ||
|
||
You're free to use this for your own personal portfolio; but please do write to me telling me you have! | ||
|
||
- change the static content wherever it is to suit your work. | ||
- **NOTE**: Hard-refresh your browser (ctrl-shift-r) when you update the js files #19 | ||
- change the `timeline.json` and `projects.json` files with your work and projects. | ||
- send me an email at rishextra at gmail dot com. I'd really love to see it being used! | ||
|
||
# My Website | ||
<a href="https://www.rish.space">rish.space</a> | ||
|
||
# Wait, what happened to all the commits? | ||
|
||
I'll cover this in more detail later. For now, just assume it's a fresh start! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import io | ||
import json | ||
import os | ||
|
||
from flask import Flask, render_template, request | ||
|
||
app = Flask(__name__) | ||
|
||
common = { | ||
'first_name': 'Peter', | ||
'last_name': 'Parker', | ||
'alias': 'spiderman' | ||
} | ||
|
||
|
||
@app.route('/') | ||
def index(): | ||
return render_template('home.html', common=common) | ||
|
||
|
||
@app.route('/timeline') | ||
def timeline(): | ||
timeline = get_static_json("static/files/timeline.json") | ||
return render_template('timeline.html', common=common, timeline=timeline) | ||
|
||
|
||
@app.route('/reading') | ||
def reading(): | ||
data = get_static_json("static/files/reading.json") | ||
return render_template('reading.html', common=common, data=data) | ||
|
||
|
||
@app.route('/projects') | ||
def projects(): | ||
data = get_static_json("static/projects/projects.json")['projects'] | ||
data.sort(key=order_projects_by_weight, reverse=True) | ||
|
||
tag = request.args.get('tags') | ||
if tag is not None: | ||
data = [project for project in data if tag.lower() in [project_tag.lower() for project_tag in project['tags']]] | ||
|
||
return render_template('projects.html', common=common, projects=data, tag=tag) | ||
|
||
|
||
@app.route('/experiences') | ||
def experiences(): | ||
experiences = get_static_json("static/experiences/experiences.json")['experiences'] | ||
experiences.sort(key=order_projects_by_weight, reverse=True) | ||
return render_template('projects.html', common=common, projects=experiences, tag=None) | ||
|
||
|
||
def order_projects_by_weight(projects): | ||
try: | ||
return int(projects['weight']) | ||
except KeyError: | ||
return 0 | ||
|
||
|
||
@app.route('/projects/<title>') | ||
def project(title): | ||
projects = get_static_json("static/projects/projects.json")['projects'] | ||
experiences = get_static_json("static/experiences/experiences.json")['experiences'] | ||
|
||
in_project = next((p for p in projects if p['link'] == title), None) | ||
in_exp = next((p for p in experiences if p['link'] == title), None) | ||
|
||
if in_project is None and in_exp is None: | ||
return render_template('404.html'), 404 | ||
# fixme: choose the experience one for now, cuz I've done some shite hardcoding here. | ||
elif in_project is not None and in_exp is not None: | ||
selected = in_exp | ||
elif in_project is not None: | ||
selected = in_project | ||
else: | ||
selected = in_exp | ||
|
||
# load html if the json file doesn't contain a description | ||
if 'description' not in selected: | ||
path = "experiences" if in_exp is not None else "projects" | ||
selected['description'] = io.open(get_static_file( | ||
'static/%s/%s/%s.html' % (path, selected['link'], selected['link'])), "r", encoding="utf-8").read() | ||
return render_template('project.html', common=common, project=selected) | ||
|
||
|
||
@app.errorhandler(404) | ||
def page_not_found(e): | ||
return render_template('404.html', common=common), 404 | ||
|
||
|
||
def get_static_file(path): | ||
site_root = os.path.realpath(os.path.dirname(__file__)) | ||
return os.path.join(site_root, path) | ||
|
||
|
||
def get_static_json(path): | ||
return json.load(open(get_static_file(path))) | ||
|
||
|
||
if __name__ == "__main__": | ||
print("running py app") | ||
app.run(host="127.0.0.1", port=5000, debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="PYTHON_MODULE" version="4"> | ||
<component name="NewModuleRootManager"> | ||
<content url="file://$MODULE_DIR$" /> | ||
<orderEntry type="jdk" jdkName="Python 2.7 (portfolio)" jdkType="Python SDK" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
blinker==1.4 | ||
click==6.7 | ||
feedgen==0.9.0 | ||
Flask==1.0.0 | ||
Flask-HTTPAuth==3.2.3 | ||
Flask-Mail==0.9.1 | ||
Flask-SQLAlchemy==2.3.2 | ||
Flask-WTF==0.14.2 | ||
gunicorn==19.7.1 | ||
itsdangerous==0.24 | ||
Jinja2==2.11.3 | ||
MarkupSafe==1.1.1 | ||
SQLAlchemy==1.3.0 | ||
Werkzeug==0.16.0 | ||
WTForms==2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-3.6.13 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
body { | ||
height:100vh; | ||
font-family: 'Open Sans', sans-serif; | ||
} | ||
|
||
.navbar-ref { | ||
color: #808080; | ||
font-family: 'Open Sans', sans-serif; | ||
font-size: 16px; | ||
} | ||
|
||
.navbar-ul { | ||
background-color: white; | ||
display: flex; | ||
justify-content: flex-end; | ||
width: 100%; | ||
} | ||
|
||
.list-inline { | ||
display: flex; | ||
text-decoration: none; | ||
justify-content: space-around; | ||
margin:20px 0; | ||
width: 50%; | ||
} | ||
|
||
@media only screen and (max-width: 1094px) { | ||
.list-inline { | ||
width: 100%; | ||
} | ||
|
||
.navbar-ref { | ||
color: #808080; | ||
font-family: 'Open Sans', sans-serif; | ||
font-size: 14px; | ||
} | ||
|
||
} | ||
|
||
a::selection, | ||
span::selection { | ||
background: #ffb7b7; /* WebKit/Blink Browsers */ | ||
} | ||
|
||
a::selection, | ||
span::-moz-selection { | ||
background: #ffb7b7; /* Gecko Browsers */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#title { | ||
font-size: 1.2rem; | ||
font-weight: 300; | ||
} | ||
|
||
.icon { | ||
font-size: .9rem; | ||
display: inline-flex; | ||
background: #D8D8D8; | ||
border-radius: 3px; | ||
margin-right: 5px; | ||
margin-bottom: 15px; | ||
span { | ||
border-radius: 5px; | ||
padding: 3px 5px; | ||
}; | ||
} | ||
|
||
.react { | ||
background: #BAD5F5; | ||
span::after { | ||
content: "React.js"; | ||
} | ||
} | ||
|
||
.card { | ||
margin:10px; | ||
max-height: 325px; | ||
min-height: 325px; | ||
max-width: 320px; | ||
} | ||
|
||
.card-reveal .card-title { | ||
overflow: auto; | ||
white-space: normal; | ||
text-overflow: unset; | ||
} | ||
|
||
.md-chip-link { | ||
padding-left:8px; | ||
padding-right:8px; | ||
} | ||
|
||
.card-image { | ||
max-width:400px; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.card .card-image img.card-image { | ||
max-height: 180px; | ||
min-height: 180px; | ||
width: auto; | ||
} | ||
|
||
.status { | ||
color: #7699C2; | ||
} | ||
|
||
.card-title { | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.container-outer { | ||
overflow: hidden; | ||
} | ||
|
||
.container-inner { | ||
white-space: nowrap; | ||
overflow-y: hidden; | ||
overflow-x: scroll; | ||
/*kinda hacky solution to remove that ugly scrollbar*/ | ||
margin-bottom: -25px; /* maximum width of scrollbar */ | ||
padding-bottom: 25px; /* maximum width of scrollbar */ | ||
} |
Oops, something went wrong.