[build] added html5 task
This commit is contained in:
28
src/client/html/index.html
Normal file
28
src/client/html/index.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Tank'z</title>
|
||||
<% scripts.forEach(function(script) { %>
|
||||
<script type="text/javascript" src="<%-script%>"></script>
|
||||
<% }); %>
|
||||
<style type="text/css">
|
||||
html, body, #container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<script type="text/javascript">
|
||||
new Swf(
|
||||
document.getElementById('container'),
|
||||
'<%-swf%>',
|
||||
);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,15 +1,3 @@
|
||||
const typeOf = (item) => {
|
||||
if (item == null) return "null";
|
||||
if (item.nodeName) {
|
||||
if (item.nodeType == 1) return "element";
|
||||
if (item.nodeType == 3) return (/\S/).test(item.nodeValue) ? "textnode" : "whitespace";
|
||||
} else if (typeof item.length == "number") {
|
||||
if (item.callee) return "arguments";
|
||||
}
|
||||
return typeof item;
|
||||
};
|
||||
|
||||
|
||||
class Swf {
|
||||
|
||||
constructor(element, swf, options) {
|
||||
@@ -50,7 +38,7 @@ class Swf {
|
||||
var value = object[key];
|
||||
if (base) key = base + ":" + key;
|
||||
var result;
|
||||
switch (typeOf(value)) {
|
||||
switch (typeof value) {
|
||||
case "object":
|
||||
result = this.toFlashVars(value, key);
|
||||
break;
|
||||
@@ -1,28 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Tank'z</title>
|
||||
<% scripts.forEach(function(script) { %>
|
||||
<script type="text/javascript" src="<%-script%>"></script>
|
||||
<% }); %>
|
||||
<style type="text/css">
|
||||
html, body, #container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<script type="text/javascript">
|
||||
new Swf(
|
||||
document.getElementById('container'),
|
||||
'<%-swf%>',
|
||||
);
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Tank'z</title>
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
ul {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
ul > li {
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<ul>
|
||||
<li onclick="content.src='flash/index.html'"><button>Flash</button></li>
|
||||
<li onclick="content.src='html5/index.html'"><button>Html5</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
<iframe id="content" frameborder="0" width="100%" height="100%" src="flash/index.html"></iframe>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user