版本比较
【离线更新】洛谷随机跳题升级插件
正文
增加 18 行删除 17 行
633 行未改动全部展开6346356366376386386396406416421,393 行未改动全部展开2036203720382039204020412042204020412042204320442045204620472048205120492050205120522053345 行未改动全部展开239924002401240224052406240724082409241024112412241324142415240324042405240624072408240924102411241224132414241524162417241824192420142 行未改动全部展开2563256425652566256625672568256925702571639 行未改动全部展开633 行未改动全部展开 width: 300px; max-height: 480px; overflow-y: auto; border: 1px solid #eee; z-index: 10000; z-index: 2147483647; display: none; font-size: 13px; line-height: 1.5; color: #333;1,393 行未改动全部展开
function createFloatingPanel(button) { const panel = document.createElement('div'); panel.style.cssText = ` position: absolute; bottom: calc(100% + 10px); right: 0; position: fixed; background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 16px 18px; width: 300px; max-height: 480px; overflow-y: auto; border: 1px solid #eee; z-index: 10000; z-index: 2147483647; display: none; font-size: 13px; line-height: 1.5; color: #333;345 行未改动全部展开 let hoverTimeout = null; button.addEventListener('mouseenter', function() { clearTimeout(hoverTimeout); panel.style.display = 'block'; requestAnimationFrame(() => { const rect = button.getBoundingClientRect(); const panelRect = panel.getBoundingClientRect(); if (rect.top - panelRect.height < 10) { panel.style.bottom = 'auto'; panel.style.top = 'calc(100% + 10px)'; } else { panel.style.bottom = 'calc(100% + 10px)'; panel.style.top = 'auto'; } }); const rect = button.getBoundingClientRect(); const panelRect = panel.getBoundingClientRect(); let left = rect.right - panelRect.width; if (left < 10) left = 10; const maxLeft = window.innerWidth - panelRect.width - 10; if (left > maxLeft) left = maxLeft; let top = rect.top - panelRect.height - 10; if (top < 10) { top = rect.bottom + 10; } panel.style.left = left + 'px'; panel.style.top = top + 'px'; panel.style.bottom = 'auto'; panel.style.right = 'auto'; });
button.addEventListener('mouseleave', function(e) { hoverTimeout = setTimeout(() => {142 行未改动全部展开 difficulty: obj.difficulty, type: obj.type, tags: obj.tags || [] }); } catch (e) { /* ignore */ } } catch (e) {} } if (batch.length === 0) { if (end < total) importBatch(end); else resolve();639 行未改动全部展开