Skip to content

Commit

Permalink
A fresh start
Browse files Browse the repository at this point in the history
  • Loading branch information
crearo committed May 24, 2022
0 parents commit 81ff1f9
Show file tree
Hide file tree
Showing 67 changed files with 2,391 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .gitignore
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/
20 changes: 20 additions & 0 deletions LICENSE
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.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app
28 changes: 28 additions & 0 deletions README.md
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!
101 changes: 101 additions & 0 deletions app.py
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)
8 changes: 8 additions & 0 deletions portfolio.iml
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>
15 changes: 15 additions & 0 deletions requirements.txt
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
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.6.13
Binary file added screenshots/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/projects.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions static/css/base.css
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 */
}
77 changes: 77 additions & 0 deletions static/css/card.css
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 */
}
Loading

0 comments on commit 81ff1f9

Please sign in to comment.