@yisrael-wix its still not working. I don’t think I did it right.
HTML:
<!DOCTYPE html>
<html>
<script src= "https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script src= "https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<script link href="https://fonts.googleapis.com/css?family=Raleway:400,300,600,800,900" rel="stylesheet" type="text/css">
</script>
<script src="https://unpkg.com/scrollreveal"></script>
<body>
<div id="container"></div>
<script type="text/javascript" src="/js/babel/babel.js"></script>
<script
type="text/javascript"
src="/js/lib/dummy.js"
></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<script type="text/javascript" src="https://rawgit.com/kimmobrunfeldt/progressbar.js/1.0.0/dist/progressbar.js"></script>
<style id="compiled-css" type="text/css">
#container {
margin: 20px;
width: 200px;
height: 200px;
position: relative;
}
</style>
<script type="text/javascript">
//when a mesage is received from page code
window.onmessage = (event) => {
if (event.data) { document.getElementById("container").innerHTML = event.data;
let receivedData = event.data;
}
};
</script>
<script type="text/babel">
// progressbar.js@1.0.0 version is used
// Docs: http://progressbarjs.readthedocs.org/en/1.0.0/
var bar = new ProgressBar.Circle(container, {
color: '#aaa',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 1,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: { color: '#aaa', width: 1 },
to: { color: '#333', width: 4 },
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
bar.text.style.fontSize = '2rem';
bar.animate(1.0); // Number from 0.0 to 1.0
</script>
</body>
</html>
Wix code:
export function html5_viewportEnter(event) {
let targetId = event.target.id;
}