Working on home language selection.

This commit is contained in:
Nick Winter 2014-06-19 08:06:34 -07:00
parent ac6c7292c8
commit 2e850dba78
13 changed files with 46 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -67,6 +67,30 @@
-webkit-filter: brightness(1.2)
box-shadow: 0 0 5px black
.code-languages
.primary-code-languages
#javascript
background: transparent url(/images/pages/home/language_js.png)
padding-right: 150px
#python
background: transparent url(/images/pages/home/language_python.png)
padding-left: 150px
.code-language
text-align: center
width: 498px
height: 153px
padding: 30px
margin-left: 11px
.secondary-code-languages
.code-language
text-align: center
#multiplayer-launch-modal
.modal-dialog
width: 700px

View file

@ -4,29 +4,29 @@ block content
h1#site-slogan(data-i18n="home.slogan") Learn to Code JavaScript by Playing a Game
if frontPageContent == 'video'
//- if language is Chinese, we use youku, because China can't visit youtube.
//- otherwise, we use youtube.
if languageName == "zh-HANS"
#trailer-wrapper
<embed src="http://player.youku.com/player.php/sid/XNjk2Mzg5NjYw/v.swf" style="margin-left:15px; margin-top:8px;"allowFullScreen="true" quality="high" width="920" height="518" wmode="opaque"></embed>
img(src="/images/pages/home/video_border.png")
#mobile-trailer-wrapper
<embed src="http://player.youku.com/player.php/sid/XNjk2Mzg5NjYw/v.swf" style="margin-left:15px; margin-top:8px;"allowFullScreen="true" quality="high" width="280" height="158" wmode="opaque"></embed>
else
#trailer-wrapper
<iframe width="920" height="518" src="//www.youtube.com/embed/1zjaA13k-dA?rel=0&controls=0&modestbranding=1&showinfo=0&iv_load_policy=3&vq=hd720&wmode=transparent" frameborder="0" wmode="opaque" allowfullscreen></iframe>
img(src="/images/pages/home/video_border.png")
#mobile-trailer-wrapper
<iframe src="//www.youtube.com/embed/1zjaA13k-dA" frameborder="0" width="280" height="158"></iframe>
hr
.code-languages
.primary-code-languages.row
.code-language.col-md-6#javascript(data-code-language='javascript')
h2 JavaScript
p language of web yo
else if frontPageContent == 'screenshot'
#front-screenshot
img(src="/images/pages/home/front_screenshot_01.png", alt="")
.code-language.beta.col-md-6#python(data-code-language='python')
h2 Python
p language of badassery
.secondary-code-languages.row
.code-language.beta.col-md-4#clojure(data-code-language='clojure')
h3 Clojure
p language of geekery
.code-language.beta.col-md-4#clojure(data-code-language='lua')
h3 Lua
p language of game scripting
.code-language.beta.col-md-4#clojure(data-code-language='io')
h3 Io
p language of simplicity
else if frontPageContent == 'nothing'
p &nbsp;
.alert.alert-danger.lt-ie10
strong(data-i18n="home.no_ie") CodeCombat does not run in Internet Explorer 9 or older. Sorry!

View file

@ -25,10 +25,6 @@ module.exports = class HomeView extends View
console.warn 'no more jquery browser version...'
c.isEnglish = (me.get('preferredLanguage') or 'en').startsWith 'en'
c.languageName = me.get('preferredLanguage')
# A/B test: https://github.com/codecombat/codecombat/issues/769
c.frontPageContent = {0: "video", 1: "screenshot", 2: "nothing"}[me.get('testGroupNumber') % 3]
application.tracker.identify frontPageContent: c.frontPageContent
application.tracker.trackEvent 'Front Page Content', frontPageContent: c.frontPageContent
c
afterRender: ->

View file

@ -126,7 +126,7 @@ module.exports = class HUDView extends View
if thangType.get('raster')
wrapper.empty().append($('<img />').attr('src', '/file/'+thangType.get('raster')))
else
stage = thangType.getPortraitStage options
return unless stage = thangType.getPortraitStage options
newCanvas = $(stage.canvas).addClass('thang-canvas')
wrapper.empty().append(newCanvas)
stage.update()