Skip to content
Snippets Groups Projects
Commit c53e8433 authored by Ismael Shaukat-Lopez's avatar Ismael Shaukat-Lopez
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
eShop.py 0 → 100644
from flask import Flask, render_template
app = Flask(__name__)
technologies = [
{ "name": "AK-47",
"price": "£120",
"description": "Russian manufactured rifle with high fire rate and penetration",
"image_filename": "ak47.png"},
{ "name": "M4A4",
"price": "£100",
"description": "Accurate rifle with a 70mm barrel and a telescoping stock",
"image_filename": "m4a4.png"},
{ "name": "M4A1-S",
"price": "£120",
"description": "M4A4 silenced counterpart with less recoil but smaller magazine size",
"image_filename": "m4a1s.png"}
]
@app.route('/')
def galleryPage():
return render_template('index.html', technologies = technologies)
@app.route('/tech/<int:techId>')
def singleProductPage(techId):
return render_template('SingleTech.html', technology = technologies[techId])
if __name__ == '__main__':
app.run(debug=True)
static/ak47.png

275 KiB

body, ul {
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background-color: #bb6e6e;
color: #333;
}
h1 {
text-align: center;
color: #333;
margin-top: 20px;
}
ul {
list-style-type: none;
margin: 0 auto;
max-width: 800px;
padding: 20px;
}
ul a {
display: block;
text-decoration: none;
color: #cb7b7b;
font-weight: bold;
padding: 10px;
border-radius: 5px;
background-color: #564949;
margin-bottom: 10px;
transition: background-color 0.3s;
}
ul a:hover {
background-color: #f2f2f2;
}
ul img {
display: block;
width: 100%;
height: auto;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin-bottom: 10px;
}
\ No newline at end of file
static/m4a1s.png

139 KiB

static/m4a4.png

329 KiB

<!DOCTYPE html>
<html>
<body>
<h1>{{ technology.name }}</h1>
<p>Price: {{ technology.price }}</p>
<p>{{ technology.description }}</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>THE COUNTER STRIKE ARMS SHOP</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>
<h1>THE COUNTER STRIKE ARMS SHOP</h1>
<ul>
{% for tech in technologies %}
<a href="{{ url_for('singleProductPage', techId=loop.index0) }}">{{ tech.name }}</a>
<img src="{{ url_for('static', filename=tech.image_filename) }}" alt="{{ tech.name }}">
{% endfor %}
</ul>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment