Spaces:
Sleeping
Sleeping
annotation app code-82b7d0ec0e7b
Browse files28 unmodified lines29303132333444 unmodified lines7980818283848515 unmodified lines10110210310410510610728 unmodified linesimport guide as G # noqa: E402CSS = """/* Each text is one card: its name is a header bar INSIDE the card's border, so a name can only belong to thetext it frames, even when the cards are stacked. */.ann-card { border: 2px solid var(--border-color-primary); border-radius: 8px; overflow: hidden; }44 unmodified lines# the frame and would loop) and asks iframe-resizer for that height whenever it changes.# It also scrolls back to the top whenever a new screen is shown (the progress line changes): the submit button is at# the bottom, so otherwise the next document opened on its last text and the questions, with "Document N" and the# first texts out of view.FRAME_FIT_JS = """<script>(function () {15 unmodified linesconst pif = window.parentIFrame;if (pif && pif.scrollToOffset) pif.scrollToOffset(0, 0);}new MutationObserver(() => { fit(); toTop(); }).observe(document.documentElement,{subtree: true, childList: true, attributes: true});window.addEventListener('resize', fit);setInterval(fit, 1000);28 unmodified lines2930313233343544 unmodified lines8081828384858615 unmodified lines10210310410510610710810911011111211311428 unmodified linesimport guide as G # noqa: E402CSS = """:root { color-scheme: light; } /* light theme only, see FRAME_FIT_JS *//* Each text is one card: its name is a header bar INSIDE the card's border, so a name can only belong to thetext it frames, even when the cards are stacked. */.ann-card { border: 2px solid var(--border-color-primary); border-radius: 8px; overflow: hidden; }44 unmodified lines# the frame and would loop) and asks iframe-resizer for that height whenever it changes.# It also scrolls back to the top whenever a new screen is shown (the progress line changes): the submit button is at# the bottom, so otherwise the next document opened on its last text and the questions, with "Document N" and the# first texts out of view. It also keeps the page in the light theme whatever the reader's dark-mode setting.FRAME_FIT_JS = """<script>(function () {15 unmodified linesconst pif = window.parentIFrame;if (pif && pif.scrollToOffset) pif.scrollToOffset(0, 0);}function light() {// always the light theme: the custom colours assume it, and gradio's dark mode (from the system setting or// the Space page) gave white text on white panelsfor (const el of [document.documentElement, document.body]) if (el && el.classList.contains('dark')) el.classList.remove('dark');}light();new MutationObserver(() => { light(); fit(); toTop(); }).observe(document.documentElement,{subtree: true, childList: true, attributes: true});window.addEventListener('resize', fit);setInterval(fit, 1000);
app.py+9-2