diff --git a/checkpoint-three/css/style.css b/checkpoint-three/css/style.css index 8b13789179..46841f6680 100644 --- a/checkpoint-three/css/style.css +++ b/checkpoint-three/css/style.css @@ -1 +1,42 @@ +body { + background-image: url(../images/codingbg.jpg); + background-repeat: no-repeat; + background-size: 2000px; +} +.content { + display: flex; + align-items: center; + flex-direction: column; + width: 450px; + background: rgba(0,0,0,0.8); + padding: 40px; + text-align: center; + margin: auto; + margin-top: 5%; + color: white; +} + +#clickerimage { + width: 300px; + height: 300px; + border-radius: 150px; +} + +#currentTotal { + width: 200px; + height: 50px; + border: 1px solid white; + text-align: center; + font-size: 48px; +} + +.button { + width: 200px; + height: 20px; + border: 1px solid white; + border-radius: 25px; + text-align: center; + cursor: pointer; + padding: 5px; +} \ No newline at end of file diff --git a/checkpoint-three/images/bluebh.jpg b/checkpoint-three/images/bluebh.jpg new file mode 100644 index 0000000000..8c61da162f Binary files /dev/null and b/checkpoint-three/images/bluebh.jpg differ diff --git a/checkpoint-three/images/codingbg.jpg b/checkpoint-three/images/codingbg.jpg new file mode 100644 index 0000000000..3cbda45f89 Binary files /dev/null and b/checkpoint-three/images/codingbg.jpg differ diff --git a/checkpoint-three/images/pc.jpg b/checkpoint-three/images/pc.jpg new file mode 100644 index 0000000000..9f3a15f26a Binary files /dev/null and b/checkpoint-three/images/pc.jpg differ diff --git a/checkpoint-three/index.html b/checkpoint-three/index.html index 8b13789179..e797b3732f 100644 --- a/checkpoint-three/index.html +++ b/checkpoint-three/index.html @@ -1 +1,27 @@ - + + + + + Hackathon + + + +
+

Hackathon

+ +
+ Terminal
+ Lines of Code per/sec: +
+ +
+
5 Hour Energy - 10
+
Hardware Upgrade - 100
+
ACA Tutor - 1000
+
Master Googler - 10000
+
+
+ + + + diff --git a/checkpoint-three/js/script.js b/checkpoint-three/js/script.js new file mode 100644 index 0000000000..08f5394ba3 --- /dev/null +++ b/checkpoint-three/js/script.js @@ -0,0 +1,39 @@ +'use strict'; + +var data = { + totalRevs:360, + totalCurrent:0, + totalRPS:0 +}; + +setInterval(goGo,1000); + +function goGo() { + data.totalRevs += data.totalRPS; + data.totalCurrent += data.totalRPS; + updateReport(); +} + +function updateReport() { + $("#currentTotal").text(Math.floor(data.totalCurrent)); + $("#rps").text((data.totalRPS/70.4).toFixed(3)); +} + +// Allows you to click the image for points +$("#clickerimage").click(function (){ + data.totalRevs ++; + data.totalCurrent ++; + updateReport(); +}) + +// Allows you to purchase upgrades +$(".button").click(function (){ + var addVal = $(this).data("cost"); + if ($(this).data("cost") < data.totalCurrent ) { + data.totalCurrent -= parseFloat($(this).data( "cost").toPrecision(2)); + data.totalRPS += parseFloat($(this).data("val")); + $( this ).children("span").html( parseInt($( this).children("span").html()*1.15)); + $( this ).data("cost", parseInt($(this).data( "cost" ) * 1.15)); + } + updateReport(); +}) \ No newline at end of file