웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
정말 멋있는 글자 변환 스크립트
2003.11.07 19:12
미리보기 : http://myhome.hanafos.com/~bmw3000cc/good_script.htm
<head> 부분에 삽입 하는 태그
<style>
v:* { behavior: url(#default#VML); }
</style>
<body>아랫 부분에 삽입하는 스크립트 태그
<script>
// 변환돼는 메시지
var message=new Array("Hi All user", "My Web font mania", "My homepage webfont home", "You free webfont downlaod", "Go Go My homepage")
// 라인색상 페이지가 넘어갈때 마다 변환 됩니다. 순서대로
var outlinecolor=new Array("white", "black","red")
// 그라데이션 아래 색상
var fillcolor1=new Array("blue", "green", "white", "green")
// 그라데이션 위쪽 색상
var fillcolor2=new Array("yellow", "olive", "black", "black")
// 글자가 변환돼기전에 원을 그리는 문자 (사용자가 임의로 조작가능)
var circlemark=new Array("-")
// 라인 두께
var strkweight=2
// 텍스트 변환이 끝난뒤 정죄돼 있는 시간 (초단위)
var pause=2
// 불투명도를 조절하는 부분
var strengthopacity="60%"
// 반원의 대비 0.1-1 까지 입력 가능
var circlesize=0.6
///// 건들지 마시오 //////
var outerwidth=document.body.clientWidth
var outerheight=document.body.clientHeight
var innerwidth=Math.floor(circlesize*outerwidth)
var innerheight=Math.floor(circlesize*outerheight)
var posleft=(outerwidth-innerwidth)/2
var postop=(outerheight-innerheight)/2+50
var path=new Array()
var i_message=0
var i_outlinecolor=0
var i_fillcolor1=0
var i_fillcolor2=0
var i_messagelength=0
var longestmessage=0
pause*=1000
var ie=document.getElementById&&document.all?1:0
for (i=0;i<=message.length-1;i++) {
if (message[i].length>longestmessage) {
longestmessage=message[i].length
}
longestmessage+=4
}
for (i=0;i<=message.length-1;i++) {
var emptyspace=""
var i_emptyspace=(longestmessage-message[i].length)/2
for (ii=0;ii<=i_emptyspace;ii++) {
emptyspace+=circlemark
}
message[i]=emptyspace+" "+message[i]+" "+emptyspace
}
function changeform() {
if (i_outlinecolor >= outlinecolor.length) {i_outlinecolor=0}
if (i_fillcolor1 >= fillcolor1.length) {i_fillcolor1=0}
if (i_fillcolor2 >= fillcolor2.length) {i_fillcolor2=0}
document.getElementById('strokeid').color=outlinecolor[i_outlinecolor]
document.getElementById('fillid').color=fillcolor1[i_fillcolor1]
document.getElementById('fillid').color2=fillcolor2[i_fillcolor2]
if (i_message < message.length) {tick()}
else {document.getElementById('textpathid').string=""}
}
function tick() {
if (i_messagelength <= message[i_message].length) {
var messagestringend=""
var messagestring=message[i_message].substring(0, i_messagelength)+messagestringend
document.getElementById('textpathid'+ ').string=messagestring
var timer=setTimeout("tick()",50)
i_messagelength++
}
else {
clearTimeout(timer)
i_messagelength=0
i_message++
i_outlinecolor++
i_fillcolor1++
i_fillcolor2++
var timer=setTimeout("changeform()",pause)
}
}
if (ie) {
document.write('<div id="roofid" style="position:absolute;left:0px;top:0px;width:'+outerwidth+'px;height:'+outerheight+'px;overflow:hidden;">')
document.write('<v:oval id="tc" style="position:absolute;top:'+postop+';left:'+posleft+';width:'+innerwidth+';height:'+innerheight+'">')
document.write('<v:shadow on="t" opacity="'+strengthopacity+'"/>')
document.write('<v:stroke id="strokeid" weight="'+strkweight+'pt" color="blue"/>')
document.write('<v:fill id="fillid" on="True" color="'+fillcolor1[0]+'" color2="'+fillcolor2[0]+'" opacity="'+strengthopacity+'" opacity2="'+strengthopacity+'" type="gradient"/>')
document.write('<v:path textpathok="t"/>')
document.write('<v:textpath id="textpathid" on="t" id="mytp" style="font-family:'Arial Black'; " fitpath="t" string=""/>')
document.write('</v:oval>')
window.onload=changeform
}
</script>
<head> 부분에 삽입 하는 태그
<style>
v:* { behavior: url(#default#VML); }
</style>
<body>아랫 부분에 삽입하는 스크립트 태그
<script>
// 변환돼는 메시지
var message=new Array("Hi All user", "My Web font mania", "My homepage webfont home", "You free webfont downlaod", "Go Go My homepage")
// 라인색상 페이지가 넘어갈때 마다 변환 됩니다. 순서대로
var outlinecolor=new Array("white", "black","red")
// 그라데이션 아래 색상
var fillcolor1=new Array("blue", "green", "white", "green")
// 그라데이션 위쪽 색상
var fillcolor2=new Array("yellow", "olive", "black", "black")
// 글자가 변환돼기전에 원을 그리는 문자 (사용자가 임의로 조작가능)
var circlemark=new Array("-")
// 라인 두께
var strkweight=2
// 텍스트 변환이 끝난뒤 정죄돼 있는 시간 (초단위)
var pause=2
// 불투명도를 조절하는 부분
var strengthopacity="60%"
// 반원의 대비 0.1-1 까지 입력 가능
var circlesize=0.6
///// 건들지 마시오 //////
var outerwidth=document.body.clientWidth
var outerheight=document.body.clientHeight
var innerwidth=Math.floor(circlesize*outerwidth)
var innerheight=Math.floor(circlesize*outerheight)
var posleft=(outerwidth-innerwidth)/2
var postop=(outerheight-innerheight)/2+50
var path=new Array()
var i_message=0
var i_outlinecolor=0
var i_fillcolor1=0
var i_fillcolor2=0
var i_messagelength=0
var longestmessage=0
pause*=1000
var ie=document.getElementById&&document.all?1:0
for (i=0;i<=message.length-1;i++) {
if (message[i].length>longestmessage) {
longestmessage=message[i].length
}
longestmessage+=4
}
for (i=0;i<=message.length-1;i++) {
var emptyspace=""
var i_emptyspace=(longestmessage-message[i].length)/2
for (ii=0;ii<=i_emptyspace;ii++) {
emptyspace+=circlemark
}
message[i]=emptyspace+" "+message[i]+" "+emptyspace
}
function changeform() {
if (i_outlinecolor >= outlinecolor.length) {i_outlinecolor=0}
if (i_fillcolor1 >= fillcolor1.length) {i_fillcolor1=0}
if (i_fillcolor2 >= fillcolor2.length) {i_fillcolor2=0}
document.getElementById('strokeid').color=outlinecolor[i_outlinecolor]
document.getElementById('fillid').color=fillcolor1[i_fillcolor1]
document.getElementById('fillid').color2=fillcolor2[i_fillcolor2]
if (i_message < message.length) {tick()}
else {document.getElementById('textpathid').string=""}
}
function tick() {
if (i_messagelength <= message[i_message].length) {
var messagestringend=""
var messagestring=message[i_message].substring(0, i_messagelength)+messagestringend
document.getElementById('textpathid'+ ').string=messagestring
var timer=setTimeout("tick()",50)
i_messagelength++
}
else {
clearTimeout(timer)
i_messagelength=0
i_message++
i_outlinecolor++
i_fillcolor1++
i_fillcolor2++
var timer=setTimeout("changeform()",pause)
}
}
if (ie) {
document.write('<div id="roofid" style="position:absolute;left:0px;top:0px;width:'+outerwidth+'px;height:'+outerheight+'px;overflow:hidden;">')
document.write('<v:oval id="tc" style="position:absolute;top:'+postop+';left:'+posleft+';width:'+innerwidth+';height:'+innerheight+'">')
document.write('<v:shadow on="t" opacity="'+strengthopacity+'"/>')
document.write('<v:stroke id="strokeid" weight="'+strkweight+'pt" color="blue"/>')
document.write('<v:fill id="fillid" on="True" color="'+fillcolor1[0]+'" color2="'+fillcolor2[0]+'" opacity="'+strengthopacity+'" opacity2="'+strengthopacity+'" type="gradient"/>')
document.write('<v:path textpathok="t"/>')
document.write('<v:textpath id="textpathid" on="t" id="mytp" style="font-family:'Arial Black'; " fitpath="t" string=""/>')
document.write('</v:oval>')
window.onload=changeform
}
</script>
댓글 12
제목 | 글쓴이 | 날짜 |
---|---|---|
공유 메모리 제어에 관한 함수 정리 (공유메모리) [5] | Simsim | 2004.08.16 |
접속자 IP 주소 텍스트로 저장 [7] | 천상원 | 2004.08.15 |
PHP프로그램에 간단한 인증(로그인) 걸기. [15] | Lepas | 2004.08.09 |
파일업로드시 파일명 중복되지 않게 저장하기... [6] | 김지호 | 2004.08.06 |
ISO 3166 국가코드로인한, 국가 검출소스 [4] | kein23 | 2004.08.04 |
IP 뒤에 두칸 글자 길이에 따라서 *로 나타내기 [13] | Sy-Tgt(stargt) | 2004.07.30 |
php로 이미지를 mysql디비 저장하고 보여주는 소스 [2] | QQQ | 2004.07.30 |
디비내용을 엑셀,워드,파워포인트 파일로 다운로드 시키는 방법 [13] | QQQ | 2004.07.30 |
rand함수와 mt_rand함수의 비교 [6] | 심심타 | 2004.07.30 |
트랙백 구현하기 - 4. PHP로 트랙백 핑 받기
![]() | TheMics | 2004.07.18 |
트랙백 구현하기 - 3. PHP로 트랙백 핑 보내기
[4]
![]() | TheMics | 2004.07.18 |
히어닥 문법 활용 [14] | ☺심심 | 2004.07.13 |
++와 +=1 의 속도차이 [7] | 플로렐라 | 2004.07.12 |
<와 <=의 속도차이? [23] | 플로렐라 | 2004.07.07 |
서버가 느려졌을경우... [20] | 신상우 | 2004.06.28 |
파일업로드시 파일명 중복되지 않게 저장하기.. [8] | 페리 | 2004.06.28 |
페이지에 암호를 걸자..=_= [27] | ☺심심 | 2004.06.25 |
아이피 접근을 막고 메세지 출력하기.. [11] | ☺심심 | 2004.06.24 |
오늘의 명언을 출력해주는 함수 [10] | 김재경 | 2004.06.15 |
3. if문 [13] | 티다 | 2004.06.05 |