-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo2.htm
54 lines (35 loc) · 901 Bytes
/
demo2.htm
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
<html>
<head>
<title>x3x3-demo2</title>
<meta charset="utf-8"/>
<style type="text/css">
<!--
a{text-decoration:none;}
svg{width:100%;height:auto;margin-bottom:3%;} /*responsive*/
svg rect{fill:tomato!important;}
a svg rect{fill:cyan!important;}
-->
</style>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/mntn-dev/x3x3/x3x3.min.js"></script> <!-- 0.3.1 -->
<script type="text/javascript">
window.onload=function(){
X=document.getElementById('x');
/*html-content2svg*/
_=X.innerHTML.split('\n');___='';
for(j=0;j<_.length;j++){
__=_[j].match(/(<.*?>|[^<>]+)/g);
if(__)for(i=0;i<__.length;i++)___+=((__[i][0]=='<')?__[i]:x3x3.svg(__[i]));
___+='\n';
}
X.innerHTML=___;
}
</script>
</head>
<body>
<pre id="x">
Hello world.
<a target="_blank" href="https://github.com/mntn-dev/x3x3" title="x3x3.js">x3x3.js</a>
xxxxxxxx
</pre>
</body>
</html>