File tree 7 files changed +65
-36
lines changed 7 files changed +65
-36
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default class LoadInView extends React.PureComponent {
14
14
}
15
15
16
16
listen = ( ) => {
17
- if ( ! this . state . show && this . elPos && getScrollPos ( ) . y + 300 > this . elPos ) {
17
+ if ( ! this . state . show && this . elPos && getScrollPos ( ) . y + 100 > this . elPos ) {
18
18
requestAnimationFrame ( ( ) => {
19
19
this . setState ( { show : true } ) ;
20
20
} ) ;
Original file line number Diff line number Diff line change @@ -71,13 +71,6 @@ export default () => (
71
71
< StyledLogo width = { 50 } height = { 50 } />
72
72
</ Left >
73
73
< Right >
74
- < Item
75
- href = "https://medium.com/@compuives"
76
- target = "_blank"
77
- rel = "noopener noreferrer"
78
- >
79
- Examples
80
- </ Item >
81
74
< Item
82
75
href = "https://medium.com/@compuives"
83
76
target = "_blank"
@@ -92,12 +85,7 @@ export default () => (
92
85
>
93
86
GitHub
94
87
</ Item >
95
- < Item
96
- href = "https://github.com/CompuIves/codesandbox-client"
97
- target = "_blank"
98
- rel = "noopener noreferrer"
99
- button
100
- >
88
+ < Item href = "/s" target = "_blank" rel = "noopener noreferrer" button >
101
89
Create Sandbox
102
90
</ Item >
103
91
</ Right >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import Footer from '../screens/home/Footer';
8
8
import RecentPublications from '../screens/home/RecentPublications' ;
9
9
10
10
export default ( ) => (
11
- < div style = { { marginBottom : 900 } } v >
11
+ < div >
12
12
< Animation />
13
13
< NPMFeature />
14
14
< CycleFeature />
Original file line number Diff line number Diff line change @@ -124,7 +124,9 @@ export default ({ template }) => (
124
124
</ Button >
125
125
126
126
< Button
127
- href = { sandboxUrl ( { id : template . shortid } ) }
127
+ href = { `https://codesandbox.io/search?refinementList%5Btemplate%5D%5B0%5D=${
128
+ template . name
129
+ } `}
128
130
color = { template . color }
129
131
secondary
130
132
>
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ class Canvas {
7
7
stage : HTMLCanvasElement ;
8
8
ctx : CanvasRenderingContext2D ;
9
9
dots : Array < Dot > = [ ] ;
10
- waves : Array < Wave > = [ ] ;
10
+ wave : Wave = null ;
11
11
12
12
lastDelta : number = Date . now ( ) ;
13
13
cubeX : number = 1300 ;
@@ -41,14 +41,21 @@ class Canvas {
41
41
}
42
42
}
43
43
44
+ lowPerf = false ;
45
+
44
46
loop = ( ) => {
45
47
const now = Date . now ( ) ;
46
48
const delta = now - this . lastDelta ;
47
- if ( getScrollPos ( now ) . y > this . stage . height ) {
49
+ if ( getScrollPos ( now ) . y > this . stage . height || delta < 33 ) {
48
50
requestAnimationFrame ( this . loop ) ;
49
51
return ;
50
52
}
51
53
54
+ if ( delta > 2000 ) {
55
+ this . lowPerf = true ;
56
+ this . dots = this . dots . filter ( x => Math . random ( ) > 0.5 ) ;
57
+ }
58
+
52
59
this . ctx . clearRect ( 0 , 0 , this . stage . width , this . stage . height ) ;
53
60
54
61
let distX ;
Original file line number Diff line number Diff line change @@ -75,17 +75,15 @@ export default class Animation extends React.PureComponent {
75
75
76
76
startTimer = ( ) => {
77
77
this . timeout = setTimeout ( ( ) => {
78
- requestAnimationFrame ( ( ) => {
79
- if ( ! this . state . templateSelected ) {
80
- this . setState ( {
81
- templateIndex :
82
- ( this . state . templateIndex + 1 ) % this . state . templates . length ,
83
- } ) ;
84
-
85
- this . startTimer ( ) ;
86
- }
87
- } ) ;
88
- } , 5000 ) ;
78
+ if ( ! this . state . templateSelected ) {
79
+ this . setState ( {
80
+ templateIndex :
81
+ ( this . state . templateIndex + 1 ) % this . state . templates . length ,
82
+ } ) ;
83
+
84
+ this . startTimer ( ) ;
85
+ }
86
+ } , 6000 ) ;
89
87
} ;
90
88
91
89
setCanvas = canvas => {
Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ const Container = styled.div`
11
11
padding-bottom: 3rem;
12
12
` ;
13
13
14
- const Column = styled . div `flex: 1;` ;
14
+ const Column = styled . div `
15
+ flex: 1;
16
+ ` ;
15
17
16
18
const Title = styled . h5 `
17
19
font-size: 1.125rem;
@@ -54,8 +56,8 @@ export default () => (
54
56
< Title > CodeSandbox</ Title >
55
57
< List >
56
58
< li >
57
- < a href = "/s/new " target = "_blank" rel = "noopener noreferrer" >
58
- Create A Sandbox
59
+ < a href = "/s" target = "_blank" rel = "noopener noreferrer" >
60
+ Create Sandbox
59
61
</ a >
60
62
</ li >
61
63
< li >
@@ -74,16 +76,48 @@ export default () => (
74
76
< Column >
75
77
< Title > About</ Title >
76
78
< List >
77
- < li > Blog</ li >
78
- < li > GitHub</ li >
79
+ < li >
80
+ < a
81
+ href = "https://medium.com/@compuives"
82
+ target = "_blank"
83
+ rel = "noopener noreferrer"
84
+ >
85
+ Blog
86
+ </ a >
87
+ </ li >
88
+ < li >
89
+ < a
90
+ href = "https://github.com/CompuIves/codesandbox-client"
91
+ target = "_blank"
92
+ rel = "noopener noreferrer"
93
+ >
94
+ GitHub
95
+ </ a >
96
+ </ li >
79
97
</ List >
80
98
</ Column >
81
99
82
100
< Column >
83
101
< Title > Social</ Title >
84
102
< List >
85
- < li > Twitter</ li >
86
- < li > Discord</ li >
103
+ < li >
104
+ < a
105
+ href = "https://twitter.com/codesandboxapp"
106
+ target = "_blank"
107
+ rel = "noopener noreferrer"
108
+ >
109
+ Twitter
110
+ </ a >
111
+ </ li >
112
+ < li >
113
+ < a
114
+ href = "https://discord.gg/KE3TbEZ"
115
+ target = "_blank"
116
+ rel = "noopener noreferrer"
117
+ >
118
+ Discord
119
+ </ a >
120
+ </ li >
87
121
</ List >
88
122
</ Column >
89
123
</ Container >
You can’t perform that action at this time.
0 commit comments