lunes, 17 de agosto de 2015

Efectos Rainbow En Textos

Annyz Kawaii World
 
 
Este truco no funciona si tienes otro script activo (por ejemplo el de brillitos en el cursor) yo lo tuve que quitar para que funcionara el efecto rainbow.

Para ponerlo en tu blog anda a Plantilla >> Edicion HTML >> Continuar

Copia este codigo y pegalo justo antes de </header>
 
<script type="text/javascript">
// <![CDATA[
var speed=100; // speed colours change, 1 second = 1000
var glow=4; // can be set from '0' for no glow, to 10
var raincol=new Array("#ff0000", "#ff9900", "#ffff00", "#99ff00", "#00ff00", "#00ff99", "#00ffff", "#0099ff", "#0000ff", "#9900ff", "#ff00ff", "#ff0099"); // change the colours if you want to
var alink="http://www.mf2fm.com/rv"; // page to link text to (set to ="" for no link)
/****************************
*    Rainbow Text Effect    *
*(c)2003-12 mf2fm web-design*
*  http://www.mf2fm.com/rv  *
* DON'T EDIT BELOW THIS BOX *
****************************/
var rainbow, raintxt, raincnt=0;
window.onload=function() { if (document.getElementById) {
  var i, rainbeau;
  rainbow=document.getElementById("rainbow");
  raintxt=rainbow.firstChild.nodeValue;
  while (rainbow.childNodes.length) rainbow.removeChild(rainbow.childNodes[0]);
  for (i=0; i<raintxt.length; i++) {
    rainbeau=document.createElement("span");
    rainbeau.setAttribute("id", "rain"+i);
    rainbeau.appendChild(document.createTextNode(raintxt.charAt(i)));
    if (alink) {
      rainbeau.style.cursor="pointer";
      rainbeau.onclick=function() { top.location.href=alink; }
    }
    rainbow.appendChild(rainbeau);
  }
  rainbow=setInterval ("raining()", speed);
}}
function raining() {
  var i, c;
  for (i=0; i<raintxt.length; i++) {
    c=raincol[(i+raincnt)%raincol.length];
    document.getElementById("rain"+i).style.color=c;
if (glow) document.getElementById("rain"+i).style.textShadow=c+" 0px 0px "+glow+"px";
  }
  raincnt++;
}
// ]]>
</script>

Das guardar

Ahora ve a donde quieres poner el texto, yo por ejemplo la pondre aqui en la entrada  copia este codigo y pegalo en la pestaña HTML no en la de redactar oK?
 

estando en esa pestaña das publicar.. y listo
Segunda version Rainbow
Para ponerlo en tu blog anda a Plantilla y antes de ]]></b:skin>

pega este codigo:


.rainbow {
  background-image:-webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );
  color:transparent;
  -webkit-background-clip: text;
}

Das guardar....

y empieza a escribir en una entrada...TODO lo que escribas estara con el efecto rainbow.. si solo quieres  que solo sean algunos textos y no todo entonces como anteriormente hicimos..pega  este codigo en donde quieres el texto


<div class="rainbow">AQUI TU TEXTO</div> 

ejemplo
:
Mi texto dentro del codigo efecto rainbow
aqui ya escribo fuera del codigo ^^

imagen guia
 
Espero les haya gustado el tuto alguna duda?? dejame un comentario :)

No hay comentarios:

Publicar un comentario