Created
April 12, 2016 03:27
-
-
Save peterpham/9902bd21eb7f058031f0c14e39509222 to your computer and use it in GitHub Desktop.
Create a message Happy Birthday in browser's console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(){ | |
| var text = "Happy Birthday, Steve!", | |
| length = text.length, | |
| chr = 1, | |
| ar = text.split(), | |
| today = new Date(); | |
| try { | |
| if (window.console) { | |
| if (console.clear && console.log) { | |
| if (today.getDate() === 17 && today.getMonth() === 2) { | |
| if (navigator.userAgent.search("Firefox") > -1) { | |
| console.log('%c'+text, 'color:red;font-size:1.5em'); | |
| } else if (navigator.userAgent.search("Chrome") > -1) { | |
| for (var i=0; i < length; i++) { | |
| setTimeout(function () { | |
| console.clear(); | |
| if (chr === length) { | |
| console.log('%c'+text.substring(0, chr), 'color:red;font-size:1.5em'); | |
| } else { | |
| console.log('%c'+text.substring(0, chr)+'%c|', 'color:red;font-size:1.5em','color:black;font-size:1.5em'); | |
| } | |
| chr++ ; | |
| }, (150 * i)+10000); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } catch (er) { | |
| } | |
| })(); |
lautrenilesh815-ux
commented
Sep 19, 2025
<script src="https://gist.github.com/peterpham/9902bd21eb7f058031f0c14e39509222.js"></script>
<script src="https://gist.github.com/peterpham/9902bd21eb7f058031f0c14e39509222.js"></script>
Happy Birthday
Happy Birthday
Hgakhvs. Haolohw hiwj
Happy Birthday dear sir please send
Happy Birthday πππ
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
