Commit b9d8562f authored by colmoneill's avatar colmoneill

All of todays work:

* A placing of the invetoryNb in the html on both loops, and some js to make hovering over one make the other highlight
* the InventoryNbs from Caramentis actually are troublesome for html and classnames as they are full of dots, so README update with some REGEX patters, this is not finished
* changing the project font to AntiqueNoble
* Interface JS for clocks, dates and page fillers
parent d4377aa7

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -39,3 +39,23 @@ To run the development version of the project:
<br>(the terminal will inform you of the starting of the app as well as development information)
* visit the site:
<br>open <http://localhost:5000> in your browser and you should see the web pages rendred
## REGEX memory:
The inventoryNb extracted from caramentis sometimes has the format nn.nnn which screws up my pattern recognition when needing to target similar items by class names. The actual dots in the strings confuse the dom and I'm not able to select the right classname. The regex below is to find and then replace these inventoryNbs in the .csv files to fix this issue.
```
FIND:
\,(\d+)\.(\d+)\,
REPLACE
,$1-$2,
FIND
\,(\d+)\.(\d+)\(\d+)\,
REPLACE
,$1-$2-$3,
FIND
\,(\D+)\.(\d+)\,
```
......@@ -9,6 +9,7 @@ print(thisdir)
uncertainlist = glob.glob('static/word_patterns/*.csv')
full_dict = {}
full_counter = 0
for file in uncertainlist:
filename = file.split('/')[2]
filename = filename.split('.')[0]
......@@ -18,8 +19,11 @@ for file in uncertainlist:
currentlist = []
for row in file:
currentlist.append(row)
full_counter += 1
full_dict[filename] = currentlist
print(full_counter)
@app.route("/")
def home():
print(full_dict)
......@@ -30,8 +34,10 @@ def home():
data_file = open('scrape_probabl.csv')
csv_file = csv.reader(data_file)
file = csv.reader(data_file)
for row in file:
print(row[11])
return render_template("index.html", full_dict=full_dict, uncertainlist=uncertainlist, csv_file=csv_file, file=file)
return render_template("index.html", full_dict=full_dict, uncertainlist=uncertainlist, csv_file=csv_file, file=file, full_counter=full_counter)
@app.route('/collection/<uncertain>')
def word_pattern(uncertain):
......
document.addEventListener("DOMContentLoaded",function(){console.log("document loaded"),$(".toggle-visible").click(function(){console.log(this),$(this).removeAttr("href"),$(this).next("div.commit-content").slideToggle()}),$(".more-commits").click(function(){$(this).removeAttr("href"),$("div.more-git-commits").slideToggle()}),$(".more-commits").click(function(){"↓ more commits"==$(this).text()?$(this).text("↑ less commits"):$(this).text("↓ more commits")}),$("#about").click(function(){$(this).removeAttr("href"),$("div.about").slideToggle()})});
\ No newline at end of file
var typed = new Typed('#main-title', {
strings: ['Collection of uncertainties ', 'Sammlung von Unsicherheiten', 'Collectie van onzekerheden', 'Collection des incertitudes'],
typeSpeed: 200,
backSpeed: 50,
cursorChar: '',
shuffle: true,
smartBackspace: true,
loop: true
});
$(".passepartout").hover(function(){
var itemNo = $(this).attr('class').split(' ')[1];
$("span." + itemNo).css("color", "yellow");
// console.log("hovering over "+ itemNo + "attempting to hightlight span" + itemNo);
$("#inventoryNb").html("current item: " + itemNo);
}, function(){
var itemNo = $(this).attr('class').split(' ')[1];
$("span." + itemNo).css("color", "black");
});
$("span.description").hover(function(){
// console.log("hovering over span.description")
var itemNo = $(this).attr('class').split(' ')[0];
// console.log(itemNo)
$(".passepartout " + itemNo).css("outline", "2px solid yellow");
}, function(){
var itemNo = $(this).attr('class').split(' ')[0];
$(".passepartout" + itemNo).css("outline", "none");
});
updateTime();
var update = setInterval(updateTime, 1000);
function updateTime(){
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
document.getElementById('time').innerHTML=time;
}
setDate();
function setDate(){
var today = new Date();
var date = today.getFullYear()+'/'+(today.getMonth()+1)+'/'+today.getDate();
document.getElementById('date').innerHTML=date;
}
......@@ -216,6 +216,11 @@ div.more-git-commits {
display: none;
}
.lower-nav {
position: fixed;
bottom: 50px;
}
/* ::Base styles */
/* ------------------------------------------------------------ */
html {
......@@ -241,25 +246,95 @@ a:hover, a:focus, a:active {
}
div.main-nav {
min-height: 8vh;
height: 8vh;
margin-top: 2.2em;
}
div.main-nav h1 {
text-align: center;
text-transform: uppercase;
font-weight: bold;
}
div.language-switcher {
position: absolute;
top: 2.2em;
right: 25px;
text-transform: uppercase;
font-family: propcouriersans-bold;
div.top-left-context, div.top-right-context {
position: fixed;
top: 20px;
}
div.top-left-context ul, div.top-right-context ul {
list-style-type: none;
}
div.top-left-context ul li, div.top-right-context ul li {
font-size: 1.6em !important;
margin: 0 !important;
margin-bottom: 0.4em;
}
div.top-left-context {
left: 20px;
}
img.thumbnail {
width: 100px;
height: auto;
div.top-right-context {
right: 20px;
text-align: right;
}
div.hp-half::-webkit-scrollbar {
width: 6px;
height: 6px;
}
div.hp-half::-webkit-scrollbar-track-piece {
background-color: #333333;
}
div.hp-half::-webkit-scrollbar-thumb:vertical {
height: 30px;
background-color: black;
}
div.hp-half {
position: fixed;
height: 75vh;
overflow-x: hidden;
overflow-y: scroll;
webkit-scrollbar-width: thin;
scrollbar-width: thin;
scrollbar-color: black #333333;
}
div.hp-half-left {
left: 20px;
width: 48%;
}
div.hp-half-right {
right: 20px;
width: 48%;
padding: 20px;
background-color: white;
}
div.hp-half-right div.text-container {
color: black;