// ==UserScript==
// @name 2026国家智慧中小学暑期教师研修刷课提醒
// @namespace https://scriptcat.org/zh-CN/users/211466
// @version 1.0
// @description 秒刷、快速完成!
// @author 王二小
// @match https://basic.smartedu.cn/training/2026jjsqpx*
// @match https://basic.smartedu.cn/*
// @match https://teacher.ykt.eduyun.cn/*
// @icon https://img.icons8.com/color/96/000000/books.png
// @grant none
// @run-at document-end
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// 防止重复弹窗(可选用 sessionStorage 控制,这里简单判断)
if (window.__trainingReminderShown) return;
window.__trainingReminderShown = true;
// 创建弹窗容器
const dialog = document.createElement('div');
dialog.id = 'training-reminder-dialog';
dialog.style.cssText = `
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.6);
z-index: 999999;
display: flex;
align-items: center;
justify-content: center;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
`;
// 弹窗内容卡片
const card = document.createElement('div');
card.style.cssText = `
background: #ffffff;
border-radius: 12px;
padding: 32px 28px;
max-width: 420px;
width: 90%;
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
text-align: center;
position: relative;
animation: fadeInUp 0.3s ease;
`;
// 添加动画样式
const style = document.createElement('style');
style.textContent = `
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
`;
document.head.appendChild(style);
// 标题
const title = document.createElement('h3');
title.textContent = '📢 研修提醒';
title.style.cssText = `
margin: 0 0 16px 0;
font-size: 20px;
color: #1a1a1a;
font-weight: 700;
`;
// 正文
const content = document.createElement('p');
content.innerHTML = `
最后一天啦!
需要快速刷课?前往 脚本猫主页 安装你需要的脚本。
刷完课请记得 领取证书 哦 ✅
`;
content.style.cssText = `
margin: 0 0 24px 0;
font-size: 15px;
color: #444;
line-height: 1.7;
`;
// 跳转按钮
const goBtn = document.createElement('a');
goBtn.href = 'https://scriptcat.org/zh-CN/users/211466';
goBtn.target = '_blank';
goBtn.rel = 'noopener noreferrer';
goBtn.textContent = '前往脚本猫主页 🚀';
goBtn.style.cssText = `
display: inline-block;
background: #1677ff;
color: #fff;
text-decoration: none;
padding: 12px 28px;
border-radius: 8px;
font-size: 15px;
font-weight: 600;
transition: background 0.2s;
cursor: pointer;
`;
goBtn.addEventListener('mouseenter', () => { goBtn.style.background = '#0e5fd8'; });
goBtn.addEventListener('mouseleave', () => { goBtn.style.background = '#1677ff'; });
// 关闭按钮
const closeBtn = document.createElement('button');
closeBtn.textContent = '✕';
closeBtn.style.cssText = `
position: absolute;
top: 12px; right: 16px;
background: none;
border: none;
font-size: 18px;
color: #999;
cursor: pointer;
padding: 4px;
line-height: 1;
`;
closeBtn.addEventListener('click', () => {
dialog.remove();
});
closeBtn.addEventListener('mouseenter', () => { closeBtn.style.color = '#333'; });
closeBtn.addEventListener('mouseleave', () => { closeBtn.style.color = '#999'; });
// 点击遮罩层关闭
dialog.addEventListener('click', (e) => {
if (e.target === dialog) dialog.remove();
});
// 组装
card.appendChild(closeBtn);
card.appendChild(title);
card.appendChild(content);
card.appendChild(goBtn);
dialog.appendChild(card);
document.body.appendChild(dialog);
})();