Test ur mind!

Developer
Size
7,402 Kb
Views
12,144

How do I make an test ur mind!?

Game for development of memory. What is a test ur mind!? How do you make a test ur mind!? This script and codes were developed by Anton Kalinin on 28 November 2022, Monday.

Test ur mind! Previews

Test ur mind! - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Test ur mind!</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrapper"> <div class="field"></div> <div class="status"> Play with me!!! </div> <div class="progress"></div>
</div>
<div class="go-btn"> reset
</div>
<div class="score"> score: 0
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/sugar/1.4.1/sugar.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Test ur mind! - Script Codes CSS Codes

@import url(https://fonts.googleapis.com/css?family=Henny+Penny);
@-webkit-keyframes status_changed { 0% { -moz-transform: translate(0, -20px); -ms-transform: translate(0, -20px); -webkit-transform: translate(0, -20px); transform: translate(0, -20px); opacity: 0; } 100% { opacity: 1; }
}
@-moz-keyframes status_changed { 0% { -moz-transform: translate(0, -20px); -ms-transform: translate(0, -20px); -webkit-transform: translate(0, -20px); transform: translate(0, -20px); opacity: 0; } 100% { opacity: 1; }
}
@-ms-keyframes status_changed { 0% { -moz-transform: translate(0, -20px); -ms-transform: translate(0, -20px); -webkit-transform: translate(0, -20px); transform: translate(0, -20px); opacity: 0; } 100% { opacity: 1; }
}
@keyframes status_changed { 0% { -moz-transform: translate(0, -20px); -ms-transform: translate(0, -20px); -webkit-transform: translate(0, -20px); transform: translate(0, -20px); opacity: 0; } 100% { opacity: 1; }
}
.text, .wrapper .status, .wrapper .progress, .go-btn, .score { text-transform: uppercase; font-family: "Henny Penny"; font-size: 22px; color: #fff; text-align: center; line-height: 50px;
}
.wrapper { width: 250px; height: 250px;
}
.wrapper .field { width: 130px; height: 130px; background: #4A5764; border-radius: 5px; -moz-transition: all 0.6s linear; -o-transition: all 0.6s linear; -webkit-transition: all 0.6s linear; transition: all 0.6s linear; overflow: hidden; padding: 0 10px 10px 0;
}
.wrapper .field .cell { -moz-transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; position: relative; width: 50px; height: 50px; float: left; margin: 10px 0 0 10px; -moz-transition: all 0.6s linear; -o-transition: all 0.6s linear; -webkit-transition: all 0.6s linear; transition: all 0.6s linear;
}
.wrapper .field .cell .front, .wrapper .field .cell .back, .wrapper .field .cell .answer { width: inherit; height: inherit; position: absolute; -moz-backface-visibility: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; position: absolute; top: 0; left: 0;
}
.wrapper .field .cell .front { background: #4d7faa; z-index: 2;
}
.wrapper .field .cell .back { background: #7ea4c5; -moz-transform: rotateY(180deg); -ms-transform: rotateY(180deg); -webkit-transform: rotateY(180deg); transform: rotateY(180deg);
}
.wrapper .field .cell .back.right { background: LightGreen;
}
.wrapper .field .cell .back.wrong { background: Salmon;
}
.wrapper .field .cell.hover { -moz-transition: all 0.6s linear; -o-transition: all 0.6s linear; -webkit-transition: all 0.6s linear; transition: all 0.6s linear; -moz-transform: rotateY(180deg); -ms-transform: rotateY(180deg); -webkit-transform: rotateY(180deg); transform: rotateY(180deg);
}
.wrapper .status, .wrapper .progress { width: 100%; position: absolute; bottom: 5px; text-transform: none; line-height: inherit; color: LightGreen;
}
.wrapper .status.changed, .wrapper .changed.progress { -o-animation-fill-mode: forwards; -moz-animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards; animation-fill-mode: forwards; -o-animation: status_changed 0.6s linear; -moz-animation: status_changed 0.6s linear; -webkit-animation: status_changed 0.6s linear; animation: status_changed 0.6s linear;
}
.wrapper .progress { bottom: auto; top: 0; font-size: 35px; color: #c5d6e4;
}
.go-btn { cursor: pointer; background: #4A5764; line-height: 50px; position: absolute; width: 100px; height: 50px; bottom: 10px; left: 0; right: 0; margin: auto; border-radius: 5px; color: #a1bdd5;
}
.score { width: 200px; height: 50px; position: absolute; left: 0; top: 0; background: none; color: #a1bdd5;
}
body { background: #457298; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjEuMCIgeTE9IjAuNSIgeDI9IjAuMCIgeTI9IjAuNSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzdlYTRjNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ1NzI5OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 100% 50%, 0% 50%, color-stop(0%, #7ea4c5), color-stop(100%, #457298)); background-image: -moz-linear-gradient(right, #7ea4c5 0%, #457298 100%); background-image: -webkit-linear-gradient(right, #7ea4c5 0%, #457298 100%); background-image: linear-gradient(to left, #7ea4c5 0%, #457298 100%);
}
.middle, .wrapper, .wrapper .field { -moz-transform: translate3D(0, 0, 0); -ms-transform: translate3D(0, 0, 0); -webkit-transform: translate3D(0, 0, 0); transform: translate3D(0, 0, 0); position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto;
}

Test ur mind! - Script Codes JS Codes

(function() { var TestYourMind, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; TestYourMind = (function() { TestYourMind.prototype.$container = null; TestYourMind.prototype.$wrapper = null; TestYourMind.prototype.$cells = []; TestYourMind.prototype.$answer = []; TestYourMind.prototype.total_cells = 0; TestYourMind.prototype.total_clicks = 0; TestYourMind.prototype.time = 3000; TestYourMind.prototype.$start_btn = null; TestYourMind.prototype.score = 0; TestYourMind.prototype.bounty = 50; TestYourMind.prototype.$score = null; TestYourMind.prototype.$status = null; TestYourMind.prototype.current_level = 0; TestYourMind.prototype.levels = [2, 4, 6, 8]; TestYourMind.prototype.next_level = 0; TestYourMind.prototype.cell_template = "<div class='cell'>\n <div class='front'></div>\n <div class='back'></div>\n</div>"; function TestYourMind() { this.check_bonus = bind(this.check_bonus, this); this.update_score = bind(this.update_score, this); this.update_status = bind(this.update_status, this); this.unbind_clicks = bind(this.unbind_clicks, this); this.bind_clicks = bind(this.bind_clicks, this); this.check_answer = bind(this.check_answer, this); this.hide_answer_and_bind = bind(this.hide_answer_and_bind, this); this.clear_cells = bind(this.clear_cells, this); this.hide_cells = bind(this.hide_cells, this); this.clear_field = bind(this.clear_field, this); this.generate_answer = bind(this.generate_answer, this); this.generate_level = bind(this.generate_level, this); this.bind_menu = bind(this.bind_menu, this); this.draw_field = bind(this.draw_field, this); this.prepare_level = bind(this.prepare_level, this); this.load_level = bind(this.load_level, this); this.$container = $('.field'); this.$wrapper = $('.wrapper'); this.$start_btn = $('.go-btn'); this.$score = $('.score'); this.$status = $('.status'); this.$progress = $('.progress'); this.next_level = this.levels[this.current_level]; this.load_level(); this.bind_menu(); } TestYourMind.prototype.load_level = function(level) { var draw; if (level == null) { level = 0; } draw = $.Deferred(); return this.prepare_level(level, $.Deferred()).done((function(_this) { return function() { _this.draw_field.delay(1000, draw); return draw.done(function() { return _this.generate_level(); }); }; })(this)); }; TestYourMind.prototype.prepare_level = function(level, d) { var cell_size, field_size; if (level >= this.levels.length) { level = 1; } this.$container.find('.cell').hide(); this.update_status(this.$progress, "Level " + (level + 1)); this.current_level = level; cell_size = 60; field_size = this.levels[this.current_level] * cell_size; this.total_cells = Math.pow(this.levels[this.current_level], 2); this.$wrapper.css({ width: field_size + 120, height: field_size + 120 }); this.$container.css({ width: field_size, height: field_size }); return d.resolve(); }; TestYourMind.prototype.draw_field = function(d) { this.$container.find('.cell').remove(); this.total_cells.times((function(_this) { return function() { return _this.$container.append(_this.cell_template); }; })(this)); return d.resolve(); }; TestYourMind.prototype.bind_menu = function() { return this.$start_btn.on('click', (function(_this) { return function() { if (!_this.$start_btn.hasClass('lock')) { _this.$start_btn.addClass('lock'); return _this.generate_level(); } }; })(this)); }; TestYourMind.prototype.generate_level = function() { var generate_answer; this.$cells = []; this.$container.find('.cell').each((function(_this) { return function(_, cell) { return _this.$cells.push($(cell)); }; })(this)); this.clear_field(); this.total_clicks = 0; this.unbind_clicks(); generate_answer = $.Deferred(); this.generate_answer.delay(1000, generate_answer); return generate_answer.done((function(_this) { return function() { return _this.hide_answer_and_bind.delay(_this.time); }; })(this)); }; TestYourMind.prototype.generate_answer = function(d) { this.$cells.sample(this.levels[this.current_level]).each((function(_this) { return function(cell, _) { cell.addClass('hover'); return _this.$answer.push(cell); }; })(this)); this.update_status(this.$status, 'Remember'); return d.resolve(); }; TestYourMind.prototype.clear_field = function() { this.hide_cells(); return this.clear_cells.delay(1000); }; TestYourMind.prototype.hide_cells = function() { return this.$cells.each(function(cell, _) { return cell.removeClass('hover'); }); }; TestYourMind.prototype.clear_cells = function() { return this.$cells.each(function(cell, _) { return cell.find('.back').removeClass('wrong right'); }); }; TestYourMind.prototype.hide_answer_and_bind = function() { this.update_status(this.$status, 'Restore'); this.$cells.each(function(cell, _) { return cell.removeClass('hover'); }); this.bind_clicks(); return this.$start_btn.removeClass('lock'); }; TestYourMind.prototype.check_answer = function(item, event) { var answer; answer = this.$answer.find(item); if (answer) { answer.addClass('hover').find('.back').addClass('right'); this.update_status(this.$status, "+" + this.bounty); this.$answer.remove(answer); this.score += this.bounty; this.update_score(this.score); } else { this.update_status(this.$status, "Oh no!, keep clicking!"); $(event.currentTarget).addClass('hover').find('.back').addClass('wrong'); } this.total_clicks++; if (this.total_clicks >= this.levels[this.current_level]) { this.check_bonus(); this.unbind_clicks(); if (this.next_level <= 0) { this.load_level.delay(1000, this.current_level + 1); return this.next_level = this.levels[this.current_level + 1]; } else { return this.generate_level.delay(this.time); } } }; TestYourMind.prototype.bind_clicks = function() { return this.$cells.each((function(_this) { return function(cell, _) { cell.css({ cursor: 'pointer' }); return cell.click(function(event) { return _this.check_answer(cell, event); }); }; })(this)); }; TestYourMind.prototype.unbind_clicks = function() { return this.$cells.each(function(cell, _) { cell.css({ cursor: 'default' }); return cell.unbind('click'); }); }; TestYourMind.prototype.update_status = function(field, text) { return field.text(text).addClass('changed').one("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd", function() { return $(this).removeClass('changed'); }); }; TestYourMind.prototype.update_score = function(score) { return this.$score.text("score: " + score); }; TestYourMind.prototype.check_bonus = function() { var round_bounty; if (this.$answer.isEmpty()) { this.next_level--; round_bounty = this.levels[this.current_level] * this.bounty; this.score += round_bounty; this.update_score(this.score); return this.update_status(this.$status, "Good job! +" + round_bounty); } else { return this.$answer = []; } }; return TestYourMind; })(); $(function() { return new TestYourMind; });
}).call(this);
Test ur mind! - Script Codes
Test ur mind! - Script Codes
Home Page Home
Developer Anton Kalinin
Username ssh
Uploaded November 28, 2022
Rating 3
Size 7,402 Kb
Views 12,144
Do you need developer help for Test ur mind!?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Anton Kalinin (ssh) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!