Browse Source

unsure whether interface should look like this

master
crunk 4 years ago
parent
commit
1e714efb1d
  1. 11
      library/csvparser/csvparser.py
  2. 4
      library/static/css/dropdown.css
  3. 35
      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 import os
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
image_dir = os.path.abspath(os.path.join(script_dir, "../static/images"))
def parsecsv(): def parsecsv():
@ -23,17 +24,27 @@ def getpublications():
year = row["Year"] year = row["Year"]
if not year: if not year:
year = "Unknown" year = "Unknown"
pubinfo = { pubinfo = {
"Title": row["Publication"], "Title": row["Publication"],
"Author": row["Author"], "Author": row["Author"],
"Type": row["Type"].lower().title(), "Type": row["Type"].lower().title(),
"Year": year, "Year": year,
"License": row["LicenseShort"].lower().title(), "License": row["LicenseShort"].lower().title(),
"Image": hasimage(row["Id"])
} }
publications[row["Id"]] = pubinfo publications[row["Id"]] = pubinfo
return publications 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(): def gettypes():
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r") libcsv = open(os.path.join(script_dir, "varlib.csv"), "r")
with libcsv: with libcsv:

4
library/static/css/dropdown.css

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

35
library/static/css/style.css

@ -6,10 +6,8 @@ html, body {
body:after { body:after {
font-size: .8em; font-size: .8em;
background-color: #EB4377; background-color: #EB4377;
/*color: rgba(223, 183, 180, .3);*/
position: fixed; position: fixed;
width: 100%; width: 100%;
bottom: 1em;
text-align: center; text-align: center;
} }
@ -30,7 +28,7 @@ body:after {
#varia { #varia {
line-height: 1.03em; line-height: 1.03em;
position: absolute; position: relative;
top: 10%; top: 10%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
@ -40,19 +38,37 @@ body:after {
text-align: center; text-align: center;
font-family: alphaClouds; font-family: alphaClouds;
mix-blend-mode: exclusion; mix-blend-mode: exclusion;
margin: 30px 0;
} }
@supports (-webkit-text-stroke: 1px lightpink) { @supports (-webkit-text-stroke: 1px lightpink) {
#varia { #varia {
-webkit-text-stroke: 1px lightpink; -webkit-text-stroke: 1px lightpink;
} }
} }
.container { .container {
margin 0 auto; margin 0 auto;
} }
#leftmostbtn{ #bookshelf {
margin-left: 1em; 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 { button {
z-index: 10; z-index: 10;
border: 3px solid black; border: 3px solid black;
@ -70,9 +86,11 @@ table {
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
} }
tr { tr {
margin: 0; margin: 0;
} }
td { td {
margin:0; margin:0;
padding: 0.5em; padding: 0.5em;
@ -81,3 +99,10 @@ td {
border: 1px solid black; border: 1px solid black;
background-color: #f1f1f1; 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"> <div id="nav" class="container">
{% include 'menu.html' %} {% include 'menu.html' %}
</div> </div>
<div id="main"> <div id="bookshelf">
<ul>
{% for id, pubinfo in publications.items() %} {% 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%} {% endfor%}
</ul>
</div> </div>
<script src="{{ url_for('static', filename='js/dropdown.js')}}"></script> <script src="{{ url_for('static', filename='js/dropdown.js')}}"></script>
{% endblock %} {% endblock %}

Loading…
Cancel
Save