Skip to content

Instantly share code, notes, and snippets.

@nsfmc
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsfmc/9423671 to your computer and use it in GitHub Desktop.
Save nsfmc/9423671 to your computer and use it in GitHub Desktop.
A Pen by Marcos Ojeda.
<div class="container">
<h2>The Idea of Math</h2>
<div class="progress">
<!--
<span class="unit completed"></span>
<span class="unit completed"></span>
<span class="unit started"></span>
<span class="unit unstarted"></span>
<span class="unit unstarted"></span>
<span class="unit unstarted"></span>
-->
</div>
</div>
/** @jsx React.DOM */
var ProgSpan = React.createClass({
render: function(){}
});
var Dotty = React.createClass({
getInitialState: function() {
return {timeWatched: 0};
},
watchSome: function() {
this.setState({
timeWatched: (this.state.timeWatched + 1)
});
},
componentDidMount: function() {
this.interval = setInterval(this.watchSome, 1000);
},
componentWillUnmount: function() {
clearInterval(this.interval);
},
render: function() {
var progArray =
var progress =
return (
<div>
{progress}
</div>);
}
});
$(".container").on("click", function(e){
$(".unit").eq(2).toggleClass("started");
});
@import url(http://fonts.googleapis.com/css?family=Varela+Round);
@mathDomainColor: #3b8fa3;
.container {
background-color: @mathDomainColor;
box-sizing: border-box;
width: 700px;
height: 150px;
padding: 15px 25px;
position: relative;
}
.head, h2 {font-family: "Varela Round", sans-serif; }
h2 {
color: white;
position: absolute;
text-rendering: optimizeLegibility;
}
.progress {
display: inline-block;
box-sizing: border-box;
padding-bottom: 5px;
position: absolute;
right: 15px;
top: 40px;
}
.unit {
transition: all 500ms ease;
@rad: 3px;
width: 0;
height: 2 * @rad;
border-radius: @rad;
border-left: @rad solid darken(@mathDomainColor, 10%);
border-right: @rad solid darken(@mathDomainColor, 10%);
display: inline-block;
margin-right: 15px;
&:last-child { margin-right: 0;}
&.unstarted { border-color: lighten(@mathDomainColor, 20%);}
&.started { background-color: transparent;
width: 0;
border-left: @rad solid darken(@mathDomainColor, 10%);
border-right: @rad solid lighten(@mathDomainColor, 20%);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment