Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <meta name=viewport content=width=device-width>
    <title>playground</title>
    <script src=https://unpkg.com/dio.js@3.0.1/dio.min.js></script>
</head>
<body>
</body>
</html>
 
class Heading extends dio.Component {
    constructor(props){
        super(props);
    }
    stylesheet() {
        return `
            & {
                color: #333;
                position: relative;
                font-family: sans-serif;
            }
            &:before {
                width: 100px;
                background: rgb(110,120,40);
                height: 4px;
                position: absolute;
                top: 100%;
                content: ' ';
                animation: slidein 3s ease infinite;
            }
            @keyframes slidein {
                from {
                    transform: translate(0px);
                }
                50% {
                    transform: translate(200px);
                }
                100% {
                    transform: translate(0px);
                }
            }
        `;
    }
    render() {
        return h('h1', this.props.value);
    }
}
dio.render(h(Heading, {value: 'Hello World'}), document.body);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
thysultanpro
0viewers