Browse Source

small style changes

master
Cristina Cochior 5 years ago
parent
commit
a4e95e34b3
  1. BIN
      .DS_Store
  2. BIN
      __pycache__/config.cpython-37.pyc
  3. BIN
      __pycache__/contextualise.cpython-37.pyc
  4. 18
      contextualise.py
  5. BIN
      fonts/SelectricMono.otf
  6. BIN
      fonts/whois-mono.ttf
  7. 25
      static/css/main.css
  8. 54
      templates/description.html
  9. 4
      templates/diverge.html
  10. 4
      templates/layout.html

BIN
.DS_Store

Binary file not shown.

BIN
__pycache__/config.cpython-37.pyc

Binary file not shown.

BIN
__pycache__/contextualise.cpython-37.pyc

Binary file not shown.

18
contextualise.py

@ -100,7 +100,7 @@ def home():
sessionid = "current_user.id" sessionid = "current_user.id"
#add the very first time of connection to the interface #add the very first time of connection to the interface
# if veryfirstnow is None : # if veryfirstnow is None :
session['veryfirstnow'] = datetime.now() session['veryfirstnow'] = datetime.now()
return render_template('home.html') return render_template('home.html')
def functionsession(): def functionsession():
return(session) return(session)
@ -130,6 +130,7 @@ def description():
#open json file, list filepaths in array and loop with thefile #open json file, list filepaths in array and loop with thefile
textfile="" textfile=""
textfiles=[]
with open("static/"+jsonfilefordescription, 'r') as f: with open("static/"+jsonfilefordescription, 'r') as f:
data_dict = json.load(f) data_dict = json.load(f)
datafromjson = data_dict["files"] datafromjson = data_dict["files"]
@ -139,12 +140,9 @@ def description():
if file.lower().endswith(('.html')): if file.lower().endswith(('.html')):
with open("static/"+file,"r", encoding='utf-8') as f: with open("static/"+file,"r", encoding='utf-8') as f:
textfile = f.read() textfile = f.read()
# wordlinked = "<a href='/diverge?search="+word+"'>"+word+"</a>"
# textfile = re.sub(word, wordlinked, textfile)
textfile = Markup(textfile) textfile = Markup(textfile)
textfiles.append(textfile)
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfiles=textfiles, idno=idno)
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile, idno=idno)
@app.route('/diverge', methods=['GET']) @app.route('/diverge', methods=['GET'])
def diverge(): def diverge():
@ -180,7 +178,7 @@ def get_file():
veryfirstnow = session['veryfirstnow'] veryfirstnow = session['veryfirstnow']
tadam = None tadam = None
for t in timelist : for t in timelist :
t = str(t) t = str(t)
yo = dt.datetime.strptime(t, '%Y-%m-%d %H:%M:%S.%f') yo = dt.datetime.strptime(t, '%Y-%m-%d %H:%M:%S.%f')
timelistforoperations.append(yo) timelistforoperations.append(yo)
@ -223,12 +221,12 @@ def get_file():
#If fullscore length superior 60 characters, insert linebreak #If fullscore length superior 60 characters, insert linebreak
# Defining splitting point # Defining splitting point
n = 60 n = 60
# Using list comprehension # Using list comprehension
out = [(fullscore[i:i+n]) for i in range(0, len(fullscore), n)] out = [(fullscore[i:i+n]) for i in range(0, len(fullscore), n)]
#joining the strings with linebreaks #joining the strings with linebreaks
tadam = '\n'.join(out) tadam = '\n'.join(out)
# have a message in file if no nav has been recorded so it's less dull than error page # have a message in file if no nav has been recorded so it's less dull than error page
if tadam is None: if tadam is None:
tadam = "This score is Null" tadam = "This score is Null"

BIN
fonts/SelectricMono.otf

Binary file not shown.

BIN
fonts/whois-mono.ttf

Binary file not shown.

25
static/css/main.css

@ -1,11 +1,21 @@
@font-face {
font-family: 'whois-mono';
src: url('../../fonts/whois-mono.ttf');
}
@font-face {
font-family: 'SelectricMono';
src: url('../../fonts/SelectricMono.otf');
}
body{ body{
background: #ffffff; background: #ffffff;
color:blue; color:blue;
font-family: 'whois-mono';
} }
a{ a{
/*text-decoration: none;*/ text-decoration: none;
} }
@ -19,9 +29,18 @@ li a{
li a:hover{ li a:hover{
color: orange; color: orange;
} }
img{ img{
max-width: 500px; max-width: 500px;
} }
div{
/* width: 80%; */
margin:0 auto;
padding: 1em 2em 1em;
}
.diverge{
margin-left: 1em;
}

54
templates/description.html

@ -3,40 +3,36 @@
<div class="description"> <div class="description">
<h2 style = "text-align: center;">{{ itemid }}</h2> <h2 style = "text-align: center;">{{ itemid }}</h2>
<!--passing files--> <!--passing files
<p>{{ datafromjson }}</p> <p>{{ datafromjson }}</p>-->
<div class="col-lg-3 col-md-4 col-xs-6 thumb"> <div class="col-lg-3 col-md-4 col-xs-6 thumb">
{% set count=[0] %}
{% for item in datafromjson %}
{% for item in datafromjson %} {% if item.lower().endswith(('.png', '.jpg', '.jpeg')) %}
<div>
<img class="img-responsive" src=" ../{{ item }}">
</div>
{% if item.lower().endswith(('.png', '.jpg', '.jpeg')) %} {% elif item.lower().endswith(('.mp4')) %}
<div> <div>
<img class="img-responsive" src=" ../{{ item }}"> <video width="320" height="240" controls><source src="../{{ item }}" type="video/mp4">Your browser does not support the video tag.</video>
</div> </div>
{% elif item.lower().endswith(('.mp4')) %} {% elif item.lower().endswith(('.mp3')) %}
<div><video width="320" height="240" controls><source src="../{{ item }}" type="video/mp4"> <div>
Your browser does not support the video tag. <audio controls><source src="../{{ item }}" type="audio/mpeg">Your browser does not support the audio tag.</audio>
</video> </div>
</div>
{% elif item.lower().endswith(('.mp3')) %} {% elif item.lower().endswith(('.html')) %}
<div><audio controls><source src="../{{ item }}" type="audio/mpeg"> {{ textfiles[count[0]] }}
Your browser does not support the audio tag. {% if count.append(count.pop() + 1) %}{% endif %}
</audio> <br/><br/><br/>
</div> {% endif %}
{% endif %}
{% endfor %} {% endfor %}
</div>
{% if textfile is defined %} {% endblock %}
{{ textfile }}
{% endif %}
</div>
{% endblock %}

4
templates/diverge.html

@ -8,9 +8,9 @@
{% for item in wordlist_dict[word] %} {% for item in wordlist_dict[word] %}
{% set address = "/description?id=" + item['id'] %} {% set address = "/description?id=" + item['id'] %}
<a href={{address}}> <a href={{address}} class="diverge">
{{ item['sentence'] }} {{ item['sentence'] }}
</a><br> </a><br/><br/><br/>
{% endfor %} {% endfor %}
{% endif %} {% endif %}

4
templates/layout.html

@ -2,10 +2,10 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>P.u.s.h.i.n.g.S.c.o.r.e.s</title> <title>P.u.s.h.i.n.g.S.c.o.r.e.s</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> -->
</head> </head>
<body> <body>
<header> <header>

Loading…
Cancel
Save