konva/test/sandbox.html

61 lines
1.7 KiB
HTML

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>KineticJS Mocha Tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<style>
#mocha .test {
overflow: auto;
}
</style>
</head>
<body>
<div id="mocha"></div>
<!-- used for KineticJS container -->
<div id="container"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../dist/kinetic-dev.js"></script>
<script>
Kinetic.enableTrace = true;
var stage = new Kinetic.Stage({
container: 'container',
width: 578,
height: 200
});
var layer = new Kinetic.Layer();
var text = new Kinetic.Text({
x: 10,
y: 10,
//stroke: '#555',
//strokeWidth: 5,
text: 'HEADING\n\nAll the world\'s a stage, and all the men and women merely players. They have their exits and their entrances; And one man in his time plays many parts.',
//text: 'HEADING\n\nThis is a really cool paragraph. \n And this is a footer.',
fontSize: 16,
fontFamily: 'Calibri',
fontStyle: 'normal',
fill: '#555',
//width: 20,
width: 380,
//width: 200,
padding: 20,
align: 'center',
shadowColor: 'red',
shadowBlur: 1,
shadowOffset: [10, 10],
shadowOpacity: 0.5,
draggable: true
});
layer.add(text);
stage.add(layer);
console.log(layer.getContext().getTrace());
</script>
</body>
</html>