CI02 Gifs no Mouse - formatação adian


"Clique em cima da flechinha e arraste para marcar o passo do tutorial onde está trabalhando"




    

CI02 Gifs no Mouse

Este tutorial oferece o Script de Imagem no Mouse com Efeito Elástico. Basta movimentar o cursor (seu mouse) pelo seu papel de carta.


1 - Abra uma nova mensagem.
2 - Clique na abinha "Origem"
3  - Cole o script do efeito, logo acima do  código responsável pelo fechamento do e-mail. </BODY></HTML>
4 - Cole o seguinte código:

Script: Imagem no Mouse com Efeito Elástico


<DIV id=dot0
style="LEFT: 0px; VISIBILITY: hidden; WIDTH: 9px; POSITION: absolute; TOP: 0px; HEIGHT: 12px"></DIV>

<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<P></P>
<DIV id=dot1
style="LEFT: 122px; POSITION: absolute; TOP: 1371px; HEIGHT: 36px"><IMG alt=""
hspace=0 src="CAMINHO DA GIF" align=baseline
border=0></DIV>
<DIV id=dot2
style="LEFT: 104px; POSITION: absolute; TOP: 1399px; HEIGHT: 24px"><IMG
height=21 src="CAMINHO DA GIF" ></DIV>
<DIV id=dot3
style="LEFT: 67px; POSITION: absolute; TOP: 1413px; HEIGHT: 38px"><IMG height=21
src="CAMINHO DA GIF" ></DIV>
<DIV id=dot4
style="LEFT: 32px; POSITION: absolute; TOP: 1424px; HEIGHT: 26px"><IMG height=21
src="CAMINHO DA GIF" ></DIV>
<DIV id=dot5
style="LEFT: 73px; POSITION: absolute; TOP: 1443px; HEIGHT: 40px"><IMG height=21
src="CAMINHO DA GIF" ></DIV>
<DIV id=dot6
style="LEFT: 128px; POSITION: absolute; TOP: 1453px; HEIGHT: 26px"><IMG
height=30 src="CAMINHO DA GIF" ></DIV>
<P>
<SCRIPT language=JavaScript>

<!-- hide code

/*
script
*/


// T
// Y

var nDots = 7;
if (document.all&&window.print)
document.body.style.cssText="overflow-x:hidden;overflow-y:scroll"
var Xpos = 0;
var Ypos = 0;

// fixed time step, no relation to real time
var DELTAT = .01;
// size of one spring in pixels
var SEGLEN = 10;
// spring constant, stiffness of springs
var SPRINGK = 10;
// all the physics is bogus, just picked stuff to
// make it look okay
var MASS = 1;
var GRAVITY = 50;
var RESISTANCE = 10;
// stopping criterea to prevent endless jittering
// doesn't work when sitting on bottom since floor
// doesn't push back so acceleration always as big
// as gravity
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
// BOUNCE is percent of velocity retained when
// bouncing off a wall
var BOUNCE = 0.75;

var isNetscape = navigator.appName=="Netscape";

// always on for now, could be played with to
// let dots fall to botton, get thrown, etc.
var followmouse = true;

var dots = new Array();
init();

function init()
{
var i = 0;
for (i = 0; i < nDots; i++) {
dots[i] = new dot(i);
}

if (!isNetscape) {
// I only know how to read the locations of the
// <LI> items in IE
//skip this for now
// setInitPositions(dots)
}

// set their positions
for (i = 0; i < nDots; i++) {
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}


if (isNetscape) {
// start right away since they are positioned
// at 0, 0
startanimate();
} else {
// let dots sit there for a few seconds
// since they're hiding on the real bullets
setTimeout("startanimate()", 2000);
}
}



function dot(i)
{
this.X = Xpos;
this.Y = Ypos;
this.dx = 0;
this.dy = 0;
if (isNetscape) {
this.obj = eval("document.dot" + i);
} else {
this.obj = eval("dot" + i + ".style");
}
}


function startanimate() {
setInterval("animate()", 20);
}


// This is to line up the bullets with actual LI tags on the page
// Had to add -DOTSIZE to X and 2*DOTSIZE to Y for IE 5, not sure why
// Still doesn't work great
function setInitPositions(dots)
{
// initialize dot positions to be on top
// of the bullets in the <ul>
var startloc = document.all.tags("LI");
var i = 0;
for (i = 0; i < startloc.length && i < (nDots - 1); i++) {
dots[i+1].X = startloc[i].offsetLeft
startloc[i].offsetParent.offsetLeft - DOTSIZE;
dots[i+1].Y = startloc[i].offsetTop +
startloc[i].offsetParent.offsetTop + 2*DOTSIZE;
}
// put 0th dot above 1st (it is hidden)
dots[0].X = dots[1].X;
dots[0].Y = dots[1].Y - SEGLEN;
}

// just save mouse position for animate() to use
function MoveHandler(e)
{
Xpos = e.pageX;
Ypos = e.pageY;
return true;
}

// just save mouse position for animate() to use
function MoveHandlerIE() {
Xpos = window.event.x + document.body.scrollLeft;
Ypos = window.event.y + document.body.scrollTop;
}

if (isNetscape) {
document.captureEvents(Event.MOUSEMOVE);
document.onMouseMove = MoveHandler;
} else {
document.onmousemove = MoveHandlerIE;
}


function vec(X, Y)
{
this.X = X;
this.Y = Y;
}

// adds force in X and Y to spring for dot[i] on dot[j]
function springForce(i, j, spring)
{
var dx = (dots[i].X - dots[j].X);
var dy = (dots[i].Y - dots[j].Y);
var len = Math.sqrt(dx*dx + dy*dy);
if (len > SEGLEN) {
var springF = SPRINGK * (len - SEGLEN);
spring.X += (dx / len) * springF;
spring.Y += (dy / len) * springF;
}
}


function animate() {
// dots[0] follows the mouse,
// though no dot is drawn there
var start = 0;
if (followmouse) {
dots[0].X = Xpos;
dots[0].Y = Ypos;
start = 1;
}

for (i = start ; i < nDots; i++ ) {

var spring = new vec(0, 0);
if (i > 0) {
springForce(i-1, i, spring);
}
if (i < (nDots - 1)) {
springForce(i+1, i, spring);
}

// air resisitance/friction
var resist = new vec(-dots[i].dx * RESISTANCE,
-dots[i].dy * RESISTANCE);

// compute new accel, including gravity
var accel = new vec((spring.X + resist.X)/ MASS,
(spring.Y + resist.Y)/ MASS + GRAVITY);

// compute new velocity
dots[i].dx += (DELTAT * accel.X);
dots[i].dy += (DELTAT * accel.Y);

// stop dead so it doesn't jitter when nearly still
if (Math.abs(dots[i].dx) < STOPVEL &&
Math.abs(dots[i].dy) < STOPVEL &&
Math.abs(accel.X) < STOPACC &&
Math.abs(accel.Y) < STOPACC) {
dots[i].dx = 0;
dots[i].dy = 0;
}

// move to new position
dots[i].X += dots[i].dx;
dots[i].Y += dots[i].dy;

// get size of window
var height, width;
if (isNetscape) {
height = window.innerHeight + document.scrollTop;
width = window.innerWidth + document.scrollLeft;
} else {
height = document.body.clientHeight + document.body.scrollTop;
width = document.body.clientWidth + document.body.scrollLeft;
}

// bounce of 3 walls (leave ceiling open)
if (dots[i].Y >= height - DOTSIZE - 1) {
if (dots[i].dy > 0) {
dots[i].dy = BOUNCE * -dots[i].dy;
}
dots[i].Y = height - DOTSIZE - 1;
}
if (dots[i].X >= width - DOTSIZE) {
if (dots[i].dx > 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = width - DOTSIZE - 1;
}
if (dots[i].X < 0) {
if (dots[i].dx < 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = 0;
}

// move img to new position
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
}

// end code hiding -->

</SCRIPT>

5 - Vamos inserir as gifs. Procure na Origem o CAMINHO DA GIF. Temos seis caminhos, então o endereço terá que se colado seis vezes, ok?




6 - Clique na "Abinha Editar" e depois em Inserir Imagem  e vá buscar o caminho da sua gif. Navegue até a pastinha onde tem as gifs salvas, clique em abrir.  Aparecerá o caminho:


7 - Copie esse caminho: coloque o cursor dentro do local onde está o endereço dê Ctrl+A para selecionar todo o endereço. Dê Ctrl + C para copiar.
8 - Nessa janelinha clique em cancelar.
9 - Clique na abinha "Origem" e procure no script a frase: "CAMINHO DA GIF".  Selecione-o, apague e cole (CTRL + V)  o endereço.  Cole esse mesmo endereço nos outros cinco "CAMINHO DA GIF".
10 - Clique na aba  "Visualizar" e passe o cursor sobre o papel para checar o resultado.
11 - Visualizado o efeito. Volte a abinha "Editar" e complete a formatação  com :
Background (Formatar/Plano de fundo/ Imagem)
Imagem ( opcional)
Borda colorida
Barra de rolagem colorida
Script para rodapé (opcional - pois muitos interferem no funcionamento do script principal, se colocar prefira o que não tem movimento)
Texto
Música online
Assinatura ( opcional)

Sugestão para Script de Rodapé


<SCRIPT language=JavaScript>
<!--
ScrollSpeed = 100; // milliseconds between scrolls
ScrollChars = 0; // chars scrolled per time period

function SetupTicker() {
// add space to the left of the message
msg = " ~ ~ ~ Escreva seu texto aqui ~ ~ ~ ";
RunTicker();}

function RunTicker() {
window.setTimeout('RunTicker()',ScrollSpeed);
window.status = msg;
msg = msg.substring(ScrollChars) + msg.substring(0,ScrollChars);}
SetupTicker();

<!-- end -->
</SCRIPT>



CI02 - Envie para o grupo um e-mail formatado como foi ensinado nesse tutorial.
Ele deverá conter:
Script com Imagem no Mouse com Efeito Elástico
Background
Imagem ( opcional)
Texto
Borda Colorida
Barra de Rolagem Colorida
Script para Mensagem no Rodapé (opcional)
Música online
Assinatura (opcional)




Não esqueça, por favor:
Colocar no assunto: seu nome ou nick - CI02 - Imagem no Cursor Efeito Elástico
No corpo do e-mail coloque o link correspondente a esse tutorial.
Verificar o peso de sua mensagem.
Não esqueça do anti-banner




Copyright© 2002/2007 Dama Da Noite * Todos os direitos reservados*
Esse  tutorial foi criado por Esmê, em abril de 2007, especialmente para o GRUPO PSP BRASIL 
É expressamente proibida, por lei, a divulgação desta página em outro site ou qualquer outro modo de veiculação sem a autorização expressa da autora ou dos detentores de copyright do texto, da formatação e dos demais elementos que compõem a página. 
Direitos Autorais protegidos pela Lei 9.610 de 19/02/1998.


Nenhum comentário:

Postar um comentário

Para se inscrever nas listas clique nos títulos de cada grupo na página inicial. Comece com as aulas de PSP, depois continue com o PSP + AS, e se quiser siga com o Xara e a Formatação para criar belos e-mails.
Deixe aqui suas opiniões e seja sempre bem-vindo(a).