text_fixes_v5
Browse files
app.py
CHANGED
@@ -55,12 +55,33 @@ def check_text(text, tool):
|
|
55 |
|
56 |
def main():
|
57 |
st.markdown("""
|
58 |
-
|
59 |
-
|
|
|
60 |
color: white;
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
st.title('Проверка орфографии')
|
65 |
text = st.text_area("Введите текст для проверки:", height=200)
|
66 |
tool = load_assets()
|
@@ -83,7 +104,7 @@ def main():
|
|
83 |
highlighted.append(html.escape(text[last_pos:error['start']]))
|
84 |
|
85 |
highlighted.append(
|
86 |
-
f'<span style="background-color: #ffe066; border-bottom: 2px dotted #
|
87 |
f'position: relative;" title="{html.escape(error["message"])}">'
|
88 |
f'{html.escape(text[error["start"]:error["end"]])}'
|
89 |
f'</span>'
|
@@ -101,7 +122,7 @@ def main():
|
|
101 |
border: 1px solid #ddd;
|
102 |
white-space: pre-wrap;
|
103 |
font-family: monospace;
|
104 |
-
color: #000000;
|
105 |
">
|
106 |
{''.join(highlighted)}
|
107 |
</div>
|
|
|
55 |
|
56 |
def main():
|
57 |
st.markdown("""
|
58 |
+
<style>
|
59 |
+
/* Сохраняем белый текст для темной темы */
|
60 |
+
.stApp, .stTextInput, .stTextArea, .stMarkdown {
|
61 |
color: white;
|
62 |
+
}
|
63 |
+
|
64 |
+
/* Специальный стиль для текста внутри выделенных ошибок */
|
65 |
+
.error-highlight {
|
66 |
+
background-color: #ffe066;
|
67 |
+
border-bottom: 2px dotted #ff9900;
|
68 |
+
position: relative;
|
69 |
+
color: black !important; /* Принудительно черный текст в выделениях */
|
70 |
+
}
|
71 |
+
|
72 |
+
/* Стиль для контейнера с результатом */
|
73 |
+
.result-container {
|
74 |
+
background: rgba(255, 255, 255, 0.1);
|
75 |
+
padding: 20px;
|
76 |
+
border-radius: 8px;
|
77 |
+
border: 1px solid #444;
|
78 |
+
white-space: pre-wrap;
|
79 |
+
font-family: monospace;
|
80 |
+
}
|
81 |
+
</style>
|
82 |
+
""", unsafe_allow_html=True)
|
83 |
+
|
84 |
+
|
85 |
st.title('Проверка орфографии')
|
86 |
text = st.text_area("Введите текст для проверки:", height=200)
|
87 |
tool = load_assets()
|
|
|
104 |
highlighted.append(html.escape(text[last_pos:error['start']]))
|
105 |
|
106 |
highlighted.append(
|
107 |
+
f'<span style="background-color: #ffe066; border-bottom: 2px dotted #ff9900; '
|
108 |
f'position: relative;" title="{html.escape(error["message"])}">'
|
109 |
f'{html.escape(text[error["start"]:error["end"]])}'
|
110 |
f'</span>'
|
|
|
122 |
border: 1px solid #ddd;
|
123 |
white-space: pre-wrap;
|
124 |
font-family: monospace;
|
125 |
+
color: #000000;
|
126 |
">
|
127 |
{''.join(highlighted)}
|
128 |
</div>
|