A Pen by Marcos Ojeda on CodePen.
Last active
August 29, 2015 13:57
-
-
Save nsfmc/9423671 to your computer and use it in GitHub Desktop.
A Pen by Marcos Ojeda.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @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"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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