VimUnDo蹄U_l(à>24KU%

Resize your browser!

.    U\4Z_U\<#HelloWorld = require '../src/index'5_U\? 5_U\H5_&U\Q'PageWidthMixin = require '../src/index/5_%U\R&PageWidthMixin = require '../src/index5_$U\R%PageWidthMixin = require '../src/inde5_#U\R$PageWidthMixin = require '../src/ind5_ "U\R#PageWidthMixin = require '../src/in5_ !U\R"PageWidthMixin = require '../src/i5_ !U\T!PageWidthMixin = require '../src/5_ !U\Y5_ U\g 5_  U\h   5_ U\ *

React-Component-Starter

5_U\ #

React Page Width

5_  VU\  [ - )

React Page Width Mixin



5_   VU\    5_ )  VU\ + 5_ 5  VU\ 8 5_ F  VU\  I 5_V&U\5

Default look


        {"""                  """}        
5_V&U\5  5_ V&U\L H 5_ 6V&U\N 8 maxWidth:'1000px', marginTop: @props.rhythm(1)}>5_ V&U\R 6 maxWidth:'1000px', marginTop: @props.rhythm(1)5_ V&U\S 5 maxWidth:'1000px' marginTop: @props.rhythm(1)5_ V&U\S 4 maxWidth:'1000px'marginTop: @props.rhythm(1)5_V&U\U  5_'V&U\p) padding: "0 #{@props.rhythm(1.5}"5_ !V&U\5_! V&U\5_ "!V&U\   5_!#"V&U\  5_"$#V&U\ %pageWidthReporter = React.createClass5_#%$V&U\  #$>5_/10$@VU\U$*C$%C5_021EVU\  console.log @state5_132 EVU\q H!
{@state.pageWidth}
5_243 EVU\ H=
{@state.pageWidth}
5_354 FVU\ I: style={{display: 'inline'}}>{@state.pageWidth}5_465  GVU\ J4 display: 'inline'}}>{@state.pageWidth}5_576 !HVU\ K! }}>{@state.pageWidth}5_687"IVU\ L >{@state.pageWidth}5_798"IVU\ L >{@state.pageWidth}5_8:9#JVU\M {@state.pageWidth}5_9;:$KVU\N 5_:<; $KVU\ O  N5_;=< %LVU\ O marginRight: 105_<>=$ 8 $ V U\$:O$%O5_=?>%M $ V U\%;d%&d5_>@?&b $ V U\&<y&'y5_?A@'w $ V U\'='(5_@BA( $ V U\(>()5_ACB) $ V U\)?)*5_BDC* $ V U\*@*+5_CED+ $ V U\+A+,5_DFE, $ V U\,B,-5_EGF- $ V U\-C -. 5_FHG. $ V U\.D!./!5_GIH/ $ V U\/E6/065_HJI04 $ V U\0FK01K5_IKJ1I $ V U\1G`12`5_JLK2^ $ V U\2Hu23u5_KML3s $ V U\3I345_LNM4 $ V U\4J455_MON5 $ V U\5K565_NPO6 $ V U\6L675_OQP7 $ V U\7M785_PRQ8 $ V U\8N895_QSR9 $ V U\9O9:5_RTS: $ V U\:P:;5_SUT  $ V U\ 3  25_TVU % V U\4 35_UWV & V U\5 45_VXW ' V U\5 padding: 505_WYX ' V U\5 padding: 05_XZY ' V U\5 padding: 5_Y[Z  ' V U\ 5 marginRight: 305_Z\[  ' V U\ 5 display: 'inline'5_[]\  ' V U\  margin: 305_\^] & V U\5 45_]_^ ' V U\ 5 borderRadius: 1005_^`_ ' V U\6 55__a` ( V U\ 7 65_`ba ) V U\7 width: 505_acb ) V U\7 width: 05_bdc ) V U\7 height: 505_ced ) V U\!7 height: 05_dfe ) V U\ padding: 255_egf ( V U\"7 65_fhg! * V U\5_gih ) V U\#8 75_hji! * V U\ 8 lineHeight: 1005_ikj! * V U\ $8 lineHeight: 100px85_jlk! * V U\n985_kml " + V U\ :  95_lnm# , V U\: border: '1px solid red'5_mon# , V U\: border: '1px solid red"5_npo# , V U\ border: "1px solid red"5_oqp " + V U\% :  95_prq $$ - V U\& ;) {bg: bg, fg: fg} = colorPicker('red')5_qsr )$ - V U\P' ;* {bg: bg, fg: fg} = colorPicker('#aaa')5_rts ) 0 )v)U\( ;2 {bg: bg, fg: fg} = colorPicker('#aaa', '#aaa')5_sutI8IVU\)HI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5_twuIIVU\* borderRadius: 2005_uxvw HHVU\q J5_wyx IIVU\t K5_xzy  VU\x RgetRandomColor() {/ var letters = '0123456789ABCDEF'.split(''); var color = '#';" for (var i = 0; i < 6; i++ ) {9 color += letters[Math.floor(Math.random() * 16)]; } return color;}5_y{z  VU\y R getRandomColor() {5_z|{  VU\y R getRandomColor() 5_{}|  VU\y R getRandomColor()5_|~}  VU\y R getRandomColor(5_}~  VU\z R getRandomColor5_~  vU\~ R3 var letters = '0123456789ABCDEF'.split('');5_ . vU\~ R/ letters = '0123456789ABCDEF'.split('');5_  vU\ R var color = '#';5_  vU\ R var color = '#'5_  vU\ R& for (var i = 0; i < 6; i++ ) {5_! vU\ R" for (i = 0; i < 6; i++ ) {5_  vU\ R! for (i = 0; i < 6; i++ ) 5_  vU\R= color += letters[Math.floor(Math.random() * 16)];5_: vU\R; color += letters[Math.floor(Math.random() * 16)];5_ vU\ }5_ vU\Q return color;5_ vU\Q5_ vU\ }5_ vU\R Q5_ vU\+R5_  vU\ S for (i = 0; i < 6; i++ )5_  vU\, S for 5_"vU\S* {bg: bg, fg: fg} = colorPicker('#aaa')S5_338v8U\-S: {bg: bg, fg: fg} = colorPicker(getRandomColor()'#aaa')5_338v8U\.S4 {bg: bg, fg: fg} = colorPicker(getRandomColor())5_38v8U\ T  S5_  VU\  getRandomColor = ->. letters = '0123456789ABCDEF'.split('') color = '#' for i in [0..5]: color += letters[Math.floor(Math.random() * 16)] return color5_  VU\ NN5_VU\U5_ VU\V getRandomColor = ->. letters = '0123456789ABCDEF'.split('') color = '#' for i in [0..5]: color += letters[Math.floor(Math.random() * 16)] return color5_ VU\V* letters = '0123456789ABCDEF'.split('') color = '#' for i in [0..5]6 color += letters[Math.floor(Math.random() * 16)] return color5_ VU\W V5_ VU\ console.log getRandomColor()5_#2#v#U\VA {bg: bg, fg: fg} = colorPicker(getRandomColor(), contrast: 6)5_#2#v#U\/V1 {bg: bg, fg: fg} = colorPicker(, contrast: 6)5_2#v#U\RWV5_!2#v#U\TXW5_  VU\n getRandomColor = ->( letters = '0123456789ABCDEF'.split('') color = '#' for i in [0..5]4 color += letters[Math.floor(Math.random() * 16)] return color5_   VU\p P color: getRandomColor()5_   VU\s0 P color: bezInterpolator()5_OvOU\PPbezInterpolator = chroma.interpolate.bezier(['white', 'yellow', 'red', 'black'])5_OvOU\PbezInterpolator = 5_OvOU\P(bezInterpolator = chroma.scale('RdYlBu')5_OvOU\Pscale = chroma.scale('RdYlBu')5_OvOU\P"colorScae = chroma.scale('RdYlBu')5_ OvOU\1 P) color: bezInterpolator(Math.random())5_MMKVU\2MQPMNP5_PMKVU\3PRSPQS5_1MKVU\413U 13T5_2NLVU\513U"

Resize your page!

5_2NLVU\13U!

Resize the page!

5_2NLVU\613U"

Resize your page!

5_NLVU\&U width: 1005_NLVU\&U width: 005_NLVU\(U width: 05_NLVU\*U height: 1005_NLVU\+U height: 105_NLVU\+U height: 15_NLVU\,U height: 5_NLVU\/U margin: 55_NLVU\07U margin: 5_ NLVU\M V  U5_OMVU\8V#colorScale = chroma.scale('RdYlBu')5_OMVU\ V position: Math.random()*55_ OMVU\W V5_QOVU\Y X5_!TRVU\!$\ !#[5_VTVU\5_USVU\\5_"VTVU\!#] top: @state.offset5_"VTVU\!#]& top: @getTweeningValue(.offset5_"&VTVU\!#]& top: @getTweeningValue('offset5_"'VTVU\"$]"#]5_#WUVU\"$^( top: @getTweeningValue('offset')5_$WUVU\9#$ left: @state.offset5_VTVU\::^ ]5_WUVU\I_^5_ XVVU\Q; _ mixins: [PageWidthMixin]5_XVVU\` _5_ V U\ @tweenState 'offset', { duration: 500 endValue: Math.random()*5 }5_ V U\]]5_  V U\ b  a5_  V U\  th5_ V U\b a5_$ V U\ed5_ V U\f e5_ V U\f @throttledTween5_ V U\<f throttledTween5_$ V U\=f% throttledTween = throttle(@tween)5_ V U\g f5_VU\>* throttledTween = throttle(@tween, 500) console.log5_VU\N+ #throttledTween = throttle(@tween, 500)5_VU\O #console.log5_VU\R } endValue: Math.random()*5 duration: 500 @tweenState 'offset', {5_VU\Rg f5_+VU\X+-g+,g5_,VU\Z+, #console.log5_+VU\[?+-h +-g5_VU\ni h5_VU\r@i throttledTween()5_VU\i if throttledTween5_VU\Ai* throttledTween = throttle(@tween, 500)5_VU\Bj i5_VU\j* throttledTween = throttle(@tween, 500)5_VU\j if throttledTween?5_VU\Cj throttledTween()5_VU\ console.log "tween pleaes"5_VU\D #} #endValue: Math.random()*5 #duration: 500 #@tweenState 'offset', {5_VU\i componentWillUpdate: ->5_,VU\j i5_VU\ F @throttledTween() if @throttledTween?5_VU\) #if @throttledTween?5_VU\* #@throttledTween()5_VU\+Gj if @throttledTween?5_;VU\ZHj; if @throttledTween? and @state.pageWidth isnt nextState5_VU\~k j5_VU\I console.log nextState5_/VU\ .0j( top: @getTweeningValue('offset')5_0VU\ /0) left: @getTweeningValue('offset')5_/VU\.0i. transform: @getTweeningValue('offset')5_/VU\.0i: transform: "translateX(@getTweeningValue('offset')5_/<VU\J.0i< transform: "translateX(#{@getTweeningValue('offset')5_/=VU\:K.0i? transform: "translateX(#{@getTweeningValue('offset')})"5_/VU\N./A transform: "translateX(#{@getTweeningValue('offset')}px)"5_.VU\N-. position: 'relative'5_VU\S componentDidMount: ->+ @throttledTween = throttle(@tween, 500)0 componentWillUpdate: (nextProps, nextState) ->E if @throttledTween? and @state.pageWidth isnt nextState.pageWidth# console.log "ok, let's tween" @throttledTween() tween: -> console.log 'tween' @tweenState 'offset', { duration: 500 endValue: Math.random()*5 }5_VU\V(tweenState = require 'react-tween-state'5_   *v*U\[N W, mixins: [PageWidthMixin, tweenState.Mixin]5_  *v*U\dOW height: 905_  *v*U\iPW height: 915_  *v*U\Q W#colorScale = chroma.scale('YlGnBu')5_(  *v*U\R'( #console.log @state5_  *v*U\V width: 905_  *v*U\V width: 95_  *v*U\V width: 5_   *v*U\V height: 905_    *v*U\V height: 95_     *v*U\V height: 5_     *v*U\V margin: 105_     *v*U\V margin: 15_    *v*U\SV margin: 5_ ,  *v*U\+-V* padding: "0 #{@props.rhythm(1.5)}"5_,  *v*U\+-V) padding: 0 #{@props.rhythm(1.5)}"5_,  *v*U\+-V( padding: #{@props.rhythm(1.5)}"5_,  *v*U\+-V' padding: #{@props.rhythm(1.5)}"5_,  *v*U\+-V& padding: {@props.rhythm(1.5)}"5_,$  *v*U\+-V% padding: @props.rhythm(1.5)}"5_,#  *v*U\T+-V$ padding: @props.rhythm(1.5)}5_+  *v*U\U*+# marginTop: @props.rhythm(1)5_.7.7.GvGU\-/U\ Code on Github5_.7.7.GvGU\V-/UK Code on Github5_1.7.GvGU\017

Current page width: {@state.pageWidth}

5_1.7.GvGU\13T12T5_2 .7.GvGU\13U7

Current page width: {@state.pageWidth}

5_23.7.GvGU\W13U6

Current page width: {@state.pageWidth}5_1/ / V3U\*01%

Resize your browser!

5_-/ / V3U\+Z-/T-.T5_ . 0 0 V3U\4-/U%

Resize your browser!

5_ .#0 0 V3U\6Y-/U%

Resize your browser!

5_- 0 0 V3U\1,.U'

React Page Width mixin

5_%  *v*U\$&5_%  *v*U\$&5_  *v*U\TMW height: 915_VU\f5_-VU\Y,.5_.VU\Y-/5_NLVU\)U width: 95_uwv PPVU\o J  K getRandomColor() {5 var letters = '0123456789ABCDEF'.split(''); var color = '#';0 for (var i = 0; i < 6; i++ ) {M color += letters[Math.floor(Math.random() * 16)];! }1 return color; }5_ U\

Default look2

5