mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 14:33:59 -04:00
Included Hour of Code explanation in play footer.
This commit is contained in:
parent
60eb0db1aa
commit
11f742ff0f
3 changed files with 29 additions and 5 deletions
app
|
@ -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
|
||||
|
|
|
@ -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.
|
|
@ -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: ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue