mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 10:55:19 -04:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
b550708113
11 changed files with 109 additions and 82 deletions
app
assets/images/pages/home
styles
templates
views
server/levels
BIN
app/assets/images/pages/home/button.png
Normal file
BIN
app/assets/images/pages/home/button.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 10 KiB |
BIN
app/assets/images/pages/home/campaign.jpg
Executable file
BIN
app/assets/images/pages/home/campaign.jpg
Executable file
Binary file not shown.
After ![]() (image error) Size: 212 KiB |
BIN
app/assets/images/pages/home/campaign_notext.jpg
Normal file
BIN
app/assets/images/pages/home/campaign_notext.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 54 KiB |
BIN
app/assets/images/pages/home/multiplayer.jpg
Executable file
BIN
app/assets/images/pages/home/multiplayer.jpg
Executable file
Binary file not shown.
After ![]() (image error) Size: 204 KiB |
BIN
app/assets/images/pages/home/multiplayer_notext.jpg
Normal file
BIN
app/assets/images/pages/home/multiplayer_notext.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 46 KiB |
|
@ -2,62 +2,66 @@
|
|||
@import "bootstrap/variables"
|
||||
|
||||
#home-view
|
||||
|
||||
#front-screenshot
|
||||
margin-top: 15px
|
||||
margin-left: 150px
|
||||
|
||||
#site-slogan
|
||||
margin-left: 15px
|
||||
|
||||
.homepage_button
|
||||
width: 300px
|
||||
margin-top: 30px
|
||||
float: right
|
||||
font-family: 'Bangers', cursive
|
||||
font-weight: normal
|
||||
letter-spacing: 1px
|
||||
position: relative
|
||||
|
||||
button
|
||||
font-size: 40px
|
||||
width: 300px
|
||||
height: 80px
|
||||
|
||||
@include transition(color .10s linear)
|
||||
|
||||
&:hover button, &:active button
|
||||
color: #8090AA
|
||||
|
||||
canvas
|
||||
position: absolute
|
||||
//border: 1px solid
|
||||
|
||||
#beginner-campaign canvas
|
||||
top: -30px
|
||||
left: -75px
|
||||
|
||||
#homepage_button_container
|
||||
padding: 0px 100px 0px 0px
|
||||
height: 75px
|
||||
|
||||
|
||||
.homepage_button a
|
||||
float: right
|
||||
|
||||
.row
|
||||
margin: 20px 0px 35px 0px
|
||||
|
||||
.row.promo
|
||||
.span8
|
||||
margin-left: 0px
|
||||
|
||||
h3
|
||||
margin-bottom: -5px
|
||||
|
||||
.centered-button
|
||||
display: block
|
||||
margin: 15px auto
|
||||
|
||||
#update_zone
|
||||
|
||||
h1, h2
|
||||
text-align: center
|
||||
|
||||
#trailer-wrapper object
|
||||
display: block
|
||||
margin: 0 auto
|
||||
|
||||
.game-mode-wrapper
|
||||
position: relative
|
||||
margin-bottom: 60px
|
||||
|
||||
img
|
||||
display: block
|
||||
margin: 0 auto
|
||||
|
||||
h3
|
||||
color: $yellow
|
||||
position: absolute
|
||||
top: 10px
|
||||
left: 40px
|
||||
font-size: 70px
|
||||
margin-top: 0
|
||||
text-shadow: 2px 2px 5px black
|
||||
|
||||
h4
|
||||
color: #e8d9c5
|
||||
position: absolute
|
||||
top: 75px
|
||||
left: 140px
|
||||
font-size: 30px
|
||||
margin-top: 0
|
||||
text-shadow: 2px 2px 5px black
|
||||
|
||||
.play-button
|
||||
text-align: center
|
||||
position: absolute
|
||||
right: 40px
|
||||
bottom: -30px
|
||||
width: 200px
|
||||
height: 100px
|
||||
|
||||
div, img
|
||||
color: $yellow
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
width: 100%
|
||||
height: 100%
|
||||
font-size: 50px
|
||||
font-family: Bangers
|
||||
line-height: 100px
|
||||
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black
|
||||
@include transition(color .10s linear)
|
||||
|
||||
&:hover div
|
||||
color: lighten($yellow, 20%)
|
||||
&:hover img
|
||||
filter: brightness(1.1)
|
||||
-webkit-filter: brightness(1.1)
|
||||
|
|
@ -2,27 +2,47 @@ extends /templates/base
|
|||
|
||||
block content
|
||||
|
||||
div
|
||||
|
||||
h1#site-slogan(data-i18n="home.slogan") Learn to Code JavaScript by Playing a Game
|
||||
h1#site-slogan(data-i18n="home.slogan") Learn to Code JavaScript by Playing a Game
|
||||
|
||||
#front-screenshot
|
||||
img(src="/images/pages/home/front_screenshot_01.png", alt="")
|
||||
#trailer-wrapper
|
||||
<object width="640" height="360"><param name="movie" value="//www.youtube.com/v/1zjaA13k-dA?hl=en_US&version=3&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.youtube.com/v/1zjaA13k-dA?hl=en_US&version=3&rel=0" type="application/x-shockwave-flash" width="640" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></object>
|
||||
|
||||
hr
|
||||
|
||||
.alert.alert-danger.lt-ie10
|
||||
strong(data-i18n="home.no_ie") CodeCombat does not run in Internet Explorer 9 or older. Sorry!
|
||||
|
||||
if isMobile
|
||||
.alert.alert-danger.mobile
|
||||
strong(data-i18n="home.no_mobile") CodeCombat wasn't designed for mobile devices and may not work!
|
||||
if isOldBrowser
|
||||
.alert.alert-danger.old-browser
|
||||
strong(data-i18n="home.old_browser") Uh oh, your browser is too old to run CodeCombat. Sorry!
|
||||
br
|
||||
span(data-i18n="home.old_browser_suffix") You can try anyway, but it probably won't work.
|
||||
|
||||
a#beginner-campaign(href="/play/level/rescue-mission")
|
||||
div.game-mode-wrapper
|
||||
if isEnglish
|
||||
img(src="/images/pages/home/campaign.jpg").img-rounded
|
||||
else
|
||||
img(src="/images/pages/home/campaign_notext.jpg").img-rounded
|
||||
h3(data-i18n="home.campaign") Campaign
|
||||
h4(data-i18n="home.for-beginners") For Beginners
|
||||
.play-button
|
||||
img(src="/images/pages/home/button.png")
|
||||
div(data-i18n="home.play") Play
|
||||
|
||||
a#multiplayer(href="/play/ladder/dungeon-arena")
|
||||
div.game-mode-wrapper
|
||||
if isEnglish
|
||||
img(src="/images/pages/home/multiplayer.jpg").img-rounded
|
||||
else
|
||||
img(src="/images/pages/home/multiplayer_notext.jpg").img-rounded
|
||||
h3(data-i18n="home.multiplayer") Multiplayer
|
||||
h4(data-i18n="home.for-developers") For Developers
|
||||
.play-button
|
||||
img(src="/images/pages/home/button.png")
|
||||
div(data-i18n="home.play") Play
|
||||
|
||||
.clearfix
|
||||
|
||||
.alert.lt-ie10
|
||||
h2(data-i18n="home.no_ie") CodeCombat does not run in Internet Explorer 9 or older. Sorry!
|
||||
if isMobile
|
||||
.alert.mobile
|
||||
h2(data-i18n="home.no_mobile") CodeCombat wasn't designed for mobile devices and may not work!
|
||||
if isOldBrowser
|
||||
.alert.old-browser
|
||||
h2(data-i18n="home.old_browser") Uh oh, your browser is too old to run CodeCombat. Sorry!
|
||||
h5 You can try anyway, but it probably won't work.
|
||||
div#homepage_button_container
|
||||
|
||||
div.homepage_button
|
||||
a#beginner-campaign(href="/play/level/rescue-mission")
|
||||
canvas(width="125", height="150")
|
||||
button(data-i18n="home.play").btn.btn-warning.btn-lg.highlight Play
|
|
@ -3,6 +3,7 @@ template = require 'templates/home'
|
|||
WizardSprite = require 'lib/surface/WizardSprite'
|
||||
ThangType = require 'models/ThangType'
|
||||
Simulator = require 'lib/simulator/Simulator'
|
||||
{me} = require '/lib/auth'
|
||||
|
||||
module.exports = class HomeView extends View
|
||||
id: 'home-view'
|
||||
|
@ -25,6 +26,7 @@ module.exports = class HomeView extends View
|
|||
c.isOldBrowser = true if $.browser.safari && majorVersion < 536
|
||||
else
|
||||
console.warn 'no more jquery browser version...'
|
||||
c.isEnglish = (me.get('preferredLanguage') or 'en').startsWith 'en'
|
||||
c
|
||||
|
||||
afterRender: ->
|
||||
|
@ -40,7 +42,7 @@ module.exports = class HomeView extends View
|
|||
lastLevel = localStorage["lastLevel"]
|
||||
if lastLevel? and lastLevel isnt ""
|
||||
playLink = @$el.find("#beginner-campaign")
|
||||
if playLink?
|
||||
if playLink[0]?
|
||||
href = playLink.attr("href").split("/")
|
||||
href[href.length-1] = lastLevel if href.length isnt 0
|
||||
href = href.join("/")
|
||||
|
|
1
app/views/multiplayer.coffee
Normal file
1
app/views/multiplayer.coffee
Normal file
|
@ -0,0 +1 @@
|
|||
require './home_view'
|
|
@ -154,7 +154,7 @@ module.exports = class PlayLevelView extends View
|
|||
return Backbone.Mediator.subscribeOnce 'modal-closed', @onLevelLoaderLoaded, @
|
||||
|
||||
# Save latest level played in local storage
|
||||
localStorage["lastLevel"] = @levelID if localStorage?
|
||||
localStorage["lastLevel"] = @levelID if localStorage? and not (@level.get('type') in ['ladder', 'ladder-tutorial'])
|
||||
@grabLevelLoaderData()
|
||||
team = @getQueryVariable("team") ? @world.teamForPlayer(0)
|
||||
@loadOpponentTeam(team)
|
||||
|
|
|
@ -236,7 +236,7 @@ _.extend LevelSchema.properties,
|
|||
i18n: {type: "object", format: 'i18n', props: ['name', 'description'], description: "Help translate this level"}
|
||||
icon: { type: 'string', format: 'image-file', title: 'Icon' }
|
||||
goals: c.array {title: 'Goals', description: 'An array of goals which are visible to the player and can trigger scripts.'}, GoalSchema
|
||||
type: c.shortString(title: "Type", description: "What kind of level this is.", "enum": ['campaign', 'ladder'])
|
||||
type: c.shortString(title: "Type", description: "What kind of level this is.", "enum": ['campaign', 'ladder', 'ladder-tutorial'])
|
||||
showsGuide: c.shortString(title: "Shows Guide", description: "If the guide is shown at the beginning of the level.", "enum": ['first-time', 'always'])
|
||||
|
||||
c.extendBasicProperties LevelSchema, 'level'
|
||||
|
|
Loading…
Reference in a new issue