diff --git a/content-script.js b/content-script.js index d6a09b7..d26d34f 100644 --- a/content-script.js +++ b/content-script.js @@ -1,142 +1,143 @@ // content.js // Injected on toolbar click. Exports current chat page to standalone HTML. -const TEMPLATE_HTML = ` - - - - - - {{title}} - - - -
-
-

{{title}}

-
Export time: {{exportTime}} GMT+8 | Platform: {{platform}}
+ /* Code block beautification(Darkboxstyle+title frame) */ + .code-block-box { + margin: 1.5em 0; + border-radius: 10px; + box-shadow: 0 2px 8px rgba(0,0,0,0.08); + background: #181c24; + border: 1px solid #23272f; + overflow: hidden; + } + .code-title-frame { + display: flex; + align-items: center; + justify-content: space-between; + background: #f5f6fa; + color: #23272f; + font-size: 13px; + font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', 'monospace'; + padding: 0.35em 1.1em 0.35em 1.1em; + border-bottom: 1px solid #e0e0e0; + border-radius: 10px 10px 0 0; + } + .code-lang-label { + font-weight: 600; + background: #23272f; + color: #e6eaf3; + opacity: 1; + letter-spacing: 0.5px; + border-radius: 5px; + padding: 0.15em 0.7em; + font-size: 90%; + margin-right: 0.5em; + display: inline-block; + } + .copy-button { + background: #e6eaf3; + color: #23272f; + border: none; + border-radius: 6px; + padding: 2px 12px; + font-size: 12px; + cursor: pointer; + opacity: 0.85; + transition: background 0.2s, opacity 0.2s; + z-index: 2; + } + .copy-button:hover { + background: #d3d7e3; + opacity: 1; + } + .code-block-box pre { + background: #181c24; + color: #e6eaf3; + border: none; + border-radius: 0 0 10px 10px; + margin: 0; + padding: 1em 1.2em; + font-size: 14px; + overflow-x: auto; + box-shadow: none; + } + .code-block-box code { + background: none; + color: inherit; + padding: 0; + border: none; + font-size: inherit; + } + code:not(pre code) { + background: #23272f; + color: #e6eaf3; + border-radius: 5px; + padding: 0.2em 0.4em; + font-size: 95%; + } + + + +
+
+

{{title}}

+
Export time: {{exportTime}} GMT+8 | Platform: {{platform}}
+
+ {{content}}
- {{content}} -
- - -`; + + + `; -(function() { function formatExportTime() { const now = new Date(); return now.toLocaleString('en-US', {