2015-09-23 11:11:51 +08:00
|
|
|
React = require 'react'
|
2015-09-26 08:43:36 +08:00
|
|
|
shell = require 'shell'
|
|
|
|
classnames = require 'classnames'
|
2015-10-05 17:01:27 +08:00
|
|
|
{RetinaImg} = require 'nylas-component-kit'
|
2015-10-05 07:49:41 +08:00
|
|
|
PageRouterStore = require './page-router-store'
|
2015-09-23 11:11:51 +08:00
|
|
|
OnboardingActions = require './onboarding-actions'
|
|
|
|
|
2015-09-25 05:51:15 +08:00
|
|
|
class WelcomePage extends React.Component
|
2015-09-23 11:11:51 +08:00
|
|
|
@displayName: "WelcomePage"
|
|
|
|
|
|
|
|
constructor: (@props) ->
|
|
|
|
@state =
|
|
|
|
step: 0
|
2015-09-26 08:43:36 +08:00
|
|
|
lastStep: 0
|
2015-09-23 11:11:51 +08:00
|
|
|
|
2015-09-26 08:43:36 +08:00
|
|
|
render: ->
|
2015-09-28 17:12:35 +08:00
|
|
|
<div className="welcome-page page opaque">
|
|
|
|
<div className="quit" onClick={ -> OnboardingActions.closeWindow() }>
|
2015-09-25 05:51:15 +08:00
|
|
|
<RetinaImg name="onboarding-close.png" mode={RetinaImg.Mode.ContentPreserve}/>
|
|
|
|
</div>
|
2015-09-26 08:43:36 +08:00
|
|
|
<div className="steps-container">{@_renderSteps()}</div>
|
|
|
|
<div className="footer">{@_renderButtons()}</div>
|
|
|
|
</div>
|
2015-09-25 05:51:15 +08:00
|
|
|
|
2015-09-26 08:43:36 +08:00
|
|
|
_renderButtons: ->
|
|
|
|
buttons = []
|
|
|
|
# if @state.step > 0
|
|
|
|
# buttons.push <span key="back" className="btn-back" onClick={@_onBack}>Back</span>
|
|
|
|
btnText = if @state.step is 2 then "Get Started" else "Continue"
|
|
|
|
buttons.push <button key="next" className="btn btn-large btn-continue" onClick={@_onContinue}>{btnText}</button>
|
|
|
|
return buttons
|
2015-09-23 11:11:51 +08:00
|
|
|
|
2015-09-26 08:43:36 +08:00
|
|
|
_renderSteps: -> [
|
|
|
|
@_renderStep0()
|
|
|
|
@_renderStep1()
|
|
|
|
@_renderStep2()
|
|
|
|
]
|
|
|
|
|
|
|
|
_stepClass: (n) ->
|
|
|
|
obj =
|
|
|
|
"step-wrap": true
|
|
|
|
"active": @state.step is n
|
|
|
|
obj["step-#{n}-wrap"] = true
|
|
|
|
className = classnames(obj)
|
|
|
|
return className
|
|
|
|
|
|
|
|
_renderStep0: ->
|
|
|
|
<div className={@_stepClass(0)} key="step-0">
|
2015-10-03 06:34:56 +08:00
|
|
|
<RetinaImg className="logo" style={zoom: 0.20, marginTop: 60, opacity: 0.7} url="nylas://onboarding/assets/nylas-pictographB@2x.png" mode={RetinaImg.Mode.ContentPreserve}/>
|
2015-09-30 14:58:30 +08:00
|
|
|
<p className="hero-text" style={marginTop: 30, fontSize: 44}>Say hello to N1.</p>
|
|
|
|
<p className="sub-text" style={marginTop: 0, fontSize: 24}>The next-generation email platform.</p>
|
2015-10-24 02:42:55 +08:00
|
|
|
<div style={fontSize:17, marginTop: 45}>
|
|
|
|
Built with
|
|
|
|
<RetinaImg url="nylas://onboarding/assets/nylas-love@2x.png" mode={RetinaImg.Mode.ContentPreserve}/>
|
|
|
|
by Nylas
|
|
|
|
</div>
|
2015-09-26 08:43:36 +08:00
|
|
|
<RetinaImg className="icons" style={position: "absolute", left: -45, top: 130} url="nylas://onboarding/assets/shapes-left@2x.png" mode={RetinaImg.Mode.ContentIsMask} />
|
|
|
|
<RetinaImg className="icons" style={position: "absolute", right: -40, top: 130} url="nylas://onboarding/assets/shapes-right@2x.png" mode={RetinaImg.Mode.ContentIsMask} />
|
|
|
|
{@_renderNavBubble(0)}
|
2015-09-23 11:11:51 +08:00
|
|
|
</div>
|
|
|
|
|
2015-09-26 08:43:36 +08:00
|
|
|
_renderStep1: ->
|
|
|
|
<div className={@_stepClass(1)} key="step-1">
|
2015-09-30 14:58:30 +08:00
|
|
|
<p className="hero-text" style={marginTop: 40}>Developers welcome.</p>
|
2015-09-26 08:43:36 +08:00
|
|
|
<div className="gear-outer-container"><div className="gear-container">
|
|
|
|
{@_gears()}
|
|
|
|
</div></div>
|
|
|
|
<RetinaImg className="gear-small" mode={RetinaImg.Mode.ContentPreserve}
|
|
|
|
url="nylas://onboarding/assets/gear-small@2x.png" />
|
|
|
|
<RetinaImg className="wrench" mode={RetinaImg.Mode.ContentPreserve}
|
|
|
|
url="nylas://onboarding/assets/wrench@2x.png" />
|
|
|
|
|
2015-10-03 06:34:56 +08:00
|
|
|
<p className="sub-text">N1 is built with modern web technologies and is easy to extend with JavaScript.</p>
|
2015-09-26 08:43:36 +08:00
|
|
|
{@_renderNavBubble(1)}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
_gears: ->
|
|
|
|
gears = []
|
|
|
|
for i in [0..3]
|
|
|
|
gears.push <RetinaImg className="gear-large gear-large-#{i}"
|
|
|
|
mode={RetinaImg.Mode.ContentPreserve}
|
|
|
|
url="nylas://onboarding/assets/gear-large@2x.png" />
|
|
|
|
return gears
|
|
|
|
|
|
|
|
_renderStep2: ->
|
|
|
|
<div className={@_stepClass(2)} key="step-2">
|
2015-09-30 14:58:30 +08:00
|
|
|
<p className="hero-text" style={marginTop: 40}>N1 is made possible by the Nylas Sync Engine</p>
|
2015-09-26 08:43:36 +08:00
|
|
|
<div className="cell-wrap">
|
|
|
|
<div className="cell" style={float: "left"}>
|
|
|
|
<RetinaImg mode={RetinaImg.Mode.ContentPreserve}
|
|
|
|
style={paddingTop: 4, paddingBottom: 4}
|
|
|
|
url="nylas://onboarding/assets/cloud@2x.png" />
|
2015-09-30 14:58:30 +08:00
|
|
|
<p>A modern API layer for<br/>email, contacts & calendar</p>
|
2015-09-26 08:43:36 +08:00
|
|
|
<a onClick={=> @_open("https://github.com/nylas/sync-engine")}>more info</a>
|
|
|
|
</div>
|
2015-09-30 14:58:30 +08:00
|
|
|
<div className="cell" style={float: "right"}>
|
|
|
|
<RetinaImg mode={RetinaImg.Mode.ContentPreserve}
|
|
|
|
url="nylas://onboarding/assets/lock@2x.png" />
|
|
|
|
<p>Secured using<br/>bank-grade encryption</p>
|
|
|
|
<a onClick={=> @_open("https://nylas.com/security/")}>more info</a>
|
|
|
|
</div>
|
2015-09-23 11:11:51 +08:00
|
|
|
</div>
|
2015-09-26 08:43:36 +08:00
|
|
|
{@_renderNavBubble(2)}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
_open: (link) ->
|
|
|
|
shell.openExternal(link)
|
|
|
|
return
|
|
|
|
|
|
|
|
_renderNavBubble: (step=0) ->
|
|
|
|
bubbles = [0..2].map (n) =>
|
|
|
|
active = if n is step then "active" else ""
|
|
|
|
<div className="nav-bubble #{active}"
|
|
|
|
onClick={ => @setState step: n }></div>
|
|
|
|
|
|
|
|
<div className="nav-bubbles">
|
|
|
|
{bubbles}
|
|
|
|
</div>
|
2015-09-23 11:11:51 +08:00
|
|
|
|
|
|
|
_onBack: =>
|
|
|
|
@setState(step: @state.step - 1)
|
|
|
|
|
|
|
|
_onContinue: =>
|
|
|
|
if @state.step < 2
|
|
|
|
@setState(step: @state.step + 1)
|
|
|
|
else
|
2015-10-05 07:49:41 +08:00
|
|
|
if PageRouterStore.tokenAuthEnabled() is "no"
|
|
|
|
OnboardingActions.moveToPage("account-choose")
|
|
|
|
else
|
|
|
|
OnboardingActions.moveToPage("token-auth")
|
2015-09-23 11:11:51 +08:00
|
|
|
|
|
|
|
module.exports = WelcomePage
|