From f72bda626c56cd5d39615257f6b59d8672a8ce6b Mon Sep 17 00:00:00 2001 From: gorhgorh Date: Sun, 6 Mar 2016 16:56:07 +0100 Subject: [PATCH] guru meditation --- public/404.html | 17 +++++++ public/assets/js/guru.js | 98 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 public/404.html create mode 100644 public/assets/js/guru.js diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..3fe8dcd --- /dev/null +++ b/public/404.html @@ -0,0 +1,17 @@ + + + + + GURU meditation + + + + + + + diff --git a/public/assets/js/guru.js b/public/assets/js/guru.js new file mode 100644 index 0000000..154105a --- /dev/null +++ b/public/assets/js/guru.js @@ -0,0 +1,98 @@ +/** + * Tribute to Amiga - Software failure / Guru Meditation + * Usage: GuruMeditation.display( 'Your custom message' ) + * + * @class GuruMeditation + * @author =undo= + * @copyright Copyright (C) 2012-2013 wpXtreme Inc. All Rights Reserved. + * @date 2014-02-04 + * @version 1.0.2 + */ + +if (typeof (window.GuruMeditation) === 'undefined') { + window.GuruMeditation = (function () { + var $t = { + version: '1.0.2', + display: _display, + hide: _hide + } + var div, timer + + /** + * Display Guru Meditation + * + * @param {string} $error Your message + */ + function _display ($error) { + _htmlMarkup($error) + + if (!$('body > #guru-meditation').length) { + $('body').prepend(div) + + var $guru_meditation = $('#guru-meditation') + + // Blink + timer = setInterval(function () { $guru_meditation.toggleClass('red') }, 1000) + + // If click hide + $guru_meditation.on('click', _back) + } + } + + function _back () { + history.back() + } + + /** + * Hide + */ + function _hide () { + if ($('body > #guru-meditation').length) { + clearInterval(timer) + $('#guru-meditation').remove() + $('#guru-meditation-style').remove() + } + } + + /** + * Prepare HTML markup + * + * @param {string} $error Your message + * @private + */ + function _htmlMarkup ($error) { + if ('undefined' == typeof ( $error )) { + $error = '#00000025.65045330' + } + + div = '' + + '
' + + '

Software Failure. Press left mouse button to continue.

' + + '

Guru meditation ' + + $error + + '

' + + '
' + } + + return $t + })() +} + +GuruMeditation.display('Page not found')