Aku Punya dot com

Tidak Punya Ide Untuk Menulis

  • Home
  • Kontak
 
Home > Javascript > Membuat tulisan / text matrix
23
Mei
2010

Membuat tulisan / text matrix

Posted by: admin

Cara membuat tulisan / text matrix.

Langsung aja silahkan dilihat demonya dibawah ini.
Demo:

Langkah-langkahnya:
(1) Pasang kode css dan javascipt berikut ini pada bagian <head> blog/website kamu:

Salin kode JAVASCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<style type="text/css">
.matrix { font-family:Lucida Console, Courier, Monotype; font-size:10pt; text-align:center; width:10px; padding:0px; margin:0px;}
</style>
 
<script type="text/javascript" language="JavaScript">
 
<!--
var rows=11; // must be an odd number
var speed=50; // lower is faster
var reveal=2; // between 0 and 2 only. The higher, the faster the word appears
var effectalign="default" //enter "center" to center it.
 
 
var w3c=document.getElementById && !window.opera;;
var ie45=document.all && !window.opera;
var ma_tab, matemp, ma_bod, ma_row, x, y, columns, ma_txt, ma_cho;
var m_coch=new Array();
var m_copo=new Array();
window.onload=function() {
	if (!w3c && !ie45) return
  var matrix=(w3c)?document.getElementById("matrix"):document.all["matrix"];
  ma_txt=(w3c)?matrix.firstChild.nodeValue:matrix.innerHTML;
  ma_txt=" "+ma_txt+" ";
  columns=ma_txt.length;
  if (w3c) {
    while (matrix.childNodes.length) matrix.removeChild(matrix.childNodes[0]);
    ma_tab=document.createElement("table");
    ma_tab.setAttribute("border", 0);
    ma_tab.setAttribute("align", effectalign);
    ma_tab.style.backgroundColor="#000000";
    ma_bod=document.createElement("tbody");
    for (x=0; x<rows; x++) {
      ma_row=document.createElement("tr");
      for (y=0; y<columns; y++) {
        matemp=document.createElement("td");
        matemp.setAttribute("id", "Mx"+x+"y"+y);
        matemp.className="matrix";
        matemp.appendChild(document.createTextNode(String.fromCharCode(160)));
        ma_row.appendChild(matemp);
      }
      ma_bod.appendChild(ma_row);
    }
    ma_tab.appendChild(ma_bod);
    matrix.appendChild(ma_tab);
  } else {
    ma_tab='<ta'+'ble align="'+effectalign+'" border="0" style="background-color:#000000">';
    for (var x=0; x<rows; x++) {
      ma_tab+='<t'+'r>';
      for (var y=0; y<columns; y++) {
        ma_tab+='<t'+'d class="matrix" id="Mx'+x+'y'+y+'">&nbsp;</'+'td>';
      }
      ma_tab+='</'+'tr>';
    }
    ma_tab+='</'+'table>';
    matrix.innerHTML=ma_tab;
  }
  ma_cho=ma_txt;
  for (x=0; x<columns; x++) {
    ma_cho+=String.fromCharCode(32+Math.floor(Math.random()*94));
    m_copo[x]=0;
  }
  ma_bod=setInterval("mytricks()", speed);
}
 
function mytricks() {
  x=0;
  for (y=0; y<columns; y++) {
    x=x+(m_copo[y]==100);
    ma_row=m_copo[y]%100;
    if (ma_row && m_copo[y]<100) {
      if (ma_row<rows+1) {
        if (w3c) {
          matemp=document.getElementById("Mx"+(ma_row-1)+"y"+y);
          matemp.firstChild.nodeValue=m_coch[y];
        }
        else {
          matemp=document.all["Mx"+(ma_row-1)+"y"+y];
          matemp.innerHTML=m_coch[y];
        }
        matemp.style.color="#33ff66";
        matemp.style.fontWeight="bold";
      }
      if (ma_row>1 && ma_row<rows+2) {
        matemp=(w3c)?document.getElementById("Mx"+(ma_row-2)+"y"+y):document.all["Mx"+(ma_row-2)+"y"+y];
        matemp.style.fontWeight="normal";
        matemp.style.color="#00ff00";
      }
      if (ma_row>2) {
          matemp=(w3c)?document.getElementById("Mx"+(ma_row-3)+"y"+y):document.all["Mx"+(ma_row-3)+"y"+y];
        matemp.style.color="#009900";
      }
      if (ma_row<Math.floor(rows/2)+1) m_copo[y]++;
      else if (ma_row==Math.floor(rows/2)+1 && m_coch[y]==ma_txt.charAt(y)) zoomer(y);
      else if (ma_row<rows+2) m_copo[y]++;
      else if (m_copo[y]<100) m_copo[y]=0;
    }
    else if (Math.random()>0.9 && m_copo[y]<100) {
      m_coch[y]=ma_cho.charAt(Math.floor(Math.random()*ma_cho.length));
      m_copo[y]++;
    }
  }
  if (x==columns) clearInterval(ma_bod);
}
 
function zoomer(ycol) {
  var mtmp, mtem, ytmp;
  if (m_copo[ycol]==Math.floor(rows/2)+1) {
    for (ytmp=0; ytmp<rows; ytmp++) {
      if (w3c) {
        mtmp=document.getElementById("Mx"+ytmp+"y"+ycol);
        mtmp.firstChild.nodeValue=m_coch[ycol];
      }
      else {
        mtmp=document.all["Mx"+ytmp+"y"+ycol];
        mtmp.innerHTML=m_coch[ycol];
      }
      mtmp.style.color="#33ff66";
      mtmp.style.fontWeight="bold";
    }
    if (Math.random()<reveal) {
      mtmp=ma_cho.indexOf(ma_txt.charAt(ycol));
      ma_cho=ma_cho.substring(0, mtmp)+ma_cho.substring(mtmp+1, ma_cho.length);
    }
    if (Math.random()<reveal-1) ma_cho=ma_cho.substring(0, ma_cho.length-1);
    m_copo[ycol]+=199;
    setTimeout("zoomer("+ycol+")", speed);
  }
  else if (m_copo[ycol]>200) {
    if (w3c) {
      mtmp=document.getElementById("Mx"+(m_copo[ycol]-201)+"y"+ycol);
      mtem=document.getElementById("Mx"+(200+rows-m_copo[ycol]--)+"y"+ycol);
    }
    else {
      mtmp=document.all["Mx"+(m_copo[ycol]-201)+"y"+ycol];
      mtem=document.all["Mx"+(200+rows-m_copo[ycol]--)+"y"+ycol];
    }
    mtmp.style.fontWeight="normal";
    mtem.style.fontWeight="normal";
    setTimeout("zoomer("+ycol+")", speed);
  }
  else if (m_copo[ycol]==200) m_copo[ycol]=100+Math.floor(rows/2);
  if (m_copo[ycol]>100 && m_copo[ycol]<200) {
    if (w3c) {
      mtmp=document.getElementById("Mx"+(m_copo[ycol]-101)+"y"+ycol);
      mtmp.firstChild.nodeValue=String.fromCharCode(160);
      mtem=document.getElementById("Mx"+(100+rows-m_copo[ycol]--)+"y"+ycol);
      mtem.firstChild.nodeValue=String.fromCharCode(160);
    }
    else {
      mtmp=document.all["Mx"+(m_copo[ycol]-101)+"y"+ycol];
      mtmp.innerHTML=String.fromCharCode(160);
      mtem=document.all["Mx"+(100+rows-m_copo[ycol]--)+"y"+ycol];
      mtem.innerHTML=String.fromCharCode(160);
    }
    setTimeout("zoomer("+ycol+")", speed);
  }
}
// -->
</script>


(2) Kemudian untuk menampilkan tulisan / text matrixnya, pasang kode berikut dibagian body / post / widget.

Salin kode HTML
1
<div id="matrix">Tulisan Matrix</div>


Selamat mencoba!!


memuat halaman
Reload
«
»
iklan

14 Komentar

Javascript, Tips trik blog

Postingan yang lain:
  • Cara membuat notify comment checkbox
  • Cara mengganti background blog
  • Mengganti gambar icon blog / website
  • Cara memunculkan hovercard gravatar
  • Cara mengganti cursor

Ada 14 komentar di “Membuat tulisan / text matrix”

Tulis komentar
Komentar dari james ambon:
Dari IP: 203.78.118.6
Tanggal 25 September 2010 jam 6:28 am

kog kaga muncul2 ya bang? :roll:

Balas komentar

Komentar dari bagus:
Dari IP: 110.138.83.139
Tanggal 22 November 2010 jam 11:46 pm

Mantep kk … ;-)

Balas komentar

Komentar dari Lover:
Dari IP: 203.190.53.170
Tanggal 30 Januari 2011 jam 1:16 am

KK Jangan di protection masa tulis semua isa kurus donk aku :x

Balas komentar

Balasan dari admin:
Dari IP: 64.255.180.213
Tanggal 30 Januari 2011 jam 2:54 am

hahaha…. :mrgreen:
kok ditulis manual…
kan tinggal di klik, trus salin deh kodenya…. :lol:

Balas komentar

Komentar dari roynaldo:
Dari IP: 125.162.70.157
Tanggal 3 Februari 2011 jam 3:13 am

Om Diklik KoQ Ngak Bisa kyak mna Om :cry: :?:

Balas komentar

Balasan dari admin:
Dari IP: 110.139.125.85
Tanggal 3 Februari 2011 jam 8:53 pm

bisa kok,,, klik aja tulisan ‘Salin kode’ :twisted:

Balas komentar

Balasan dari admin:
Dari IP: 125.167.235.186
Tanggal 10 Maret 2011 jam 10:52 pm

oh, iya.. klo kode yg kedua gak bisa diklik (gak muncul), window kode yg pertama harus di close dulu… baru ngerti saia.. :oops:

Balas komentar

Komentar dari Geafry Necolsen:
Dari IP: 182.3.119.153
Tanggal 2 Maret 2011 jam 10:52 pm

ini admin kuq ngeyel seh! ga bisa tau… :x
coba deh baca dari sisi user

Balas komentar

Balasan dari admin:
Dari IP: 64.255.164.81
Tanggal 3 Maret 2011 jam 1:56 pm

waduhh… emangnya yg gak bisa diklik yg mna ….?? :???:

Balas komentar

Komentar dari Geafry Necolsen:
Dari IP: 182.4.148.48
Tanggal 5 Maret 2011 jam 7:24 pm

apa semua komentator diatas pada bohong, semua ngalami fenomena ga bisa di copy :oops: kasian adminya di amuk massa

Balas komentar

Balasan dari admin:
Dari IP: 125.167.235.186
Tanggal 5 Maret 2011 jam 8:51 pm

tulisan diatas emang gak bisa di copy, tapi masih bisa di klik, harap dibedakan antara tidak bisa di copy dan tidak bisa di klik :lol:

Balas komentar

Komentar dari ferdy:
Dari IP: 222.124.95.241
Tanggal 8 Maret 2011 jam 6:10 pm

asssssssssleeeeeeeeeeeee mantaaaaaaaaaaaaaaaaappppppppp ;-)

Balas komentar

Komentar dari putri:
Dari IP: 119.235.249.90
Tanggal 28 September 2011 jam 12:59 pm

oi……..kerennnnnnnnnnn :lol:

Balas komentar

Komentar dari anwar:
Dari IP: 112.215.66.23
Tanggal 18 Desember 2011 jam 10:37 am

Numpang nimbrung ah :lol:

Sukses klik sukses copas, yg gak bisa diatas IDLM :p

Balas komentar

Tulis Komentar


website / blog

Komentar:

Emoticon
Emoticon:
X
icon_smile.gif icon_wink.gif icon_neutral.gif icon_mad.gif icon_wc.gif icon_uhuk.gif icon_twisted.gif icon_eek.gif icon_sad.gif icon_rolleyes.gif icon_razz.gif icon_puyeng.gif icon_pliss.gif icon_payah.gif icon_lidah.gif icon_redface.gif icon_surprised.gif icon_mrgreen.gif icon_lol.gif icon_kencing.gif icon_idea.gif icon_biggrin.gif icon_evil.gif icon_dead.gif icon_cry.gif icon_cool.gif icon_bom.gif icon_bisik-bisik.gif icon_ayolah.gif icon_arrow.gif icon_confused.gif icon_question.gif icon_exclaim.gif 

Batalkan balasan
 
    CO.CC Free Domain
  •     Komentar terbaru

    • @ayu_ayudewi: kok lama sih lodingnya? :wc: #
    • Niko98.com: MAU DOWNLOAD GAMES GAMES GRATI #
    • Lmag: efeknya keren, daunnya pada be #
    • gm{joker}: tu loe bisa aneh ya loe #
    • sfdxg: ya adah kok gk ada karakteh wa #
    • sfdxg: hei loe cadet sinih bay pb ama #
    • akbar: aku anak yang rajin loe wow #
    • akbar: kalau ginuh gw ngapain enak ma #
    • admin: itu diatas gambar2 jam, step2n #
    • muzli: q pk blogspot, diatas dimana,, #
  •     Kategori

    • Adsense
    • Aneh
    • Biografi
    • Blog
    • Cewek
    • CSS
    • CSS3
    • Dofollow
    • DVD
    • Emoticon
    • Facebook
    • Game
    • Google
    • Gratis
    • Hiburan
    • Javascript
    • Kamus Online
    • Kesehatan
    • Kiamat
    • Kids
    • Komik
    • Lucu
    • Menu Bulan Puasa
    • Mp3
    • PHP
    • Rank
    • Resep
    • Search Engine
    • SEO
    • Sitemap
    • Story
    • Tak Berkategori
    • Tak Penting
    • Tips
    • Tips trik blog
    • Traveling
    • Twitter
    • Wedding
    • Wordpress
    • Youtube
  •     Arsip

    • Januari 2012
    • Desember 2011
    • November 2011
    • Oktober 2011
    • September 2011
    • Agustus 2011
    • Juli 2011
    • Juni 2011
    • Mei 2011
    • April 2011
    • Maret 2011
    • Februari 2011
    • Januari 2011
    • Desember 2010
    • November 2010
    • Oktober 2010
    • September 2010
    • Agustus 2010
    • Juli 2010
    • Juni 2010
    • Mei 2010
    • April 2010
    • Maret 2010
    • Februari 2010
    • Januari 2010
    • Desember 2009
    • November 2009
    • Oktober 2009
    • September 2009
    • Agustus 2009
    • Juli 2009
    • Juni 2009
    • Mei 2009
    Adsense Indonesia
    ...
      Page: /membuat-tulisan-text-matrix.html : Netherlands Calling Card
      Calling Card
      Versicherungsvergleich

Aku Punya dot com © 2009 - 2012
Powered by WordPress
Best viewed in Firefox, Opera, and Chrome at 1280 x 960 screen resolutions

Feed  |  Sitemap  |  Recent Posts
Tukar Link  |  Pasang Banner  |  Kontak

26 queries. 0,841 seconds

Toolbar
tulis komentar
     
14 komentar
Komentar 14
kembali ke bawah
Bawah
kembali ke atas
Atas
Games
  • »  Game Puzzle
  • »  Game Tetris
  • Game Puzzle  
     
    Game Tetris  
     
    Shoutbox
    Shoutbox  

     
    Suka
    Aku Punya fans  
     
    Pencarian
    memuat ...