feat: add "Get Cookie" button next to GitHub icon
- Introduced a new green "Get Cookie" button to the UI. - Positioned the button to the right of the history button for easy access. - Implemented functionality to open the URL `https://chat.qwenlm.ai` in a new tab when the button is clicked. - Enhanced user experience by providing a direct link for users to obtain their cookie.
This commit is contained in:
parent
2f8f57ade7
commit
4e55b325e0
32
worker.js
32
worker.js
@ -1114,13 +1114,13 @@ function getHTML() {
|
||||
|
||||
' .github-link {',
|
||||
' position: fixed;',
|
||||
' right: 150px;', // 放在 token 设置按钮左边',
|
||||
' right: 150px;',
|
||||
' top: 20px;',
|
||||
' background: #333;', // GitHub 的深色背景',
|
||||
' background: #333;',
|
||||
' color: white;',
|
||||
' border: none;',
|
||||
' padding: 10px;',
|
||||
' border-radius: 50%;', // 圆形按钮',
|
||||
' border-radius: 50%;',
|
||||
' cursor: pointer;',
|
||||
' z-index: 1001;',
|
||||
' width: 40px;',
|
||||
@ -1132,7 +1132,7 @@ function getHTML() {
|
||||
' }',
|
||||
|
||||
' .github-link:hover {',
|
||||
' background: #24292e;', // GitHub hover 颜色',
|
||||
' background: #24292e;',
|
||||
' }',
|
||||
|
||||
' .github-icon {',
|
||||
@ -1178,10 +1178,34 @@ function getHTML() {
|
||||
' color: #3498db;',
|
||||
' font-family: monospace;',
|
||||
' word-break: break-all;',
|
||||
' }',
|
||||
|
||||
// 添加获取cookie按钮样式
|
||||
' .get-cookie-link {',
|
||||
' position: fixed;',
|
||||
' right: 200px;', // 放在github图标左边
|
||||
' top: 20px;',
|
||||
' background: #2ecc71;', // 使用不同的颜色区分
|
||||
' color: white;',
|
||||
' border: none;',
|
||||
' padding: 8px 15px;',
|
||||
' border-radius: 5px;',
|
||||
' cursor: pointer;',
|
||||
' z-index: 1001;',
|
||||
' text-decoration: none;',
|
||||
' font-size: 14px;',
|
||||
' transition: background 0.3s ease;',
|
||||
' }',
|
||||
|
||||
' .get-cookie-link:hover {',
|
||||
' background: #27ae60;',
|
||||
' }',
|
||||
'</style>',
|
||||
'</head>',
|
||||
'<body>',
|
||||
'<a href="https://chat.qwenlm.ai/" target="_blank" rel="noopener noreferrer" class="get-cookie-link">',
|
||||
' 获取Cookie',
|
||||
'</a>',
|
||||
'<a href="https://github.com/Cunninger/ocr-based-qwen" target="_blank" rel="noopener noreferrer" class="github-link" title="View on GitHub">',
|
||||
' <svg class="github-icon" viewBox="0 0 16 16" fill="currentColor">',
|
||||
' <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>',
|
||||
|
Loading…
x
Reference in New Issue
Block a user