Advertisement
EkoAisyah

Cursor

Jun 21st, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.35 KB | None | 0 0
  1. <style type="text/css">
  2. <!--
  3. /*Do not Alter these. Set for alignment*/
  4. .css1{
  5. position:absolute;top:0px;left:0px;
  6. width:16px;height:16px;
  7. font-family:Arial,sans-serif;
  8. font-size:16px;
  9. text-align:center;
  10. font-weight:bold;
  11. }
  12. .css2{
  13. position:absolute;top:0px;left:0px;
  14. width:10px;height:10px;
  15. font-family:Arial,sans-serif;
  16. font-size:10px;
  17. text-align:center;
  18. }
  19. //-->
  20. </style>
  21.  
  22. <SCRIPT LANGUAGE="JavaScript">
  23. <!-- Mouse Follow Clock 3 from Rainbow Arch -->
  24. <!-- This script and many more from : -->
  25. <!-- http://rainbow.arch.scriptmania.com -->
  26.  
  27. <!-- Mouse Follow Clock 3 from http://rainbow.arch.scriptmania.com
  28. //Hide from older browsers
  29. if (document.getElementById&&!document.layers){
  30.  
  31. //Clock colours
  32. dCol='#00ff00';//date colour.
  33. fCol='#ffffff';//face colour.
  34. sCol='#ffffff';//seconds colour.
  35. mCol='#00ff00';//minutes colour.
  36. hCol='#00ff00';//hours colour.
  37.  
  38. //Controls
  39. del=0.6; //Follow mouse speed.
  40. ref=40; //Run speed (timeout).
  41.  
  42. //Alter nothing below! Alignments will be lost!
  43. var ieType=(typeof window.innerWidth != 'number');
  44. var docComp=(document.compatMode);
  45. var docMod=(docComp && docComp.indexOf("CSS") != -1);
  46. var ieRef=(ieType && docMod)
  47. ?document.documentElement:document.body;
  48. theDays=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
  49. theMonths=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");
  50. date=new Date();
  51. day=date.getDate();
  52. year=date.getYear();
  53. if (year < 2011) year=year+1900;
  54. tmpdate=" "+theDays[date.getDay()]+" "+day+" "+theMonths[date.getMonth()]+" "+year;
  55. D=tmpdate.split("");
  56. N='3 4 5 6 7 8 9 10 11 12 1 2';
  57. N=N.split(" ");
  58. F=N.length;
  59. H='...';
  60. H=H.split("");
  61. M='.....';
  62. M=M.split("");
  63. S='.....';
  64. S=S.split("");
  65. siz=40;
  66. eqf=360/F;
  67. eqd=360/D.length;
  68. han=siz/5.5;
  69. ofy=-7;
  70. ofx=-3;
  71. ofst=70;
  72. tmr=null;
  73. vis=true;
  74. mouseY=0;
  75. mouseX=0;
  76. dy=new Array();
  77. dx=new Array();
  78. zy=new Array();
  79. zx=new Array();
  80. tmps=new Array();
  81. tmpm=new Array();
  82. tmph=new Array();
  83. tmpf=new Array();
  84. tmpd=new Array();
  85. var sum=parseInt(D.length+F+H.length+M.length+S.length)+1;
  86. for (i=0; i < sum; i++){
  87. dy[i]=0;
  88. dx[i]=0;
  89. zy[i]=0;
  90. zx[i]=0;
  91. }
  92.  
  93. algn=new Array();
  94. for (i=0; i < D.length; i++){
  95. algn[i]=(parseInt(D[i]) || D[i]==0)?10:9;
  96. document.write('<div id="_date'+i+'" class="css2" style="font-size:'+algn[i]+'px;color:'+dCol+'">'+D[i]+'<\/div>');
  97. tmpd[i]=document.getElementById("_date"+i).style;
  98. }
  99. for (i=0; i < F; i++){
  100. document.write('<div id="_face'+i+'" class="css2" style="color:'+fCol+'">'+N[i]+'<\/div>');
  101. tmpf[i]=document.getElementById("_face"+i).style;
  102. }
  103. for (i=0; i < H.length; i++){
  104. document.write('<div id="_hours'+i+'" class="css1" style="color:'+hCol+'">'+H[i]+'<\/div>');
  105. tmph[i]=document.getElementById("_hours"+i).style;
  106. }
  107. for (i=0; i < M.length; i++){
  108. document.write('<div id="_minutes'+i+'" class="css1" style="color:'+mCol+'">'+M[i]+'<\/div>');
  109. tmpm[i]=document.getElementById("_minutes"+i).style;
  110. }
  111. for (i=0; i < S.length; i++){
  112. document.write('<div id="_seconds'+i+'" class="css1" style="color:'+sCol+'">'+S[i]+'<\/div>');
  113. tmps[i]=document.getElementById("_seconds"+i).style;
  114. }
  115.  
  116. function onoff(){
  117. if (vis){
  118. vis=false;
  119. document.getElementById("control").value="Clock On";
  120. }
  121. else{
  122. vis=true;
  123. document.getElementById("control").value="Clock Off";
  124. Delay();
  125. }
  126. kill();
  127. }
  128.  
  129. function kill(){
  130. if (vis)
  131. document.onmousemove=mouse;
  132. else
  133. document.onmousemove=null;
  134. }
  135.  
  136. function mouse(e){
  137. var msy = (!ieType)?window.pageYOffset:0;
  138. if (!e) e = window.event;
  139. if (typeof e.pageY == 'number'){
  140. mouseY = e.pageY + ofst - msy;
  141. mouseX = e.pageX + ofst;
  142. }
  143. else{
  144. mouseY = e.clientY + ofst - msy;
  145. mouseX = e.clientX + ofst;
  146. }
  147. if (!vis) kill();
  148. }
  149. document.onmousemove=mouse;
  150.  
  151. function winDims(){
  152. winH=(ieType)?ieRef.clientHeight:window.innerHeight;
  153. winW=(ieType)?ieRef.clientWidth:window.innerWidth;
  154. }
  155. winDims();
  156. window.onresize=new Function("winDims()");
  157.  
  158. function ClockAndAssign(){
  159. time = new Date();
  160. secs = time.getSeconds();
  161. sec = Math.PI * (secs-15) / 30;
  162. mins = time.getMinutes();
  163. min = Math.PI * (mins-15) / 30;
  164. hrs = time.getHours();
  165. hr = Math.PI * (hrs-3) / 6 + Math.PI * parseInt(time.getMinutes()) / 360;
  166.  
  167. for (i=0; i < S.length; i++){
  168. tmps[i].top=dy[D.length+F+H.length+M.length+i]+ofy+(i*han)*Math.sin(sec)+scrollY+"px";
  169. tmps[i].left=dx[D.length+F+H.length+M.length+i]+ofx+(i*han)*Math.cos(sec)+"px";
  170. }
  171. for (i=0; i < M.length; i++){
  172. tmpm[i].top=dy[D.length+F+H.length+i]+ofy+(i*han)*Math.sin(min)+scrollY+"px";
  173. tmpm[i].left=dx[D.length+F+H.length+i]+ofx+(i*han)*Math.cos(min)+"px";
  174. }
  175. for (i=0; i < H.length; i++){
  176. tmph[i].top=dy[D.length+F+i]+ofy+(i*han)*Math.sin(hr)+scrollY+"px";
  177. tmph[i].left=dx[D.length+F+i]+ofx+(i*han)*Math.cos(hr)+"px";
  178. }
  179. for (i=0; i < F; i++){
  180. tmpf[i].top=dy[D.length+i]+siz*Math.sin(i*eqf*Math.PI/180)+scrollY+"px";
  181. tmpf[i].left=dx[D.length+i]+siz*Math.cos(i*eqf*Math.PI/180)+"px";
  182. }
  183. for (i=0; i < D.length; i++){
  184. tmpd[i].top=dy[i]+siz*1.5*Math.sin(-sec+i*eqd*Math.PI/180)+scrollY+"px";
  185. tmpd[i].left=dx[i]+siz*1.5*Math.cos(-sec+i*eqd*Math.PI/180)+"px";
  186. }
  187. if (!vis)clearTimeout(tmr);
  188. }
  189.  
  190. buffW=(ieType)?80:90;
  191. function Delay(){
  192. scrollY=(ieType)?ieRef.scrollTop:window.pageYOffset;
  193. if (!vis){
  194. dy[0]=-100;
  195. dx[0]=-100;
  196. }
  197. else{
  198. zy[0]=Math.round(dy[0]+=((mouseY)-dy[0])*del);
  199. zx[0]=Math.round(dx[0]+=((mouseX)-dx[0])*del);
  200. }
  201. for (i=1; i < sum; i++){
  202. if (!vis){
  203. dy[i]=-100;
  204. dx[i]=-100;
  205. }
  206. else{
  207. zy[i]=Math.round(dy[i]+=(zy[i-1]-dy[i])*del);
  208. zx[i]=Math.round(dx[i]+=(zx[i-1]-dx[i])*del);
  209. }
  210. if (dy[i-1] >= winH-80) dy[i-1]=winH-80;
  211. if (dx[i-1] >= winW-buffW) dx[i-1]=winW-buffW;
  212. }
  213.  
  214. tmr=setTimeout('Delay()',ref);
  215. ClockAndAssign();
  216. }
  217. window.onload=Delay;
  218. }
  219. //-->
  220. </script>
  221.  
  222.  
  223. <style type="text/css">
  224.  
  225.  
  226.  
  227. html, body {
  228. color: white;
  229. background-color: #000000;
  230. background-image: url(http://i66.servimg.com/u/f66/14/86/38/04/ground10.gif);
  231. background-attachment: scroll;
  232. background-position: top center;
  233. background-repeat: repeat;
  234. }
  235.  
  236. a {
  237. background-color: transparent;
  238. color: #ffffff;
  239. }
  240.  
  241. #p404 {
  242. position: absolute;
  243. top: 20%;
  244. left: 0px;
  245. width: 100%;
  246. height: 1px;
  247. overflow: visible;
  248. visibility: visible;
  249. display: block;
  250. }
  251.  
  252. #content {
  253. margin-left: -320px;
  254. position: absolute;
  255. top: -100px;
  256. left: 50%;
  257. width: 640px;
  258. height: 200px;
  259. visibility: visible;
  260. }
  261.  
  262. #errormessage {
  263. font: 90px garamond;
  264. line-height: 200%;
  265. text-align: center;
  266. }
  267.  
  268. #title, #footer {
  269. text-align: center;
  270. }
  271.  
  272. #title span {
  273. background-color: #c0c0c0;
  274. color: #000080;
  275. }
  276. </style>
  277.  
  278. <div align="center">
  279.  
  280. <br>
  281.  
  282. </font></CENTER>
  283.  
  284. </object>
  285.  
  286. <div id="example1">
  287. <p align="center"></p>
  288.  
  289. </div>
  290. <SCRIPT LANGUAGE="JavaScript">
  291. /*
  292. An object-oriented Typing Text script, to allow for multiple instances.
  293. A script that causes any text inside any text element to be "typed out", one letter at a time. Note that any HTML tags will not be included in the typed output, to prevent them from causing problems. Tested in Firefox v1.5.0.1, Opera v8.52, Konqueror v3.5.1, and IE v6.
  294. Browsers that do not support this script will simply see the text fully displayed from the start, including any HTML tags.
  295.  
  296. Functions defined:
  297. TypingText(element, [interval = 100,] [cursor = "",] [finishedCallback = function(){return}]):
  298. Create a new TypingText object around the given element. Optionally
  299. specify a delay between characters of interval milliseconds.
  300. cursor allows users to specify some HTML to be appended to the end of
  301. the string whilst typing. Optionally, can also be a function which
  302. accepts the current text as an argument. This allows the user to
  303. create a "dynamic cursor" which changes depending on the latest character
  304. or the current length of the string.
  305. finishedCallback allows advanced scripters to supply a function
  306. to be executed on finishing. The function must accept no arguments.
  307.  
  308. TypingText.run():
  309. Run the effect.
  310.  
  311. static TypingText.runAll():
  312. Run all TypingText-enabled objects on the page.
  313. */
  314.  
  315. TypingText = function(element, interval, cursor, finishedCallback) {
  316. if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) {
  317. this.running = true; // Never run.
  318. return;
  319. }
  320. this.element = element;
  321. this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; });
  322. this.interval = (typeof interval == "undefined" ? 20 : interval);
  323. this.origText = this.element.innerHTML;
  324. this.unparsedOrigText = this.origText;
  325. this.cursor = (cursor ? cursor : "");
  326. this.currentText = "";
  327. this.currentChar = 0;
  328. this.element.typingText = this;
  329. if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++;
  330. TypingText.all.push(this);
  331. this.running = false;
  332. this.inTag = false;
  333. this.tagBuffer = "";
  334. this.inHTMLEntity = false;
  335. this.HTMLEntityBuffer = "";
  336. }
  337. TypingText.all = new Array();
  338. TypingText.currentIndex = 0;
  339. TypingText.runAll = function() {
  340. for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run();
  341. }
  342. TypingText.prototype.run = function() {
  343. if(this.running) return;
  344. if(typeof this.origText == "undefined") {
  345. setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); // We haven't finished loading yet. Have patience.
  346. return;
  347. }
  348. if(this.currentText == "") this.element.innerHTML = "";
  349. // this.origText = this.origText.replace(/<([^<])*>/, ""); // Strip HTML from text.
  350. if(this.currentChar < this.origText.length) {
  351. if(this.origText.charAt(this.currentChar) == "<" && !this.inTag) {
  352. this.tagBuffer = "<";
  353. this.inTag = true;
  354. this.currentChar++;
  355. this.run();
  356. return;
  357. } else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) {
  358. this.tagBuffer += ">";
  359. this.inTag = false;
  360. this.currentText += this.tagBuffer;
  361. this.currentChar++;
  362. this.run();
  363. return;
  364. } else if(this.inTag) {
  365. this.tagBuffer += this.origText.charAt(this.currentChar);
  366. this.currentChar++;
  367. this.run();
  368. return;
  369. } else if(this.origText.charAt(this.currentChar) == "&" && !this.inHTMLEntity) {
  370. this.HTMLEntityBuffer = "&";
  371. this.inHTMLEntity = true;
  372. this.currentChar++;
  373. this.run();
  374. return;
  375. } else if(this.origText.charAt(this.currentChar) == ";" && this.inHTMLEntity) {
  376. this.HTMLEntityBuffer += ";";
  377. this.inHTMLEntity = false;
  378. this.currentText += this.HTMLEntityBuffer;
  379. this.currentChar++;
  380. this.run();
  381. return;
  382. } else if(this.inHTMLEntity) {
  383. this.HTMLEntityBuffer += this.origText.charAt(this.currentChar);
  384. this.currentChar++;
  385. this.run();
  386. return;
  387. } else {
  388. this.currentText += this.origText.charAt(this.currentChar);
  389. }
  390. this.element.innerHTML = this.currentText;
  391. this.element.innerHTML += (this.currentChar < this.origText.length - 1 ? (typeof this.cursor == "function" ? this.cursor(this.currentText) : this.cursor) : "");
  392. this.currentChar++;
  393. setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval);
  394. } else {
  395. this.currentText = "";
  396. this.currentChar = 0;
  397. this.running = false;
  398. this.finishedCallback();
  399. }
  400. }
  401. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement