王者荣耀赔我的星星
前言
王者荣耀赔我的星星
前几天闲来无事 准备上号玩几把王者荣耀 一个晚上下来 看到战绩那一刻 天都塌了 一度怀疑是那天的运气不行 所以直接手搓一个黄历 来帮我算算今天宜不宜上分 自从用了这个再也不连跪了
一、功能
经过他的推算就能知道今天宜不宜上分 完美的避开了不好的日子 选择合适的日子在进去上分 给你推算出宜和忌 今日最佳的位置 以及最佳位置的最佳英雄
二、完整代码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>王者荣耀今日黄历</title>
<style>
body {
font-family: "Microsoft YaHei", sans-serif;
background: linear-gradient(135deg, #070B34, #1e3c72);
color: #fff;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
position: relative;
overflow-y: auto;
overflow-x: hidden;
margin: 0;
}
.copyright {
margin-top: 40px;
width: 100%;
backdrop-filter: blur(10px);
display: flex;
justify-content: center;
position: relative; /* 改为相对定位,不影响内容流 */
padding: 0;
box-sizing: border-box;
}
.footer-content {
max-width: 800px;
width: 90%;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
}
.footer-text {
font-size: 14px;
color: rgba(255, 255, 255, 0.8);
text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
position: relative;
padding: 0 20px;
}
.footer-logo {
font-size: 18px;
font-weight: bold;
background: linear-gradient(45deg, #ffd700, #ff6b6b, #4da6ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: 1px;
position: relative;
padding-left: 30px;
}
.footer-logo::before {
content: '👑';
position: absolute;
left: 0;
top: -2px;
animation: pulse 2s infinite;
}
.footer-decoration {
position: absolute;
height: 2px;
width: 150px;
background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.7), transparent);
top: -8px;
left: 50%;
transform: translateX(-50%);
}
.social-links {
display: flex;
gap: 15px;
}
.social-link {
width: 30px;
height: 30px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.1);
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.social-link:hover {
background: rgba(255, 255, 255, 0.2);
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.social-link::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(45deg, #ffd700, transparent);
opacity: 0;
transition: opacity 0.3s ease;
}
.social-link:hover::before {
opacity: 0.5;
}
.social-icon {
font-size: 16px;
color: white;
z-index: 1;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
@media (max-width: 768px) {
.footer-content {
flex-direction: column;
gap: 10px;
}
.social-links {
margin-top: 10px;
}
}
header {
text-align: center;
margin-bottom: 30px;
animation: fadeIn 1s ease;
position: relative;
z-index: 2;
}
h1 {
font-size: 2.5rem;
margin-bottom: 10px;
text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}
.container {
background-color: rgba(0, 0, 0, 0.5);
border-radius: 15px;
padding: 30px;
width: 90%;
max-width: 600px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
text-align: center;
position: relative;
overflow: visible;
z-index: 2;
backdrop-filter: blur(5px);
margin-top: 30px;
}
.fortune-card {
background: linear-gradient(145deg, #2a4d7f, #1a3056);
border-radius: 10px;
padding: 20px;
margin-top: 20px;
position: relative;
transition: transform 0.5s ease;
}
.fortune-card.animate {
animation: cardFlip 1s ease;
}
.result-container {
margin-top: 20px;
}
.result-title {
font-size: 1.8rem;
margin-bottom: 15px;
color: #ffd700;
}
.fortune-result {
font-size: 2.5rem;
font-weight: bold;
margin-bottom: 20px;
text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}
.fortune-details {
font-size: 1.2rem;
line-height: 1.6;
margin-bottom: 20px;
}
.luck-meter {
height: 30px;
background-color: rgba(255, 255, 255, 0.2);
border-radius: 15px;
margin: 20px 0;
position: relative;
overflow: hidden;
}
.luck-fill {
height: 100%;
background: linear-gradient(90deg, #ff416c, #ff4b2b);
border-radius: 15px;
width: 0%;
transition: width 1.5s ease-in-out;
}
.lucky-heroes {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
margin-top: 20px;
}
.hero {
background-color: rgba(255, 255, 255, 0.1);
padding: 8px 15px;
border-radius: 20px;
display: inline-block;
animation: fadeInUp 0.5s ease forwards;
opacity: 0;
}
button {
background: linear-gradient(to right, #ffd700, #ff8c00);
border: none;
color: #fff;
padding: 12px 30px;
font-size: 1.2rem;
border-radius: 30px;
cursor: pointer;
margin-top: 30px;
transition: all 0.3s ease;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}
#back-button {
background: linear-gradient(to right, #3498db, #2980b9);
display: none;
}
button:hover {
transform: translateY(-3px);
box-shadow: 0 7px 20px rgba(255, 215, 0, 0.6);
}
button:active {
transform: translateY(1px);
}
.crown {
position: absolute;
top: -30px;
left: 50%;
transform: translateX(-50%);
font-size: 3rem;
color: gold;
text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
animation: floating 3s ease-in-out infinite;
z-index: 3;
}
.stars {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
z-index: 0;
/* 降低z-index确保在内容后面 */
}
.star {
position: absolute;
background-color: #fff;
width: 2px;
height: 2px;
border-radius: 50%;
animation: twinkle 1.5s infinite;
opacity: 0;
}
.star.medium {
width: 3px;
height: 3px;
box-shadow: 0 0 4px #fff;
}
.star.large {
width: 4px;
height: 4px;
box-shadow: 0 0 6px 1px #fff;
}
.meteor {
position: absolute;
width: 2px;
height: 2px;
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
animation: meteor 10s linear infinite;
transform: rotate(-45deg);
box-shadow: 0 0 10px 4px white;
opacity: 0;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes cardFlip {
0% {
transform: rotateY(0deg);
}
50% {
transform: rotateY(90deg);
}
100% {
transform: rotateY(0deg);
}
}
@keyframes floating {
0% {
transform: translate(-50%, 0px);
}
50% {
transform: translate(-50%, -15px);
}
100% {
transform: translate(-50%, 0px);
}
}
@keyframes twinkle {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes meteor {
0% {
transform: translateX(0) translateY(0) rotate(-45deg);
width: 0;
opacity: 0;
}
1% {
opacity: 1;
width: 100px;
}
10% {
transform: translateX(-500px) translateY(500px) rotate(-45deg);
opacity: 0;
}
100% {
transform: translateX(-500px) translateY(500px) rotate(-45deg);
opacity: 0;
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>
</head>
<body>
<header>
<h1>王者荣耀今日运势</h1>
<p>看看今天宜不宜上分?</p>
</header>
<div class="stars" id="stars-container"></div> <!-- 将星空容器移到body的直接子元素 -->
<div class="container">
<div class="crown">👑</div>
<h2>今日运势</h2>
<p id="current-date"></p>
<div class="fortune-card">
<div class="stars" id="stars-container"></div>
<div class="result-title">上分指数</div>
<div class="fortune-result" id="fortune-result">?</div>
<div class="luck-meter">
<div class="luck-fill" id="luck-fill"></div>
</div>
<div class="fortune-details" id="fortune-details">
点击下方按钮查看今日运势
</div>
<div class="result-container">
<div class="lucky-heroes" id="lucky-heroes"></div>
</div>
</div>
<button id="check-fortune">查看运势</button>
<button id="back-button">返回</button>
</div>
<script>
// 设置当前日期
const currentDate = new Date();
const options = { year: 'numeric', month: 'long', day: 'numeric', weekday: 'long' };
document.getElementById('current-date').textContent = currentDate.toLocaleDateString('zh-CN', options);
// 英雄池按位置分类
const hero = {
"上路": ["白起", "曹操", "嫦娥", "程咬金", "大司命", "达摩", "貂蝉", "东皇大一", "关羽",
"海诺", "花木兰", "姬小满", "橘右京", "铠", "老夫子", "狂铁", "廉颇", "刘邦", "李信",
"吕布", "梦奇", "马超", "蒙恬", "芈月", "哪吒", "盘古", "曜", "司空震", "苏烈", "孙策", "夏洛特", "夏侯惇", "项羽", "亚连", "杨戬",
"亚瑟", "影", "元哥", "元流之子(坦克)", "赵怀真", "钟无艳", "猪八戒"],
"中路": ["安琪拉", "扁鹊", "不知火舞", "嫦娥", "妲己", "大乔", "貂蝉", "干将莫邪", "高渐离", "海诺",
"海月", "姜子牙", "金蝉", "米莱狄", "墨子", "女娲", "上官婉儿", "沈梦溪", "司马懿",
"王昭君", "武则天", "小乔", "元流之子(法师)", "西施", "杨玉环", "嬴政", "弈星", "张良", "甄姬", "周瑜", "诸葛亮",],
"下路": ["孙尚香", "鲁班七号", "狄仁杰", "马可波罗", "虞姬", "后羿", "李元芳", "百里守约", "伽罗",
"蒙犽", "戈娅", "莱西奥", "熬隐", "苍", "阿古朵", "黄忠", "艾琳", "公孙离"],
"打野": ["阿古朵", "阿轲", "百里玄策", "苍", "曹操", "嫦娥", "大司命", "典韦", "暃", "宫本武藏", "韩信",
"镜", "橘右京", "凯", "澜", "兰陵王", "李白", "刘备", "李元芳", "露娜", "马超", "梦奇", "芈月", "娜可露露",
"哪吒", "盘古", "裴擒虎", "司空震", "司马懿", "孙策", "孙悟空", "夏侯惇", "雅典娜", "杨戬", "杨玉环", "曜", "亚瑟", "影", "元流之子",
"云缨", "云中君", "赵怀真", "赵云", "钟无艳", "猪八戒", "诸葛亮"],
"辅助": ["庄周", "刘禅", "孙膑", "白起", "鬼谷子", "牛魔", "太乙真人", "蔡文姬", "东皇太一", "盾山",
"明世隐", "瑶", "鲁班大师", "桑启", "朵莉亚", "少司缘", "廉颇", "金禅", "苏烈", "墨子", "王昭君", "钟馗", "赵怀真",
"大乔", "项羽", "夏侯惇", "杨玉环", "张良", "刘邦", "姜子牙"]
};
// 位置类型
const positions = ["上路", "中路", "下路", "打野", "辅助"];
// 幸运事件
const luckyEvents = [
"遇到友好队友", "反野成功", "精彩团战", "成功翻盘", "连续超神",
"成功抢龙", "意识超前", "正反馈循环", "熟练度提升", "默契配合",
"连续抓人成功", "一波团灭", "顺利四包二", "顺风开局", "稳健发育",
"抓单击杀", "信号沟通到位", "辅助保人到位", "视野控制完美", "蓝区入侵成功",
"节奏把控完美", "完美卡视野", "预判技能命中", "极限逃生", "资源转换到位",
"中路完美游走", "顺利偷家", "带线推塔", "完美绕后", "节奏把控到位",
"技能无缝衔接", "经济领先", "红蓝双BUFF", "团队协作默契", "成功偷入敌方主宰",
"集中火力速秒", "打野节奏起飞", "补刀领先", "秀得飞起", "遇到大神带飞",
"连续三杀", "成功逆风翻盘", "边路单带成功", "指挥配合默契", "团灭对面"
];
// 不幸事件
const unluckyEvents = [
"队友掉线", "水晶被偷家", "被抢龙", "gank被秒", "被连续针对",
"意见不合", "操作失误", "装备落后", "被同样英雄压制", "团战失误",
"卡顿掉帧", "信号不佳", "被辅助抢人头", "被冤枉演员", "被队友坑",
"被对面秀", "无人保护后排", "不当谨慎团灭", "四包二失败", "视野差",
"陷入消极情绪", "阵容缺少坦克", "前期压制失败", "后期被翻盘", "被暴打出阴影",
"信号不同步", "队友不听指挥", "贸然开团", "阵容劣势", "意识不同步",
"前排强开", "后排被切", "走位失误", "操作延迟", "对线被压制",
"装备成型慢", "经济劣势", "上单被压制打不出节奏", "陷入恶性循环", "走位消极被杀",
"孤立无援", "攻速不足", "伤害不够", "血量太少", "对面大乱斗"
];
// 创建星星
function createStars() {
const starsContainer = document.getElementById('stars-container');
starsContainer.innerHTML = ''; // 清除可能存在的星星
const starsCount = 200; // 再增加星星数量
for (let i = 0; i < starsCount; i++) {
const star = document.createElement('div');
star.classList.add('star');
// 随机星星大小
const sizeRandom = Math.random();
if (sizeRandom > 0.9) {
star.classList.add('large');
} else if (sizeRandom > 0.7) {
star.classList.add('medium');
}
// 随机位置
const left = Math.random() * 100;
const top = Math.random() * 100;
star.style.left = `${left}%`;
star.style.top = `${top}%`;
// 随机动画延迟
const delay = Math.random() * 3;
star.style.animationDelay = `${delay}s`;
// 随机动画持续时间
const duration = Math.random() * 2 + 1;
star.style.animationDuration = `${duration}s`;
starsContainer.appendChild(star);
}
// 添加流星
createMeteors(starsContainer);
}
// 创建流星
function createMeteors(container) {
const meteorCount = 5;
for (let i = 0; i < meteorCount; i++) {
const meteor = document.createElement('div');
meteor.classList.add('meteor');
// 随机位置
const left = Math.random() * 100;
const top = Math.random() * 40; // 从上方40%的区域出现
meteor.style.left = `${left}%`;
meteor.style.top = `${top}%`;
// 随机动画延迟
const delay = Math.random() * 15;
meteor.style.animationDelay = `${delay}s`;
container.appendChild(meteor);
}
}
// 检查运势
function checkFortune() {
// 隐藏查看按钮,显示返回按钮
document.getElementById('check-fortune').style.display = 'none';
document.getElementById('back-button').style.display = 'inline-block';
const fortuneCard = document.querySelector('.fortune-card');
fortuneCard.classList.add('animate');
setTimeout(() => {
// 随机生成今日运势
const luckScore = Math.floor(Math.random() * 101);
const luckFill = document.getElementById('luck-fill');
const fortuneResult = document.getElementById('fortune-result');
const fortuneDetails = document.getElementById('fortune-details');
const luckyHeroes = document.getElementById('lucky-heroes');
// 清空之前的结果
luckyHeroes.innerHTML = '';
// 设置运势等级
let resultText, resultColor;
if (luckScore >= 80) {
resultText = "极度宜上分";
resultColor = "#ff4500";
} else if (luckScore >= 60) {
resultText = "宜上分";
resultColor = "#ffa500";
} else if (luckScore >= 40) {
resultText = "中规中矩";
resultColor = "#ffff00";
} else if (luckScore >= 20) {
resultText = "慎重上分";
resultColor = "#adff2f";
} else {
resultText = "那么菜就别玩了吧";
resultColor = "#ff0000";
}
fortuneResult.textContent = resultText;
fortuneResult.style.color = resultColor;
// 设置幸运值条
luckFill.style.width = `${luckScore}%`;
if (luckScore >= 60) {
luckFill.style.background = "linear-gradient(90deg, #00ff00, #7cfc00)";
} else if (luckScore >= 40) {
luckFill.style.background = "linear-gradient(90deg, #ffff00, #ffd700)";
} else {
luckFill.style.background = "linear-gradient(90deg, #ff0000, #ff6347)";
}
// 生成运势详情
let details = "";
if (luckScore >= 50) {
// 添加幸运事件
const luckyCount = Math.floor(Math.random() * 3) + 1;
const selectedLuckyEvents = [];
for (let i = 0; i < luckyCount; i++) {
let randomEvent;
do {
randomEvent = luckyEvents[Math.floor(Math.random() * luckyEvents.length)];
} while (selectedLuckyEvents.includes(randomEvent));
selectedLuckyEvents.push(randomEvent);
}
details += "<strong>宜:</strong>" + selectedLuckyEvents.join(",") + "<br><br>";
// 可能有一些不宜事件
if (Math.random() > 0.7) {
const unluckyEvent = unluckyEvents[Math.floor(Math.random() * unluckyEvents.length)];
details += "<strong>忌:</strong>" + unluckyEvent + "<br><br>";
}
} else {
// 添加不幸事件
const unluckyCount = Math.floor(Math.random() * 3) + 1;
const selectedUnluckyEvents = [];
for (let i = 0; i < unluckyCount; i++) {
let randomEvent;
do {
randomEvent = unluckyEvents[Math.floor(Math.random() * unluckyEvents.length)];
} while (selectedUnluckyEvents.includes(randomEvent));
selectedUnluckyEvents.push(randomEvent);
}
details += "<strong>忌:</strong>" + selectedUnluckyEvents.join(",") + "<br><br>";
// 可能有一些宜事件
if (Math.random() > 0.7) {
const luckyEvent = luckyEvents[Math.floor(Math.random() * luckyEvents.length)];
details += "<strong>宜:</strong>" + luckyEvent + "<br><br>";
}
}
// 随机选择一个最佳位置
const bestPosition = positions[Math.floor(Math.random() * positions.length)];
details += `<strong>今日最佳位置:</strong>${bestPosition}<br><br>`;
// 从最佳位置的英雄中选择几个作为推荐英雄
const positionHeroes = hero[bestPosition];
const luckyHeroCount = Math.min(Math.floor(Math.random() * 3) + 2, positionHeroes.length);
const selectedHeroes = [];
details += "<strong>今日最佳英雄:</strong><br>";
// 从该位置的英雄中随机选择,不重复
for (let i = 0; i < luckyHeroCount; i++) {
let randomHero;
do {
randomHero = positionHeroes[Math.floor(Math.random() * positionHeroes.length)];
} while (selectedHeroes.includes(randomHero));
selectedHeroes.push(randomHero);
}
fortuneDetails.innerHTML = details;
// 显示幸运英雄
selectedHeroes.forEach((hero, index) => {
const heroElement = document.createElement('div');
heroElement.classList.add('hero');
heroElement.textContent = hero;
heroElement.style.animationDelay = `${index * 0.1}s`;
luckyHeroes.appendChild(heroElement);
});
}, 500);
}
// 返回初始状态
function backToInitial() {
// 显示查看按钮,隐藏返回按钮
document.getElementById('check-fortune').style.display = 'inline-block';
document.getElementById('back-button').style.display = 'none';
// 重置运势显示
document.getElementById('fortune-result').textContent = '?';
document.getElementById('fortune-result').style.color = '#fff';
document.getElementById('luck-fill').style.width = '0%';
document.getElementById('fortune-details').innerHTML = '点击下方按钮查看今日运势';
document.getElementById('lucky-heroes').innerHTML = '';
}
// 初始化
document.addEventListener('DOMContentLoaded', () => {
createStars();
// 绑定按钮事件
document.getElementById('check-fortune').addEventListener('click', checkFortune);
document.getElementById('back-button').addEventListener('click', backToInitial);
});
</script>
</body>
<div class="footer-text">tips:游戏请勿上头,心态最重要</div>
<footer class="copyright">
<div class="footer-content">
<div class="footer-decoration"></div>
<div class="footer-logo">王者荣耀运势</div>
<div class="footer-text">© 2025 王者荣耀上分运势 | 由盼盼精心制作</div>
<div class="social-links">
<a href="https://blog.csdn.net/m0_74257457?type=blog" class="social-link"><span
class="social-icon">♟</span></a>
<a href="https://gitee.com/ypyangpan/projects " class="social-link"><span class="social-icon">♔</span></a>
<a href="https://www.douyin.com/user/self?from_tab_name=main" class="social-link"><span class="social-icon">★</span></a>
</div>
</div>
</footer>
</html>
总结
该网页只能最为一个娱乐的项目来使用 并不具有真实性