Browse Source

unsure whether interface should look like this

master
crunk 3 years ago
parent
commit
1e714efb1d
  1. 11
      library/csvparser/csvparser.py
  2. 4
      library/static/css/dropdown.css
  3. 37
      library/static/css/style.css
  4. BIN
      library/static/images/image-11.jpg
  5. BIN
      library/static/images/image-16.jpg
  6. BIN
      library/static/images/image-2.jpg
  7. BIN
      library/static/images/image-22.jpg
  8. BIN
      library/static/images/image-42.jpg
  9. BIN
      library/static/images/image-5.jpg
  10. BIN
      library/static/images/image-60.jpg
  11. BIN
      library/static/images/image-7.jpg
  12. BIN
      library/static/images/image-8.jpg
  13. 28
      library/templates/index.html

11
library/csvparser/csvparser.py

@ -5,6 +5,7 @@ import csv
import os
script_dir = os.path.dirname(__file__)
image_dir = os.path.abspath(os.path.join(script_dir, "../static/images"))
def parsecsv():
@ -23,17 +24,27 @@ def getpublications():
year = row["Year"]
if not year:
year = "Unknown"
pubinfo = {
"Title": row["Publication"],
"Author": row["Author"],
"Type": row["Type"].lower().title(),
"Year": year,
"License": row["LicenseShort"].lower().title(),
"Image": hasimage(row["Id"])
}
publications[row["Id"]] = pubinfo
return publications
def hasimage(id):
image_file = os.path.join(image_dir, "image-{0}.jpg".format(id))
if os.path.exists(image_file):
return True
else:
return False
def gettypes():
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r")
with libcsv:

4
library/static/css/dropdown.css

@ -9,6 +9,10 @@
background-color: #62b264;
}
#leftmostbtn{
margin-left: 1em;
}
.show {
display: block;
}

37
library/static/css/style.css

@ -6,10 +6,8 @@ html, body {
body:after {
font-size: .8em;
background-color: #EB4377;
/*color: rgba(223, 183, 180, .3);*/
position: fixed;
width: 100%;
bottom: 1em;
text-align: center;
}
@ -30,7 +28,7 @@ body:after {
#varia {
line-height: 1.03em;
position: absolute;
position: relative;
top: 10%;
left: 50%;
transform: translate(-50%, -50%);
@ -39,20 +37,38 @@ body:after {
font-size: 60px;
text-align: center;
font-family: alphaClouds;
mix-blend-mode: exclusion;
mix-blend-mode: exclusion;
margin: 30px 0;
}
@supports (-webkit-text-stroke: 1px lightpink) {
#varia {
-webkit-text-stroke: 1px lightpink;
}
}
.container {
margin 0 auto;
}
#leftmostbtn{
margin-left: 1em;
#bookshelf {
max-width: 90%;
margin-top: 3em;
display: block;
columns: 30rem;
gap: 1rem;
}
#bookshelf > div {
width: 100%;
break-inside: avoid;
margin: 10px auto;
}
#bookshelf > div > a {
color: black;
}
button {
z-index: 10;
border: 3px solid black;
@ -70,9 +86,11 @@ table {
border-spacing: 0;
border-collapse: collapse;
}
tr {
margin: 0;
}
td {
margin:0;
padding: 0.5em;
@ -81,3 +99,10 @@ td {
border: 1px solid black;
background-color: #f1f1f1;
}
.tdimage {
padding: 0
}
.tdimage > img {
width: 100%;
height: 100%;
}

BIN
library/static/images/image-11.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
library/static/images/image-16.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
library/static/images/image-2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
library/static/images/image-22.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
library/static/images/image-42.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
library/static/images/image-5.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

BIN
library/static/images/image-60.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
library/static/images/image-7.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

BIN
library/static/images/image-8.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

28
library/templates/index.html

@ -4,12 +4,32 @@
<div id="nav" class="container">
{% include 'menu.html' %}
</div>
<div id="main">
<ul>
<div id="bookshelf">
{% for id, pubinfo in publications.items() %}
<li class='filter {{ pubinfo["Type"] }} {{ pubinfo["Year"] }} {{ pubinfo["License"] }}'><a href='{{ id }}'>{{ pubinfo["Author"] }} - {{ pubinfo["Title"] }}</a></li>
<div class='book filter {{ pubinfo["Type"] }} {{ pubinfo["Year"] }} {{ pubinfo["License"] }}'>
<a href='{{ id }}'>
<table>
<tbody>
{%if pubinfo["Image"]%}
<tr>
<td colspan="2" class="tdimage">
<img src="{{ url_for('static', filename='images/image-{0}.jpg'.format(id))}}" alt="">
</td>
</tr>
{% endif %}
<tr>
<td>Author/Editor</td>
<td>{{ pubinfo["Author"] }}</td>
</tr>
<tr>
<td>Title</td>
<td>{{ pubinfo["Title"] }}</td>
</tr>
</tbody>
</table>
</a>
</div>
{% endfor%}
</ul>
</div>
<script src="{{ url_for('static', filename='js/dropdown.js')}}"></script>
{% endblock %}

Loading…
Cancel
Save