aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/sprinkles/core
diff options
context:
space:
mode:
authorMarvin Borner2018-06-04 17:40:25 +0200
committerMarvin Borner2018-06-04 17:40:25 +0200
commit873f2a78a1028724e9f863728a6223b29bdc9b5d (patch)
treeadc17deda3bde0ba7c5a8221a2d9923463a31494 /main/app/sprinkles/core
parentb2d21e10ef5ad323633d865ad5142bc07a2c63bc (diff)
Added some console logging features
Diffstat (limited to 'main/app/sprinkles/core')
-rw-r--r--main/app/sprinkles/core/asset-bundles.json2
-rw-r--r--main/app/sprinkles/core/assets/SiteAssets/css/animate.css20
-rw-r--r--main/app/sprinkles/core/assets/SiteAssets/js/console.js75
3 files changed, 96 insertions, 1 deletions
diff --git a/main/app/sprinkles/core/asset-bundles.json b/main/app/sprinkles/core/asset-bundles.json
index ef8e244..b62df84 100644
--- a/main/app/sprinkles/core/asset-bundles.json
+++ b/main/app/sprinkles/core/asset-bundles.json
@@ -46,11 +46,11 @@
},
"js/main-site": {
"scripts": [
+ "SiteAssets/js/console.js",
"SiteAssets/js/fontawesome.js",
"SiteAssets/js/linkify.js",
"SiteAssets/js/encryption.js",
"SiteAssets/js/swiper.js",
- "SiteAssets/js/console.image.js",
"SiteAssets/js/popups.js",
"SiteAssets/js/push.js",
"SiteAssets/js/chat.js",
diff --git a/main/app/sprinkles/core/assets/SiteAssets/css/animate.css b/main/app/sprinkles/core/assets/SiteAssets/css/animate.css
index 10cb2d6..6f01a37 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/css/animate.css
+++ b/main/app/sprinkles/core/assets/SiteAssets/css/animate.css
@@ -3491,4 +3491,24 @@
.slideOutUp {
-webkit-animation-name: slideOutUp;
animation-name: slideOutUp;
+}
+
+/* The typing effect */
+@keyframes typing {
+ from {
+ width: 0
+ }
+ to {
+ width: 100%
+ }
+}
+
+/* The typewriter cursor effect */
+@keyframes blink-caret {
+ from, to {
+ border-color: transparent
+ }
+ 50% {
+ border-color: orange
+ }
} \ No newline at end of file
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/console.js b/main/app/sprinkles/core/assets/SiteAssets/js/console.js
new file mode 100644
index 0000000..c263f69
--- /dev/null
+++ b/main/app/sprinkles/core/assets/SiteAssets/js/console.js
@@ -0,0 +1,75 @@
+/**
+ * File for some things logged in console // TODO: Create Error/Success logger functions so we don't need to write the whole log things several times
+ */
+
+console.log("%s%c%s%c%s%c%s%c%s%c%s%c",
+ " ____ _____ _ __ __ \n" +
+ "| __ ) | ____| / \\ | \\/ |\n" +
+ "| _ \\ | _| / _ \\ | |\\/| |\n" +
+ "| |_) || |___ / ___ \\ | | | |\n" +
+ "|____/ |_____|/_/ \\_\\|_| |_|\n",
+ "whitespace: pre;",
+ "Hello, world! Thanks for checking our code.\nAs this project is completely open source it would be an better option to look here:\n",
+ "color: blue;", "https://github.com/marvinborner/BEAM-Messenger\n\n",
+ "", "...or even clone the entire repo with:\n",
+ "border-radius: 100px; padding: 2px; background-color: black; color: white;", "git clone https://github.com/marvinborner/BEAM-Messenger.git\n",
+ "", "\nWe are also thankful for every contributor we have - so if you have any idea, fix or anything else - feel free to create a pull request.",
+ "font-family: monospace;");
+
+function playGame() {
+ var a, b, d, e, f, g, h, k, l, m, n, p, q, r;
+ h = "<0>-----------------------<0>--------------";
+ f = [0, 20];
+ p = [];
+ n = !1;
+ m = d = 0;
+ q = 1;
+ e = function (c) {
+ var s;
+ s = p[c[0]].substr(c[1] + 1, 1);
+ p[c[0]] = p[c[0]].substr(0, c[1]) + "X" + p[c[0]].substr(c[1] + 1);
+ return s
+ };
+ b = function (c) {
+ return /[<0>]/.test(c)
+ };
+ k = function () {
+ n = !0;
+ return setTimeout(function () {
+ alert("Oops, you got squashed.\n\nTry again");
+ n = !1;
+ f = [0, 20];
+ return q++
+ }, 60)
+ };
+ r = function () {
+ n = !0;
+ setTimeout(function () {
+ alert("CONGRATULATIONS! You made it! Nice.\n\nIt took you " + q + " tries, " + m + " moves, and " + d + " draw cycles");
+ n = !1;
+ m = d = 0;
+ q = 1;
+ return f = [0, 20]
+ }, 60)
+ };
+ g = null;
+ l = {
+ 38: function () {
+ if (f[0] < p.length - 1) return f[0]++
+ }, 40: function () {
+ if (0 < f[0]) return f[0]--
+ }, 37: function () {
+ if (0 < f[1]) return f[1]--
+ }, 39: function () {
+ if (f[1] < h.length - 1) return f[1]++
+ }
+ };
+ document.onkeydown = function (c) {
+ g = c.keyCode;
+ return m++
+ };
+ a = setInterval(function () {
+ var c;
+ if (!n) if (d++, l[g] && (l[g](), g = null), 27 === g) clearInterval(a); else if (h = h.substr(-1) + h.substr(0, h.length - 1), p = ["ooooooooooooooooooooooooooooooooooooooooooo", h, h.split("").reverse().join(""), h.substr(-11) + h.substr(0, h.length - 11), h.split("").reverse().join("").substr(-11) + h.split("").reverse().join("").substr(0, h.length - 11), "ooooooooooooooooooooooooooooooooooooooooooo"], c = e(f), console.clear(), console.log("\n\nYou found a secret game!\nTake a break from coding and play it! :)\n\nYour Goal: Use the arrow keys to move the 'X' across the street and avoid the cars - just ignore the rest of the screen.\nPress 'Esc' to stop the game.\n\n(Note, if your cursor is in the console you'll need to click on the page outside the console so the arrow keys will work)\n\n\n"), console.log(p[5]), console.log(p[4]), console.log(p[3]), console.log(p[2]), console.log(p[1]), console.log(p[0]), console.log("\n\nMade by @jschomay"), f[0] >= p.length - 1 && r(), b(c)) return k()
+ }, 60);
+} \ No newline at end of file