Advertisement
ruesha

hello kitty bubble text

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