feat: Timestamps + LaTeX/KaTeX-Rendering im Chat
Timestamps (dd.MM.yyyy HH:mm:ss): - Neuer _formatTimestamp() + _addTimestamp() Helper in ui.js - Timestamp bei allen User- und Assistant-Nachrichten (live, history, archiv) - Erscheint on hover, halbtransparent, rechts oben an der Bubble LaTeX/Math-Rendering mit KaTeX 0.16.21: - KaTeX lokal eingebunden (JS + CSS + 21 woff2-Fonts) - renderMarkdown() schützt LaTeX vor Markdown-Parsing - $$...$$ → Block-Math (zentriert), $...$ → Inline-Math - Fehlerhafte Ausdrücke als <code> Fallback - KaTeX-Display Styling in markdown.css Weitere Änderungen: - theme.css: Neue --info Farbe - Blockquote-Styling: info-Farbe statt halbtransparent
This commit is contained in:
1 parent
dbeba6535a
commit
489b5e0eb0
29 files changed
+119
-11
No files matched your search
+11
-4
@@ -412,6 +412,7 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.msg-timestamp,
|
||||
.msg-reply-btn,
|
||||
.msg-delete-btn,
|
||||
.msg-mark-btn,
|
||||
@@ -420,12 +421,17 @@
|
||||
top: var(--badge-spacing);
|
||||
opacity: 0;
|
||||
transition: opacity var(--transition-duration);
|
||||
padding: .1em .3em;
|
||||
font-size: var(--font-size);
|
||||
background: var(--f2-bg);
|
||||
border: var(--border-width) solid var(--f2-border);
|
||||
border-radius: var(--border-radius);
|
||||
z-index: 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.msg-timestamp {
|
||||
padding: .25em .6em;
|
||||
border-radius: var(--border-radius);
|
||||
right: calc(var(--badge-spacing) + 8em + var(--badge-spacing) * 2);
|
||||
pointer-events: none;
|
||||
background: var(--f3-bg);
|
||||
}
|
||||
|
||||
.msg-reply-btn {
|
||||
@@ -444,6 +450,7 @@
|
||||
right: var(--badge-spacing);
|
||||
}
|
||||
|
||||
.msg:hover .msg-timestamp,
|
||||
.msg:hover .msg-reply-btn,
|
||||
.msg:hover .msg-delete-btn,
|
||||
.msg:hover .msg-mark-btn,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
Couldn't find the requested file /dist/fonts/KaTeX_Math-Regular.woff2 in katex.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
+1
@@ -0,0 +1 @@
|
||||
@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.21"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1pLine truncated
|
||||
@@ -84,10 +84,10 @@
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
border-left: 3px solid var(--f3-border);
|
||||
border-left: 3px solid var(--info);
|
||||
margin: 0 0 .5em 0;
|
||||
padding: .5em;
|
||||
opacity: var(--semi-transparent);
|
||||
color: var(--info);
|
||||
}
|
||||
|
||||
.markdown blockquote:last-child {
|
||||
@@ -134,6 +134,33 @@
|
||||
margin-right: .5em;
|
||||
}
|
||||
|
||||
/* KaTeX Math */
|
||||
|
||||
.markdown .katex-display {
|
||||
margin: .75em .25em;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
padding: .25em 0;
|
||||
text-align: left;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.markdown .katex-display:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown .katex-display:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.markdown .katex {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown .katex-error {
|
||||
color: var(--dangerous);
|
||||
}
|
||||
|
||||
/* Fluent Emoji */
|
||||
|
||||
img.fluent-emoji {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
--secondary: #4a1;
|
||||
--dangerous: #c53;
|
||||
--warning: #fa0;
|
||||
--info: #99c;
|
||||
--f1-bg: #111;
|
||||
--f1-border: #333;
|
||||
--f2-bg: #222;
|
||||
|
||||
Reference in new issue
Block a user