y2kcarrds

hello kitty bubble text

Jun 20th, 2022
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. <style>
  2. @font-face {
  3. font-family: hello kitty;
  4. src: url(https://dl.dropbox.com/s/l5kzvuqppwfxa9z/hellokittyfont.ttf);
  5. }
  6. #bubble {
  7. color:#C48E49;
  8. font-family: hello kitty;
  9. font-size:45px;
  10. }
  11.  
  12. </style>
  13.  
  14. <span id="bubble">Name</span>
  15. <script type="text/javascript">
  16. // <![CDATA[
  17. var bgcolour="#C48E49"; // background colour
  18. var fgcolour="#A96618"; // foreground colour
  19. var speed=80; // speed of bubbling, lower is faster
  20. var shades=12; // number of shades of bubble
  21.  
  22. /****************************
  23. * Bubbling Text Effect *
  24. *(c)2003-13 mf2fm web-design*
  25. * http://www.mf2fm.com/rv *
  26. * DON'T EDIT BELOW THIS BOX *
  27. ****************************/
  28. var bubbcol=new Array();
  29. var bubbshd;
  30. var bubbler, bubbtxt;
  31. var bubbchr=new Array();
  32.  
  33. function addLoadEvent(funky) {
  34. var oldonload=window.onload;
  35. if (typeof(oldonload)!='function') window.onload=funky;
  36. else window.onload=function() {
  37. if (oldonload) oldonload();
  38. funky();
  39. }
  40. }
  41.  
  42. addLoadEvent(bubbagump);
  43.  
  44. function bubbagump() { if (document.getElementById) {
  45. var i, fg, bg, col;
  46. for (bubbler=0; bubbler<=shades; bubbler++) {
  47. col="#";
  48. for (i=1; i<6; i+=2) {
  49. bg=parseInt(bgcolour.substring(i,i+2),16);
  50. fg=parseInt(fgcolour.substring(i,i+2),16);
  51. col+=dechex(bg+(fg-bg)*(bubbler/shades));
  52. }
  53. bubbcol[bubbler+1]=col;
  54. if (bubbler==Math.floor(shades/2)) bubbshd=col;
  55. }
  56. bubbler=document.getElementById("bubble");
  57. bubbtxt=bubbler.firstChild.nodeValue;
  58. while (bubbler.childNodes.length) bubbler.removeChild(bubbler.childNodes[0]);
  59. for (i=0; i<bubbtxt.length; i++) {
  60. fg=document.createElement("span");
  61. fg.setAttribute("id", "bubb"+i);
  62. fg.style.textShadow=bubbshd+" 0px 0px 2px";
  63. fg.appendChild(document.createTextNode(bubbtxt.charAt(i)));
  64. bubbler.appendChild(fg);
  65. }
  66. bubbler=setInterval("bubbling()", speed);
  67. }}
  68.  
  69. function dechex(dec) {
  70. dec=Math.floor(dec);
  71. return ((dec<16)?'0':'')+dec.toString(16);
  72. }
  73.  
  74. function bubbling() {
  75. var i, bubby;
  76. for (i=0; i<bubbtxt.length; i++) {
  77. bubby=document.getElementById("bubb"+i);
  78. if (bubbchr[i]) {
  79. bubby.style.color=bubbcol[bubbchr[i]];
  80. bubbchr[i]=(bubbchr[i]+1)%bubbcol.length;
  81. }
  82. else if (Math.random()<7.5/(shades*bubbtxt.length)) bubbchr[i]=1;
  83. }
  84. }
  85. // ]]>
  86. </script>
Advertisement
Add Comment
Please, Sign In to add comment