一为(onenav)主题导航 – 添加弹出问候语教程

效果展示 教程 代码添加路径:/wp-content/themes/onenav/footer.php #greetingBox { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 420px; text-align: center; z-index: 10000; pointer-events: none; font-family: 'Microsoft YaHei', sans-serif; .greeting { display: inline-block; position: relative; opacity: 0; top: -120px; padding: 12px 50px; border-radius: 30px; background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); color: #2c3e50; font-size: 15px; transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); margin: 8px 0; border: 1px solid rgba(255, 255, 255, 0.3); backdrop-filter: blur(6px); transform: scale(0.9); min-width: 280px; .greeting.shown { opacity: 1; top: 0; transform: scale(1); @keyframes float { % { transform: translateY(0px); } % { transform: translateY(-5px); } % { transform: translateY(0px); } (() => { const greetings = [ compliment: "太晚啦,还不睡的嘛!
太厉害了叭!", start_time: 0, end_time: 5 }, compliment: "早起的鸟儿有虫吃,您真自律呀!
", start_time: 6, end_time: 9 }, compliment: "状态很好,继续保持哦~", start_time: 10, end_time: 10 }, compliment: "坚持到现在很棒啦,准备吃午饭叭!
", start_time: 11, end_time: 11 }, compliment: "午休是充电的好时机呢!", start_time: 12, end_time: 14 }