Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версия |
money [1] – novik | money [1] (текущий) – удалено novik |
---|
<html> <style> | |
h2 { | |
font-family: 'Pangolin', cursive; | |
} | |
button { | |
background: linear-gradient(to bottom,rgba(120, 107, 175, .5), rgba(40, 140, 255,.3)); | |
background-color: transparent; | |
background-repeat: no-repeat; | |
background-position: center; | |
padding: 20px; | |
border-radius:20px; | |
text-decoration: none; | |
font-family: Titillium, Arial, sans-serif; | |
font-weight: 700; | |
color: white; | |
text-shadow: 2px 2px 4px rgba(0,0,0,1); | |
text-transform:uppercase; | |
font-size: .9em; | |
letter-spacing: .1em; | |
margin-right: 5px; | |
margin-left: 20px; | |
cursor: pointer; | |
} | |
input { | |
margin: 5px; | |
border-radius:20px; | |
cursor: pointer; | |
padding: 10px; | |
} | |
main { | |
background-color: rgba(77, 117, 247, 0.5); | |
margin: 0 auto; | |
width: 60%; | |
} | |
.img { | |
float: right; | |
width: 30%; | |
margin-top: -250px; | |
margin-right: 10px; | |
} | |
h1 img { | |
width: 30px; | |
margin-bottom: -5px; | |
} | |
h1, h2 { | |
text-align: center; | |
} | |
| |
@media (max-width:1000px) { | |
main { | |
width: 90%; | |
height: 1500px; | |
} | |
.img { | |
width: 37%; | |
margin-top: 0; | |
} | |
h1, h2 { | |
font-size: 100px; | |
margin: 0; | |
} | |
button, input { | |
font-size: 50px; | |
} | |
h1 img { | |
width: 80px; | |
} | |
} | |
</style> | |
| |
<script> var score = 0; updating = 1; function clickBtn() { score = score + updating; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; } function update() { score = score - 100; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; if1(); updating += 1;} | |
| |
function update1() { score = score - 150; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; if1(); updating += 2; } function update2() { score = score - 250; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; if1(); updating += 3; } function update3() { score = score - 500; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; if1(); updating += 10; } function auto() { score = score - 10000; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; if1(); setTimeout("plusauto()", 1000); } function if1 () { if (score <-100) { | |
document.write("Вы проиграли, так-как вы превысили лимит кредита"); | |
} } function plusauto () { score += updating; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; setTimeout("auto1()", 1000); } function auto1 () { score += updating; setTimeout("plusauto()", 1000); document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; } function pashalka () { score += 10000; document.getElementsByTagName("h1")[0].firstChild.data = score + "$ Уровень: " + updating ; } function reboot () { alert("Ваш уровень прокачки " + updating + ". Ваш баланс " + score + " ."); } </script> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <body> <main> <h2>Игра кликер</h2> <p>Правила: копите деньги и прокачиваетесь, в минус можно уходить до -100, далее вы проиграете!</p> <h1 id ="score">0$ Уровень: 1</h1> <button id="clickbtn" onclick="clickBtn()">+$</button> <br> <input type="button" value="Прокачать на 1 уровень|-100$" onclick="update()"> <br> <input type="button" value="Прокачать на 2 уровня|-150$" onclick="update1()"> <br> <input type="button" value="Прокачать на 3 уровня|-250$" onclick="update2()"> <br> <input type="button" value="Прокачать на 10 уровней|-500$" onclick="update3()"> <br> <input type="button" value="Автокликер|-10000$" onclick="auto()"> <br> <img src="img/profit.png" class="img" onclick="pashalka()"> </main> </body> </html> | |