Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
import hashlib
|
| 3 |
import urllib.parse
|
| 4 |
from datetime import datetime
|
|
@@ -33,7 +34,7 @@ def load_css():
|
|
| 33 |
color: black;
|
| 34 |
border: none;
|
| 35 |
padding: 0.5rem 1rem;
|
| 36 |
-
|
| 37 |
cursor: pointer;
|
| 38 |
font-size: 0.9rem;
|
| 39 |
margin-top: 0.5rem;
|
|
@@ -165,7 +166,10 @@ def live_clock():
|
|
| 165 |
const parts = formatter.formatToParts(now);
|
| 166 |
const date = `${parts[4].value}-${parts[2].value}-${parts[0].value}`;
|
| 167 |
const time = `${parts[6].value}:${parts[8].value}:${parts[10].value}`;
|
| 168 |
-
document.getElementById('live_datetime')
|
|
|
|
|
|
|
|
|
|
| 169 |
}
|
| 170 |
updateClock();
|
| 171 |
setInterval(updateClock, 1000);
|
|
@@ -211,7 +215,7 @@ with st.expander("About SCC and Example Citation"):
|
|
| 211 |
- Author: <code>Abuseif et al.</code><br>
|
| 212 |
- Year: <code>2025</code><br>
|
| 213 |
- URL: <code>https://www.sciencedirect.com/science/article/pii/S2772411523000046</code><br>
|
| 214 |
-
- Text: <code>A proposed design framework for green roof settings in general and trees on buildings</code
|
| 215 |
|
| 216 |
<strong>Output (HTML - example hash):</strong><br>
|
| 217 |
<div class="hash-display">
|
|
@@ -250,7 +254,7 @@ with tabs[0]:
|
|
| 250 |
|
| 251 |
# Live date and time display
|
| 252 |
st.markdown("### Current Date and Time")
|
| 253 |
-
|
| 254 |
|
| 255 |
# Get current date and time in Melbourne timezone for hash generation
|
| 256 |
melbourne_tz = pytz.timezone(MELBOURNE_TIMEZONE)
|
|
@@ -416,7 +420,7 @@ with tabs[1]:
|
|
| 416 |
"Year": verify_publication_year,
|
| 417 |
"URL": verify_source_url,
|
| 418 |
"Fragment text": verify_annotated_text,
|
| 419 |
-
"
|
| 420 |
"Username": verify_username,
|
| 421 |
"Task name": verify_task_name,
|
| 422 |
"Date": verify_date,
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
import hashlib
|
| 4 |
import urllib.parse
|
| 5 |
from datetime import datetime
|
|
|
|
| 34 |
color: black;
|
| 35 |
border: none;
|
| 36 |
padding: 0.5rem 1rem;
|
| 37 |
+
Updating: 4px;
|
| 38 |
cursor: pointer;
|
| 39 |
font-size: 0.9rem;
|
| 40 |
margin-top: 0.5rem;
|
|
|
|
| 166 |
const parts = formatter.formatToParts(now);
|
| 167 |
const date = `${parts[4].value}-${parts[2].value}-${parts[0].value}`;
|
| 168 |
const time = `${parts[6].value}:${parts[8].value}:${parts[10].value}`;
|
| 169 |
+
const datetimeElement = document.getElementById('live_datetime');
|
| 170 |
+
if (datetimeElement) {
|
| 171 |
+
datetimeElement.innerText = `${date} ${time}`;
|
| 172 |
+
}
|
| 173 |
}
|
| 174 |
updateClock();
|
| 175 |
setInterval(updateClock, 1000);
|
|
|
|
| 215 |
- Author: <code>Abuseif et al.</code><br>
|
| 216 |
- Year: <code>2025</code><br>
|
| 217 |
- URL: <code>https://www.sciencedirect.com/science/article/pii/S2772411523000046</code><br>
|
| 218 |
+
- Text: <code>A proposed design framework for green roof settings in general and trees on buildings</code怎么办
|
| 219 |
|
| 220 |
<strong>Output (HTML - example hash):</strong><br>
|
| 221 |
<div class="hash-display">
|
|
|
|
| 254 |
|
| 255 |
# Live date and time display
|
| 256 |
st.markdown("### Current Date and Time")
|
| 257 |
+
components.html(live_clock(), height=50)
|
| 258 |
|
| 259 |
# Get current date and time in Melbourne timezone for hash generation
|
| 260 |
melbourne_tz = pytz.timezone(MELBOURNE_TIMEZONE)
|
|
|
|
| 420 |
"Year": verify_publication_year,
|
| 421 |
"URL": verify_source_url,
|
| 422 |
"Fragment text": verify_annotated_text,
|
| 423 |
+
"Outlined text": verify_annotated_text,
|
| 424 |
"Username": verify_username,
|
| 425 |
"Task name": verify_task_name,
|
| 426 |
"Date": verify_date,
|