.
.
.sub-
.
.
.
.h2:after,
.h3:
.
.
.difficulty-
.difficulty-level:last-
.in-game-
多人合做奥特曼小游戏:挑战宇宙魔鬼
你需要与其他玩家合做,打败各类宇宙魔鬼!
宇宙魔鬼 Lv1被宇宙魔鬼 Lv1 攻击了!
立即操做道具 道具 1立即操做道具 道具 2
立即操做道具 道具 3
立即操做道具 道具 4
继续挑战!
宇宙魔鬼 Lv2被宇宙魔鬼 Lv2 攻击了!
立即操做道具 道具 1立即操做道具 道具 2
立即操做道具 道具 3
立即操做道具 道具 4
继续挑战!
const difficultyLevels = [{ name: '宇宙魔鬼 Lv1', difficulty: 1 },
{ name: '宇宙魔鬼 Lv2', difficulty: 2 },
// 更多灾度...
];const characteristics = document.querySelectorAll('.character');
difficultyLevels.forEach(difficultyLevel => {
const character = document.createElement('div');
character.classList.add('character');
character.innerHTML = `${difficultyLevel.name}
${difficultyLevel.difficulty}
立即操做道具
${characteristics.forEach(item => ${item.in-game-link})}
继续挑战!
`);characteristics.forEach(item => {
if (item.in-game-link === '') {
item.in-game-link = ${item.name}道具;
}
});
character.appendChild(characteristics);
character.style.display = 'flex';
character.style.flexDirection = 'row';
character.style.justifyContent = 'space-between';
character.style.alignItems = 'center';
character.style.height = '50px';
character.style.width = '100px';
character.style.borderRadius = '5px';
character.style.backgroundColor = ${Math.random() * 255}%255%255;
character.style.boxShadow = 0 2px 5px rgba(0, 0, 0, 0.3);
});