-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Jaimexo.ME - Main</title> | ||
<link rel="stylesheet" type="text/css" href="style.css"> | ||
<script type="text/javascript" src="../code.jquery.com/jquery-1.11.0.min.js"></script> | ||
<script type="text/javascript" src="main.js"></script> | ||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> | ||
<link rel="icon" href="favicon.ico" type="image/x-icon"> | ||
</head> | ||
<body> | ||
|
||
<div style="code" class="text"></div> | ||
|
||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var writeLine = function (target, beforeMessage, message, interval, element, index) { | ||
if (index == null) index = 0; | ||
if (index < message.length) { | ||
var div = document.querySelector(target); | ||
var count = countElements(div); | ||
var element = element != null ? element : document.createElement("div"); | ||
element.setAttribute("id", "line" + (count)); | ||
var m = (message[index] == " ") ? message[index] + message[index += 1] : message[index]; | ||
element.innerText += (index == 0) ? beforeMessage + m : m; | ||
div.appendChild(element); | ||
setTimeout(function () { | ||
writeLine(target, beforeMessage, message, interval, element, index + 1); | ||
}, interval); | ||
} | ||
} | ||
var writeArray = function (target, beforeMessage, message, interval) { | ||
var previousTime = 0; | ||
message.forEach(function (value, key) { | ||
setTimeout(function () { | ||
writeLine(target, beforeMessage, value, interval); | ||
}, previousTime); | ||
previousTime += value.length * interval; | ||
}); | ||
} | ||
|
||
var countElements = function (parent, getChildrensChildren) { | ||
var relevantChildren = 0; | ||
var children = parent.childNodes.length; | ||
for (var i = 0; i < children; i++) { | ||
if (parent.childNodes[i].nodeType != 3) { | ||
if (getChildrensChildren) | ||
relevantChildren += getCount(parent.childNodes[i], true); | ||
relevantChildren++; | ||
} | ||
} | ||
return relevantChildren; | ||
} | ||
|
||
var monArray = [ | ||
"Welcome to Jaimexo.me", | ||
"Twitter: @J4im3x0", | ||
]; | ||
|
||
writeArray(".text", "[email protected]:~# ", monArray, 40); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
div { | ||
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; | ||
color: #657b83; | ||
font-size: xx-large; | ||
} | ||
body { | ||
background-color: #002b36; | ||
} |