Included Hour of Code explanation in play footer.

This commit is contained in:
Nick Winter 2014-02-23 11:48:34 -08:00
parent 60eb0db1aa
commit 11f742ff0f
3 changed files with 29 additions and 5 deletions
app
styles/play
templates/play
views/play

View file

@ -132,9 +132,21 @@
height: 100%
width: 2%
.footer:not(:hover)
@include opacity(0.6)
.footer
@media screen and (min-aspect-ratio: 17/10)
display: none
@media screen and (min-aspect-ratio: 17/10)
#level-view .footer
display: none
&:not(:hover)
@include opacity(0.6)
.hour-of-code-explanation
margin-top: 5px
color: white
font-size: 12px
&:not(:hover)
@include opacity(0.75)
a
color: white
text-decoration: underline

View file

@ -27,3 +27,11 @@
.content
p(class='footer-link-text')
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact", data-i18n="nav.contact") Contact
if explainHourOfCode
// Does not show up unless lang is en-US.
div.hour-of-code-explanation
| The 'Hour of Code' is a nationwide initiative by
a(href="http://csedweek.org") Computer Science Education Week
| and
a(href="http://code.org") Code.org
| to introduce millions of students to one hour of computer science and computer programming.

View file

@ -116,6 +116,10 @@ module.exports = class PlayLevelView extends View
getRenderData: ->
c = super()
c.world = @world
if me.get('hourOfCode') and me.lang() is 'en-US'
# Show the Hour of Code footer explanation until it's been more than a day
elapsed = (new Date() - new Date(me.get('dateCreated')))
c.explainHourOfCode = elapsed < 86400 * 1000
c
afterRender: ->