Compare commits
No commits in common. "2ca297e68c55dd61c543c94e3f7189311b454ad3" and "e1d4e4f683dd6732799c04f3d72e5810aada10c5" have entirely different histories.
2ca297e68c
...
e1d4e4f683
6
Book.py
6
Book.py
@ -1,12 +1,10 @@
|
|||||||
class Book:
|
class Book:
|
||||||
|
|
||||||
def __init__(self, name: str, description: str, image: str, review: str, release_date: str, reading_date: str) -> None:
|
def __init__(self, name: str, description: str, image: str, review: str) -> None:
|
||||||
self.name: str = name
|
self.name: str = name
|
||||||
self.description: str = description
|
self.description: str = description
|
||||||
self.image: str = image
|
self.image: str = image
|
||||||
self.review: str = review
|
self.review: str = review
|
||||||
self.release_date: str = release_date
|
|
||||||
self.reading_date: str = reading_date
|
|
||||||
|
|
||||||
def to_html(self) -> str:
|
def to_html(self) -> str:
|
||||||
return f"""
|
return f"""
|
||||||
@ -15,9 +13,7 @@ class Book:
|
|||||||
<td class="namedesc-div">
|
<td class="namedesc-div">
|
||||||
<p class="name">{self.name}</p>
|
<p class="name">{self.name}</p>
|
||||||
<p class="description">{self.description}</p>
|
<p class="description">{self.description}</p>
|
||||||
<p class="release-date">{self.release_date}</p>
|
|
||||||
</td>
|
</td>
|
||||||
<td class="review-div">{self.review}</td>
|
<td class="review-div">{self.review}</td>
|
||||||
<td class="reading-date">{self.reading_date}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
"""
|
"""
|
12
cast.html
12
cast.html
@ -11,16 +11,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>My Readings</h1>
|
<h1>My Readings</h1>
|
||||||
<table id="table">
|
<table id="table">
|
||||||
<thead>
|
{{books}}
|
||||||
<tr>
|
|
||||||
<th>Image</th>
|
|
||||||
<th>Name and description</th>
|
|
||||||
<th>My opignon</th>
|
|
||||||
<th>Reading date</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{{books}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
@ -4,9 +4,7 @@
|
|||||||
"name": "1984",
|
"name": "1984",
|
||||||
"description": "1984 est un roman dystopique de l'écrivain britannique George Orwell. Publié le 8 juin 1949 par Secker & Warburg, il s'agit du neuvième et dernier livre d'Orwell achevé de son vivant",
|
"description": "1984 est un roman dystopique de l'écrivain britannique George Orwell. Publié le 8 juin 1949 par Secker & Warburg, il s'agit du neuvième et dernier livre d'Orwell achevé de son vivant",
|
||||||
"image": "1984.jpg",
|
"image": "1984.jpg",
|
||||||
"review": "ct pas mal",
|
"review": "ct pas mal"
|
||||||
"reading_date": "08/2024",
|
|
||||||
"release_date": "08/06/1949"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
2
main.py
2
main.py
@ -15,7 +15,7 @@ books = data['books']
|
|||||||
html = ""
|
html = ""
|
||||||
|
|
||||||
for book_data in books:
|
for book_data in books:
|
||||||
book = Book(book_data["name"], book_data["description"], book_data["image"], book_data["review"], book_data["release_date"], book_data["reading_date"])
|
book = Book(book_data["name"], book_data["description"], book_data["image"], book_data["review"])
|
||||||
html += book.to_html()
|
html += book.to_html()
|
||||||
|
|
||||||
f = open("cast.html")
|
f = open("cast.html")
|
||||||
|
46
style.css
46
style.css
@ -1,47 +1,19 @@
|
|||||||
:root{
|
|
||||||
--bg1: #002b36;
|
|
||||||
--bg2: #073642;
|
|
||||||
--content1: #586e75;
|
|
||||||
--content2: #657b83;
|
|
||||||
--content3: #839496;
|
|
||||||
--content4: #93a1a1;
|
|
||||||
--lbg1: #eee8d5;
|
|
||||||
--lbg2: #fdf6e3;
|
|
||||||
}
|
|
||||||
|
|
||||||
table tbody tr:nth-child(odd){
|
|
||||||
background-color: var(--content1);
|
|
||||||
}
|
|
||||||
table tbody tr:nth-child(even) {
|
|
||||||
background-color: var(--content4);
|
|
||||||
}
|
|
||||||
|
|
||||||
body{
|
body{
|
||||||
background-color: var(--bg1);
|
background-color: #586e75;
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1, #table {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
#table {
|
||||||
border-collapse:collapse;
|
background-color: green;
|
||||||
background-color: var(--bg2);
|
|
||||||
}
|
|
||||||
|
|
||||||
thead {
|
|
||||||
background-color: var(--base1);
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody {
|
|
||||||
background-color: var(--base0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tr {
|
tr {
|
||||||
max-height: 250px;
|
max-height: 250px;
|
||||||
background-color: inherit;
|
background-color: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
@ -58,13 +30,9 @@ img {
|
|||||||
width: 30%;
|
width: 30%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.reading-date {
|
|
||||||
width: 5%;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
td {
|
||||||
text-align: center;
|
background-color: red;
|
||||||
background-color: none;
|
border: 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
|
Loading…
Reference in New Issue
Block a user