// ==UserScript== // @name BOSS海投助手 // @namespace https://github.com/yangshengzhou03 // @version 1.2.1 // @description 🚀 求职者自己的神器!🧑‍💻Yangshengzhou,提升BOSS直聘的简历投递效率,自动批量发送简历,高效求职 💼 // @author Yangshengzhou // @match https://www.zhipin.com/web/* // @grant GM_xmlhttpRequest // @run-at document-idle // @supportURL https://github.com/yangshengzhou03 // @homepageURL https://gitee.com/yangshengzhou // @license AGPL-3.0-or-later // 更多详情请参见: https://www.gnu.org/licenses/agpl-3.0.html // @icon https://static.zhipin.com/favicon.ico // @connect zhipin.com // @connect spark-api-open.xf-yun.com // @noframes // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js // @downloadURL https://update.greasyfork.icu/scripts/535470/BOSS%E6%B5%B7%E6%8A%95%E5%8A%A9%E6%89%8B.user.js // @updateURL https://update.greasyfork.icu/scripts/535470/BOSS%E6%B5%B7%E6%8A%95%E5%8A%A9%E6%89%8B.meta.js // ==/UserScript== (function () { 'use strict'; const CONFIG = { INTERVAL: 2500, CARD_STYLE: { BACKGROUND: '#ffffff', SHADOW: '0 6px 18px rgba(0,0,0,0.12)', BORDER: '1px solid #e4e7ed' }, COLORS: { PRIMARY: '#2196f3', SECONDARY: '#ff5722', NEUTRAL: '#95a5a6' }, MINI_ICON_SIZE: 40 }; const state = { isRunning: false, currentIndex: 0, filterKeyword: '', locationKeyword: '', jobList: [], isMinimized: false, processedHRs: new Set(JSON.parse(localStorage.getItem('processedHRs') || '[]')), currentTopHRKey: null, aiReplyCount: JSON.parse(localStorage.getItem('aiReplyCount') || 0), lastAiDate: localStorage.getItem('lastAiDate') || '' }; const elements = { panel: null, controlBtn: null, log: null, filterInput: null, miniIcon: null }; const UI = { createControlPanel() { if (document.getElementById('boss-pro-panel')) return; elements.panel = this._createPanel(); const header = this._createHeader(); const controls = this._createControls(); elements.log = this._createLogger(); const footer = this._createFooter(); elements.panel.append(header, controls, elements.log, footer); document.body.appendChild(elements.panel); this._makeDraggable(elements.panel); }, _createPanel() { const panel = document.createElement('div'); panel.id = 'boss-pro-panel'; panel.className = 'boss-pro-panel'; panel.style.cssText = `position: fixed;top: 36px;right: 24px;width: 380px;background: linear-gradient(145deg, #ffffff, #f9f9fc);border-radius: 16px;box-shadow: 0 10px 25px rgba(0,0,0,0.1);padding: 18px;font-family: 'Segoe UI', system-ui, sans-serif;z-index: 2147483647;cursor: move;display: flex;flex-direction: column;transition: all 0.3s ease;`; return panel; }, _createHeader() { const header = document.createElement('div'); header.className = 'boss-header'; header.style.cssText = `display: flex;justify-content: space-between;align-items: center;margin-bottom: 1.5rem;`; const title = document.createElement('div'); title.innerHTML = `

BOSS海投助手

v1.2-Beta (Professional)`; const closeBtn = this._createIconButton('✕', () => { state.isMinimized = true; elements.panel.style.transform = 'translateY(160%)'; elements.miniIcon.style.display = 'flex'; }); closeBtn.style.color = CONFIG.COLORS.NEUTRAL; header.append(title, closeBtn); return header; }, _createControls() { const container = document.createElement('div'); container.className = 'boss-controls'; container.style.marginBottom = '0.8rem'; const utilGroup = document.createElement('div'); utilGroup.className = 'boss-util-group'; utilGroup.style.cssText = `display: flex;gap: 10px;justify-content: flex-end;margin-top: 1rem;`; const clearLogBtn = this._createIconButton('🗑', () => { elements.log.innerHTML = `
Yangshengzhou:海投助手,工作我有。
`; }); const settingsBtn = this._createIconButton('⚙', () => { window.open('https://gitee.com/Yangshengzhou', '_blank') }); utilGroup.append(clearLogBtn, settingsBtn); const jobLabel = document.createElement('label'); jobLabel.textContent = '岗位名称:'; jobLabel.style.cssText = 'display:block; margin-bottom:0.5rem;'; elements.filterInput = document.createElement('input'); elements.filterInput.id = 'job-filter'; elements.filterInput.placeholder = '职位关键词(逗号分隔,为空则不限)'; elements.filterInput.className = 'boss-filter-input'; elements.filterInput.style.cssText = `width: calc(100%);padding: 12px 16px;border-radius: 10px;border: 2px solid #ddd;margin-bottom: 1rem;font-size: 14px;transition: border-color 0.3s ease;outline: none;`; elements.filterInput.addEventListener('focus', () => { elements.filterInput.style.borderColor = CONFIG.COLORS.PRIMARY; }); elements.filterInput.addEventListener('blur', () => { elements.filterInput.style.borderColor = '#ddd'; }); const locationLabel = document.createElement('label'); locationLabel.textContent = '工作地点:'; locationLabel.style.cssText = 'display:block; margin-bottom:0.5rem;'; elements.locationInput = document.createElement('input'); elements.locationInput.id = 'location-filter'; elements.locationInput.placeholder = '岗位地区(为空则不限)'; elements.locationInput.className = 'boss-filter-input'; elements.locationInput.style.cssText = `width: calc(100%);padding: 12px 16px;border-radius: 10px;border: 2px solid #ddd;margin-bottom: 1rem;font-size: 14px;transition: border-color 0.3s ease;outline: none;`; elements.locationInput.addEventListener('focus', () => { elements.locationInput.style.borderColor = CONFIG.COLORS.PRIMARY; }); elements.locationInput.addEventListener('blur', () => { elements.locationInput.style.borderColor = '#ddd'; }); elements.controlBtn = this._createTextButton('启动海投', `linear-gradient(45deg, ${CONFIG.COLORS.PRIMARY}, #4db6ac)`, () => { toggleProcess(); }); container.append(jobLabel, elements.filterInput, locationLabel, elements.locationInput, elements.controlBtn, utilGroup); return container; }, _createLogger() { const log = document.createElement('div'); log.id = 'pro-log'; log.className = 'boss-log'; log.style.cssText = `height: 200px;overflow-y: auto;background: #f8f9fa;border-radius: 10px;padding: 12px;border: 1px solid #eceff1;font-size: 13px;line-height: 1.5;margin-bottom: 1rem;transition: all 0.3s ease;user-select: text;`; log.innerHTML = `
请先BOSS初筛岗位列表。海投助手,工作我有!
`; return log; }, _createFooter() { const footer = document.createElement('div'); footer.textContent = '© 2025 Yangshengzhou · All Rights Reserved'; footer.style.cssText = `text-align: center;font-size: 0.8em;color: ${CONFIG.COLORS.NEUTRAL};padding-top: 10px;border-top: 1px solid #eee;margin-top: auto;transition: color 0.3s ease;`; return footer; }, _createTextButton(text, bgColor, onClick) { const btn = document.createElement('button'); btn.className = 'boss-btn'; btn.textContent = text; btn.style.cssText = `width: 100%;padding: 12px 16px;background: ${bgColor};color: #fff;border: none;border-radius: 10px;cursor: pointer;font-size: 15px;font-weight: 500;transition: all 0.3s ease;display: flex;justify-content: center;align-items: center;box-shadow: 0 4px 10px rgba(0,0,0,0.1);`; btn.addEventListener('click', onClick); btn.addEventListener('mouseenter', () => { btn.style.transform = 'scale(1.03)'; btn.style.boxShadow = '0 6px 15px rgba(0,0,0,0.15)'; }); btn.addEventListener('mouseleave', () => { btn.style.transform = 'scale(1)'; btn.style.boxShadow = '0 4px 10px rgba(0,0,0,0.1)'; }); return btn; }, _createIconButton(icon, onClick) { const btn = document.createElement('button'); btn.className = 'boss-icon-btn'; btn.innerHTML = icon; btn.style.cssText = `width: 36px;height: 36px;border-radius: 50%;border: none;background: #f0f0f0;cursor: pointer;font-size: 18px;transition: all 0.2s ease;display: flex;justify-content: center;align-items: center;color: ${CONFIG.COLORS.PRIMARY};transform: translateY(8px);`; btn.addEventListener('click', onClick); btn.addEventListener('mouseenter', () => { btn.style.backgroundColor = CONFIG.COLORS.PRIMARY; btn.style.color = '#fff'; btn.style.transform = 'translateY(8px) scale(1.1)'; }); btn.addEventListener('mouseleave', () => { btn.style.backgroundColor = '#f0f0f0'; btn.style.color = CONFIG.COLORS.PRIMARY; btn.style.transform = 'translateY(8px)'; }); return btn; }, _makeDraggable(panel) { const draggableAreaHeightRatio = 0.3; panel.addEventListener('mousemove', (e) => { const rect = panel.getBoundingClientRect(); const relativeY = e.clientY - rect.top; const draggableHeight = rect.height * draggableAreaHeightRatio; if (relativeY <= draggableHeight) { panel.style.cursor = 'move'; } else { panel.style.cursor = 'default'; } }); let isDragging = false; let startX = 0, startY = 0; let initialX = panel.offsetLeft, initialY = panel.offsetTop; panel.addEventListener('mousedown', (e) => { const rect = panel.getBoundingClientRect(); const relativeY = e.clientY - rect.top; const draggableHeight = rect.height * draggableAreaHeightRatio; if (relativeY <= draggableHeight) { isDragging = true; startX = e.clientX; startY = e.clientY; initialX = panel.offsetLeft; initialY = panel.offsetTop; panel.style.transition = 'none'; } }); document.addEventListener('mousemove', (e) => { if (!isDragging) return; const dx = e.clientX - startX; const dy = e.clientY - startY; panel.style.left = `${initialX + dx}px`; panel.style.top = `${initialY + dy}px`; panel.style.right = 'auto'; }); document.addEventListener('mouseup', () => { if (isDragging) { isDragging = false; panel.style.transition = 'all 0.3s ease'; } }); }, createMiniIcon() { elements.miniIcon = document.createElement('div'); elements.miniIcon.style.cssText = `width: ${CONFIG.MINI_ICON_SIZE}px;height: ${CONFIG.MINI_ICON_SIZE}px;position: fixed;bottom: 40px;left: 40px;background: linear-gradient(135deg, ${CONFIG.COLORS.PRIMARY}, #4db6ac);border-radius: 50%;box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);cursor: pointer;display: none;justify-content: center;align-items: center;color: #fff;font-size: 18px;z-index: 2147483647;transition: all 0.3s ease;overflow: hidden;text-align: center;line-height: 1;`; elements.miniIcon.innerHTML = '↗'; elements.miniIcon.addEventListener('mouseenter', () => { elements.miniIcon.style.transform = 'scale(1.1)'; elements.miniIcon.style.boxShadow = '0 8px 20px rgba(33, 150, 243, 0.5)'; }); elements.miniIcon.addEventListener('mouseleave', () => { elements.miniIcon.style.transform = 'scale(1)'; elements.miniIcon.style.boxShadow = '0 6px 16px rgba(33, 150, 243, 0.4)'; }); elements.miniIcon.addEventListener('click', () => { state.isMinimized = false; elements.panel.style.transform = 'translateY(0)'; elements.miniIcon.style.display = 'none'; }); document.body.appendChild(elements.miniIcon); } }; const Core = { async startProcessing() { if (location.pathname.includes('/jobs')) await this.autoScrollJobList(); while (state.isRunning) { if (location.pathname.includes('/jobs')) await this.processJobList(); else if (location.pathname.includes('/chat')) await this.handleChatPage(); await this.delay(CONFIG.INTERVAL); } }, async autoScrollJobList() { return new Promise((resolve) => { const cardSelector = 'li.job-card-box'; const maxHistory = 3; const waitTime = 600; let cardCountHistory = []; let isStopped = false; const scrollStep = async () => { if (isStopped) return; window.scrollTo({ top: document.documentElement.scrollHeight, behavior: 'smooth' }); await this.delay(waitTime); const cards = document.querySelectorAll(cardSelector); const currentCount = cards.length; cardCountHistory.push(currentCount); if (cardCountHistory.length > maxHistory) cardCountHistory.shift(); if (cardCountHistory.length === maxHistory && new Set(cardCountHistory).size === 1) { this.log("当前页面职位加载完成,开始沟通"); resolve(cards); return; } scrollStep(); }; scrollStep(); this.stopAutoScroll = () => { isStopped = true; resolve(null); }; }); }, async processJobList() { state.jobList = Array.from(document.querySelectorAll('li.job-card-box')).filter(card => { const title = card.querySelector('.job-name')?.textContent?.toLowerCase() || ''; const location = card.querySelector('.company-location')?.textContent?.toLowerCase().trim() || ''; const jobMatch = state.filterKeyword ? state.filterKeyword.split(',').some(kw => title.includes(kw.trim())) : true; const locationMatch = state.locationKeyword ? state.locationKeyword.split(',').some(kw => location.includes(kw.trim())) : true; return jobMatch && locationMatch; }); if (!state.jobList.length) { this.log('没有符合条件的职位'); toggleProcess(); return; } if (state.currentIndex >= state.jobList.length) { this.resetCycle(); return; } const currentCard = state.jobList[state.currentIndex]; currentCard.scrollIntoView({ behavior: 'smooth', block: 'center' }); currentCard.click(); this.log(`正在沟通:${++state.currentIndex}/${state.jobList.length}`); await this.delay(250); const chatBtn = document.querySelector('a.op-btn-chat'); if (chatBtn) { const btnText = chatBtn.textContent.trim(); if (btnText === '立即沟通') { chatBtn.click(); await this.handleGreetingModal(); } } }, async handleGreetingModal() { await this.delay(500); const btn = [...document.querySelectorAll('.default-btn.cancel-btn')].find(b => b.textContent.trim() === '留在此页'); if (btn) { btn.click(); await this.delay(500); } }, async handleChatPage() { const chatList = await this.waitForElement('ul'); if (!chatList) { this.log('没有聊天列表'); return; } const observer = new MutationObserver(async () => { await this.clickLatestChat(); }); observer.observe(chatList, { childList: true }); await this.clickLatestChat(); }, getLatestChatLi() { return document.querySelector('li[role="listitem"][class]:has(.friend-content-warp)'); }, async clickLatestChat() { try { const latestLi = await this.waitForElement(this.getLatestChatLi); if (!latestLi) return; const nameEl = latestLi.querySelector('.name-text'); const companyEl = latestLi.querySelector('.name-box span:nth-child(2)'); const name = (nameEl?.textContent || '未知').trim().replace(/\s+/g, ' '); const company = (companyEl?.textContent || '').trim().replace(/\s+/g, ' '); const hrKey = `${name}-${company}`.toLowerCase(); if (state.currentTopHRKey === hrKey) return; state.currentTopHRKey = hrKey; if (state.processedHRs.has(hrKey)) { this.log(`发过简历: ${name}${company ? ' - ' + company : ''}`); const avatar = latestLi.querySelector('.figure'); await this.simulateClick(avatar); latestLi.classList.add('last-clicked'); await this.aiReply(); return; } if (latestLi.classList.contains('last-clicked')) return; this.log(`开始介绍: ${name}${company ? ' - ' + company : ''}`); const avatar = latestLi.querySelector('.figure'); await this.simulateClick(avatar); latestLi.classList.add('last-clicked'); const isResumeSent = await this.processChatContent(); if (isResumeSent) { state.processedHRs.add(hrKey); localStorage.setItem('processedHRs', JSON.stringify([...state.processedHRs])); } } catch (error) { this.log(`沟通出错: ${error.message}`); } }, async aiReply() { try { await this.delay(100); const lastMessage = await this.getLastFriendMessageText(); if (!lastMessage) return false; this.log(`对方: ${lastMessage}`); if (state.aiReplyCount >= (function () { return [5, 10].reduce((a, b) => a + b); })()) { this.log([String.fromCharCode(0x4eca, 0x65e5, 0x41, 0x49, 0x56de, 0x590d, 0x5df2, 0x8fbe), String.fromCharCode(0x31, 0x35), String.fromCharCode(0x6b21, 0x4e0a, 0x9650, 0x2c, 0x8bfd, 0x5f00, 0x901a, 0x4f1a, 0x5458)].join('')); return false; } const aiReplyText = await this.requestAi(lastMessage); if (!aiReplyText) return false; this.log(`AI回复: ${aiReplyText.slice(0, 30)}...`); state.aiReplyCount++; localStorage.setItem('aiReplyCount', state.aiReplyCount); localStorage.setItem('lastAiDate', state.lastAiDate); const inputBox = await this.waitForElement('#chat-input'); if (!inputBox) return false; inputBox.textContent = ''; inputBox.focus(); document.execCommand('insertText', false, aiReplyText); await this.delay(120); const sendButton = document.querySelector('.btn-send'); if (sendButton) await this.simulateClick(sendButton); else { const enterKeyEvent = new KeyboardEvent('keydown', { key: 'Enter', keyCode: 13, code: 'Enter', which: 13, bubbles: true }); inputBox.dispatchEvent(enterKeyEvent); } return true; } catch (error) { this.log(`AI回复出错: ${error.message}`); return false; } }, async requestAi(a) { const b = (function () { const c = [0x73, 0x64, 0x56, 0x45, 0x44, 0x41, 0x42, 0x6a, 0x5a, 0x65, 0x49, 0x6b, 0x77, 0x58, 0x4e, 0x42, 0x46, 0x4e, 0x42, 0x73, 0x3a, 0x43, 0x71, 0x4d, 0x58, 0x6a, 0x71, 0x65, 0x50, 0x56, 0x43, 0x4a, 0x62, 0x55, 0x59, 0x4a, 0x50, 0x63, 0x69, 0x70, 0x4a]; return c.map(d => String.fromCharCode(d)).join(''); })(); const d = (function () { const e = '68747470733a2f2f737061726b2d6170692d6f70656e2e78662d79756e2e636f6d2f76312f636861742f636f6d706c6574696f6e73'; return e.replace(/../g, f => String.fromCharCode(parseInt(f, 16))); })(); const g = { model: 'lite', messages: [{ role: 'system', content: '你是一位真实的求职者,用口语化表达(如嗯、这个)和语气词(如啊、呢)自然对话,会轻微停顿,面对模糊问题会请求澄清,适当展现幽默,回复根据问题复杂度动态调整,允许不完美回答,避免机械性表述,回复内容不可太长。' }, { role: 'user', content: a }], temperature: 0.9, top_p: 0.8, max_tokens: 512 }; return new Promise((h, i) => { GM_xmlhttpRequest({ method: 'POST', url: d, headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + b }, data: JSON.stringify(g), onload: (j) => { console.log('API响应:', j.responseText); try { const k = JSON.parse(j.responseText); if (k.code !== 0) throw new Error('API错误: ' + k.message + '(Code: ' + k.code + ')'); h(k.choices[0].message.content.trim()); } catch (l) { i(new Error('响应解析失败: ' + l.message + '\n原始响应: ' + j.responseText)); } }, onerror: (m) => { i(new Error('网络请求失败: ' + m)); } }); }); }, async getLastFriendMessageText() { try { await this.delay(120); const chatContainer = document.querySelector('.chat-message .im-list'); if (!chatContainer) return null; const messageItems = Array.from(chatContainer.querySelectorAll('li.message-item')); const friendMessages = messageItems.filter(item => item.classList.contains('item-friend')); if (friendMessages.length === 0) return null; const lastFriendMessage = friendMessages[friendMessages.length - 1]; const spanEl = lastFriendMessage.querySelector('.text span'); if (!spanEl) return null; const textContent = spanEl.textContent.trim(); return textContent; } catch (error) { return null; } }, async processChatContent() { try { await this.delay(100); const dictBtn = await this.waitForElement('.btn-dict'); if (!dictBtn) { this.log('未找到常用语按钮'); return false; } await this.simulateClick(dictBtn); await this.delay(100); const dictList = await this.waitForElement('ul[data-v-8e790d94=""]'); if (!dictList) { this.log('未找到常用语列表'); return false; } const dictItems = dictList.querySelectorAll('li'); if (!dictItems || dictItems.length === 0) { this.log('常用语列表为空'); return false; } for (let i = 0; i < dictItems.length; i++) { const item = dictItems[i]; this.log(`发送常用语 ${i + 1}/${dictItems.length}`); await this.simulateClick(item); await this.delay(100); } const resumeBtn = await this.waitForElement(() => { return [...document.querySelectorAll('.toolbar-btn')].find(el => el.textContent.trim() === '发简历'); }); if (!resumeBtn) { this.log('无法发送简历'); return false; } if (resumeBtn.classList.contains('unable')) { this.log('对方未回复,您无权发送简历'); return false; } await this.simulateClick(resumeBtn); await this.delay(200); const confirmBtn = await this.waitForElement('span.btn-sure-v2'); if (!confirmBtn) { this.log('未找到发送按钮'); return false; } await this.simulateClick(confirmBtn); return true; } catch (error) { this.log(`处理出错: ${error.message}`); return false; } }, async simulateClick(element) { if (!element) return; const rect = element.getBoundingClientRect(); const x = rect.left + rect.width / 2; const y = rect.top + rect.height / 2; const dispatchMouseEvent = (type, options) => { const event = new MouseEvent(type, { bubbles: true, cancelable: true, view: document.defaultView, clientX: x, clientY: y, ...options }); element.dispatchEvent(event); }; dispatchMouseEvent('mouseover'); await this.delay(30); dispatchMouseEvent('mousemove'); await this.delay(30); dispatchMouseEvent('mousedown', { button: 0 }); await this.delay(30); dispatchMouseEvent('mouseup', { button: 0 }); await this.delay(30); dispatchMouseEvent('click', { button: 0 }); }, async waitForElement(selectorOrFunction, timeout = 5000) { return new Promise((resolve) => { if (typeof selectorOrFunction === 'function') { const element = selectorOrFunction(); if (element) return resolve(element); } else { const element = document.querySelector(selectorOrFunction); if (element) return resolve(element); } const timeoutId = setTimeout(() => { observer.disconnect(); resolve(null); }, timeout); const observer = new MutationObserver(() => { let element; if (typeof selectorOrFunction === 'function') element = selectorOrFunction(); else element = document.querySelector(selectorOrFunction); if (element) { clearTimeout(timeoutId); observer.disconnect(); resolve(element); } }); observer.observe(document.body, { childList: true, subtree: true }); }); }, async delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }, resetCycle() { toggleProcess(); this.log('所有职位沟通完成,恭喜你即将找到理想工作!'); state.currentIndex = 0; state.lastMessageTime = 0; }, log(message) { const logEntry = `[${new Date().toLocaleTimeString()}] ${message}`; const logPanel = document.querySelector('#pro-log'); if (logPanel) { const logItem = document.createElement('div'); logItem.className = 'log-item'; logItem.textContent = logEntry; logPanel.appendChild(logItem); logPanel.scrollTop = logPanel.scrollHeight; } } }; function toggleProcess() { state.isRunning = !state.isRunning; if (state.isRunning) { state.filterKeyword = elements.filterInput.value.trim().toLowerCase(); state.locationKeyword = elements.locationInput.value.trim().toLowerCase(); elements.controlBtn.textContent = '停止海投'; elements.controlBtn.style.backgroundColor = CONFIG.COLORS.SECONDARY; Core.startProcessing(); } else { elements.controlBtn.textContent = '启动海投'; elements.controlBtn.style.backgroundColor = CONFIG.COLORS.PRIMARY; state.isRunning = false; localStorage.removeItem('processedHRs'); state.processedHRs = new Set(); } } function showCustomAlert(message) { const overlay = document.createElement('div'); overlay.id = 'custom-alert-overlay'; overlay.style.cssText = `position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.5);display: flex;justify-content: center;align-items: center;z-index: 9999;backdrop-filter: blur(3px);animation: fadeIn 0.3s ease-out;`; const dialog = document.createElement('div'); dialog.id = 'custom-alert-dialog'; dialog.style.cssText = `background: white;border-radius: 16px;box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);width: 90%;max-width: 400px;overflow: hidden;transform: scale(0.95);animation: scaleIn 0.3s ease-out forwards;`; const header = document.createElement('div'); header.style.cssText = `padding: 16px 24px;background: #2196f3;color: white;font-size: 18px;font-weight: 500;display: flex;justify-content: space-between;align-items: center;`; header.innerHTML = ` BOSS海投助手 `; const content = document.createElement('div'); content.style.cssText = `padding: 24px;font-size: 16px;line-height: 1.8;color: #333;`; content.innerHTML = message.replace(/\n/g, '
'); const footer = document.createElement('div'); footer.style.cssText = `padding: 12px 24px;display: flex;justify-content: center;border-top: 1px solid #eee;`; const confirmBtn = document.createElement('button'); confirmBtn.style.cssText = `background: #2196f3;color: white;border: none;border-radius: 8px;padding: 10px 24px;font-size: 16px;cursor: pointer;transition: all 0.3s;box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);`; confirmBtn.textContent = '开始使用'; confirmBtn.addEventListener('click', () => { overlay.remove(); }); confirmBtn.addEventListener('mouseenter', () => { confirmBtn.style.transform = 'translateY(-2px)'; confirmBtn.style.boxShadow = '0 6px 16px rgba(33, 150, 243, 0.5)'; }); confirmBtn.addEventListener('mouseleave', () => { confirmBtn.style.transform = 'translateY(0)'; confirmBtn.style.boxShadow = '0 4px 12px rgba(33, 150, 243, 0.4)'; }); footer.appendChild(confirmBtn); dialog.appendChild(header); dialog.appendChild(content); dialog.appendChild(footer); overlay.appendChild(dialog); document.body.appendChild(overlay); const style = document.createElement('style'); style.textContent = `@keyframes fadeIn {from { opacity: 0; }to { opacity: 1; }}@keyframes scaleIn {from { transform: scale(0.95); opacity: 0; }to { transform: scale(1); opacity: 1; }}`; document.head.appendChild(style); } function showCustomAlert() { const o = document.createElement("div"); o.id = "custom-alert-overlay", o.style.cssText = "position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);display:flex;justify-content:center;align-items:center;z-index:9999;backdrop-filter:blur(5px);animation:fadeIn 0.3s ease-out"; const e = document.createElement("div"); e.id = "envelope-container", e.style.cssText = "position:relative;width:90%;max-width:500px;height:350px;perspective:1000px"; const t = document.createElement("div"); t.id = "envelope", t.style.cssText = "position:absolute;width:100%;height:100%;transform-style:preserve-3d;transition:transform 0.6s ease"; const n = document.createElement("div"); n.id = "envelope-back", n.style.cssText = "position:absolute;width:100%;height:100%;background:#f8f9fa;border-radius:10px;box-shadow:0 15px 35px rgba(0,0,0,0.2);backface-visibility:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;cursor:pointer;transition:all 0.3s", n.innerHTML = '
给求职者的一封信
点击加速您的求职之旅
© 2025 BOSS海投助手 | Yangshengzhou 版权所有
', n.addEventListener("click", () => { t.style.transform = "rotateY(180deg)", setTimeout(() => { document.getElementById("letter-content").style.display = "block", document.getElementById("letter-content").style.animation = "fadeInUp 0.5s ease-out forwards" }, 300) }); const r = document.createElement("div"); r.id = "envelope-front", r.style.cssText = "position:absolute;width:100%;height:100%;background:#fff;border-radius:10px;box-shadow:0 15px 35px rgba(0,0,0,0.2);transform:rotateY(180deg);backface-visibility:hidden;display:flex;flex-direction:column"; const l = document.createElement("div"); l.style.cssText = "padding:20px 30px;background:#2196f3;color:white;font-size:20px;font-weight:600;border-radius:10px 10px 0 0;display:flex;align-items:center", l.innerHTML = '给海投助手用户的一封信'; const d = document.createElement("div"); d.id = "letter-content", d.style.cssText = "flex:1;padding:30px;overflow-y:auto;font-size:16px;line-height:1.8;color:#333;background:url(\'https://picsum.photos/id/1068/1000/1000\') center/cover no-repeat;background-blend-mode:overlay;background-color:rgba(255,255,255,0.95)", d.innerHTML = '

亲爱的朋友:

  见字如面,展信佳。

  我是Yangshengzhou,一个找实习近乎崩溃的学生,也是该软件的作者。我还记得第一次投简历时的场景,期待、不安与憧憬。后来,无数深夜反复打磨简历、通勤路上刷招聘软件,效率低到崩溃——这便是海投助手诞生的初衷。

  经济下行,求职像在漫漫黑夜里跑马拉松。但请相信,你从来都不是孤军奋战。这个免费的小工具,愿能成为你路上的烛光:

  求职路上的每一次开始,都是向理想靠近的脚印。也许现在的你正迷茫,但那些看似波澜不惊的日复一日,终将某一天让你看见坚持的意义。

  点击"开始使用",把焦虑交给代码,把希望留给自己。愿你能收到心仪的offer,让所有努力都有回响。

2025年5月11日凌晨
Yangshengzhou
'; const c = document.createElement("div"); c.style.cssText = "padding:20px 30px;display:flex;justify-content:center;border-top:1px solid #eee;background:#f8f9fa;border-radius:0 0 10px 10px"; const i = document.createElement("button"); i.style.cssText = "background:linear-gradient(135deg,#2196f3,#1976d2);color:white;border:none;border-radius:8px;padding:12px 30px;font-size:16px;font-weight:500;cursor:pointer;transition:all 0.3s;box-shadow:0 6px 16px rgba(33,150,243,0.3);outline:none;display:flex;align-items:center", i.innerHTML = '开始使用', i.addEventListener("click", () => { e.style.animation = "scaleOut 0.3s ease-in forwards", o.style.animation = "fadeOut 0.3s ease-in forwards", setTimeout(() => { o.remove(), location.pathname.includes("/chat") && (UI.createControlPanel(), UI.createMiniIcon()) }, 300) }), c.appendChild(i), r.appendChild(l), r.appendChild(d), r.appendChild(c), t.appendChild(n), t.appendChild(r), e.appendChild(t), o.appendChild(e), document.body.appendChild(o); const s = document.createElement("style"); s.textContent = `@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes scaleOut{from{transform:scale(1);opacity:1}to{transform:scale(.9);opacity:0}}@keyframes fadeInUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}#envelope-back:hover{transform:translateY(-5px);box-shadow:0 20px 40px rgba(0,0,0,0.25)}#envelope-front button:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(33,150,243,0.4)}#envelope-front button:active{transform:translateY(1px)}`, document.head.appendChild(s) } function init() { const now = new Date(); const night = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0); const msToMidnight = night - now; setTimeout(() => { localStorage.removeItem('aiReplyCount'); localStorage.removeItem('lastAiDate'); }, msToMidnight); UI.createControlPanel(); UI.createMiniIcon(); document.body.style.position = 'relative'; if (location.pathname.includes('/jobs')) { window.open('https://www.zhipin.com/web/geek/chat', '_blank'); } else if (location.pathname.includes('/chat')) { showCustomAlert(); } } window.addEventListener('load', init); })();