Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. var _CONTENT = ["When I was 15, I took a Robotics Honors course at my high school. We designed and built robots using VEX robotics kits. To me, the most interesting part was building the drag-and-drop code and uploading it to the robot to control it. This is what inspired me to code. Before long, I was researching software development and decided the best language for me to start with would be Python. That was a year ago, and since then I've worked in HTML, CSS, JavaScript, and Java, and plan to further expand my developer capabilities from this point on."];
  2. var _PART = 0;
  3. var _PART_INDEX = 0;
  4. var _INTERVAL_VAL;
  5. var _ELEMENT = document.querySelector("#text");
  6. var _CURSOR = document.querySelector("#cursor");
  7.  
  8. function Type() {
  9. var text = _CONTENT[_PART].substring(0, _PART_INDEX + 1);
  10. _ELEMENT.innerHTML = text;
  11. _PART_INDEX++;
  12.  
  13. if(text === _CONTENT[PART]) {
  14. _CURSOR.style.display = "none";
  15.  
  16. clearInterval(_INTERVAL_VAL);
  17. setTimeout(function() {
  18. _INTERVAL_VAL = setInterval(Delete, 50);
  19. }, 1000);
  20. }
  21. }
  22.  
  23. _INTERVAL_VAL = setInterval(Type, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement