Skip to content

Commit 2963011

Browse files
committed
Add responsive CSS and Bootstrap to pages
1 parent 78361e7 commit 2963011

File tree

11 files changed

+57
-29
lines changed

11 files changed

+57
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $ API_KEY=<value>
7575
```
7676
$ python application.py
7777
```
78-
- Alternatively, execute (without debugging):
78+
- Alternatively, execute (with debugging):
7979
```
8080
$ export FLASK_APP=application.py
8181
$ flask run

static/styles.css

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ nav img
1010
width: 2rem;
1111
}
1212

13+
.navbar-nav {
14+
flex-direction: row;
15+
justify-content: space-around;
16+
}
17+
1318
.register
1419
{
1520
border-radius: 3rem;
@@ -45,28 +50,49 @@ main img
4550
background-color: transparent;
4651
}
4752

48-
footer
49-
{
50-
position: absolute;
51-
bottom: 0;
52-
width: 100%;
53-
height: 60px;
54-
line-height: 60px;
55-
text-align: center;
53+
#freepik_stories-investing {
54+
height: auto;
55+
width: auto;
56+
}
57+
58+
@media only screen and (min-width: 767.98px) {
59+
#freepik_stories-investing {
60+
width: 25rem;
61+
}
62+
}
63+
@media only screen and (min-width: 991.98px) {
64+
#freepik_stories-investing {
65+
width: auto;
66+
}
67+
}
68+
69+
70+
@media only screen and (min-width: 767.98px) {
71+
.footer {
72+
position: absolute;
73+
bottom: 0;
74+
width: 100%;
75+
}
5676
}
5777

5878
.background
5979
{
6080
position: absolute;
6181
z-index: -10;
62-
top: 0;
6382
right: 0;
6483
}
6584

6685
#home
6786
{
6887
width: 100vw;
6988
}
89+
@media only screen and (max-width: 767.98px) {
90+
#home
91+
{
92+
top: auto;
93+
transform: rotate(180deg);
94+
}
95+
}
7096

7197
.error {
7298
max-width: max-content;

templates/buy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% block main %}
88
<div class="container">
99
<div class="row">
10-
<div class="col-md-6 text-left">
10+
<div class="col-md-6 text-md-left mt-5">
1111
<h1>Buy</h1>
1212
<form action="/buy" method="post" class="mt-5">
1313
<div class="form-group">

templates/history.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
{% endblock %}
66

77
{% block main %}
8+
<div class="container">
89
<img src="../static/images/history.svg" class="background">
910
<h1>History</h1>
10-
<table class="table table-hover">
11+
<table class="table table-hover table-md-responsive">
1112
<tr class="thead-light">
1213
<th scope="col">Stocks</th>
1314
<th scope="col">Shares Bought</th>
@@ -38,4 +39,5 @@ <h1>History</h1>
3839
</tr>
3940
{% endfor %}
4041
</table>
42+
</div>
4143
{% endblock %}

templates/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
{% endblock %}
66

77
{% block main %}
8+
<div class="container">
89
<img src="../static/images/home.svg" class="background" id="home">
910
<h1>Home</h1>
10-
<table class="table table-hover">
11+
<table class="table table-hover table-md-responsive">
1112
<tr class="thead-light">
1213
<th scope="col">Stocks Owned</th>
1314
<th scope="col">Number of Shares</th>
@@ -35,4 +36,5 @@ <h1>Home</h1>
3536
<td><strong>{{ grand_total }}</strong></td>
3637
</tr>
3738
</table>
39+
</div>
3840
{% endblock %}

templates/landing.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

templates/layout.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<nav class="navbar navbar-expand-md navbar-light bg-light border">
3434
<a class="navbar-brand" href="/">Robynhood</a>
35-
<img src="../static/images/feather.svg">
35+
<img class="mr-auto" src="../static/images/feather.svg">
3636
<button aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler" data-target="#navbar" data-toggle="collapse" type="button">
3737
<span class="navbar-toggler-icon"></span>
3838
</button>
@@ -65,17 +65,15 @@
6565
</header>
6666
{% endif %}
6767

68-
<main class="container p-5">
68+
<main>
6969
{% block main %}{% endblock %}
7070
</main>
7171

7272
<footer class="footer">
73-
<div class="container">
74-
<span class="small mr-3">Copyright Jacob Grisham 2021</span>
75-
<span class="small text-muted">
76-
Data provided for free by <a href="https://iextrading.com/developer">IEX</a>. View <a href="https://iextrading.com/api-exhibit-a/">IEX’s Terms of Use</a>.
77-
</span>
78-
</div>
73+
<p class="small mr-3 text-muted text-center">Copyright Jacob Grisham 2021</p>
74+
<p class="small text-muted text-center">
75+
Data provided for free by <a href="https://iextrading.com/developer">IEX</a>. View <a href="https://iextrading.com/api-exhibit-a/">IEX’s Terms of Use</a>.
76+
</p>
7977
</footer>
8078

8179
</body>

templates/login.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

templates/quote.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% block main %}
88
<div class="container">
99
<div class="row">
10-
<div class="col-md-6 text-left">
10+
<div class="col-md-6 text-md-left mt-5">
1111
<h1>Enter a stock symbol to obtain the current price</h1>
1212
<form action="/quote" method="post" class="mt-5">
1313
<div class="form-group">

templates/register.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)