File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,37 @@ function WarnIfUnsavedChanges() {
87
87
) ;
88
88
}
89
89
90
+ function Banner ( ) {
91
+ // temporary banner to display funding opportunities
92
+ const [ textObj , setTextObj ] = useState ( { } ) ;
93
+
94
+ useEffect ( ( ) => {
95
+ const grant1 = {
96
+ copy :
97
+ 'Learn to make art with AI with the Social Software High School Summer Institute. Apply by June 1!' ,
98
+ url : 'https://summer.ucla.edu/program/social-software-summer-institute/'
99
+ } ;
100
+
101
+ const grant2 = {
102
+ copy :
103
+ 'Join us in contributing to p5.js——receive a $10,000 opportunity to grow within the contributor community!' ,
104
+ url : 'https://processingfoundation.org/grants'
105
+ } ;
106
+
107
+ const allMessages = [ grant1 , grant2 ] ;
108
+ const randomIndex = Math . floor ( Math . random ( ) * allMessages . length ) ;
109
+ const randomMessage = allMessages [ randomIndex ] ;
110
+
111
+ setTextObj ( randomMessage ) ;
112
+ } , [ ] ) ;
113
+
114
+ return (
115
+ < div className = "banner" >
116
+ < a href = { textObj . url } > { textObj . copy } </ a >
117
+ </ div >
118
+ ) ;
119
+ }
120
+
90
121
export const CmControllerContext = React . createContext ( { } ) ;
91
122
92
123
const IDEView = ( ) => {
@@ -170,6 +201,7 @@ const IDEView = () => {
170
201
< Helmet >
171
202
< title > { getTitle ( project ) } </ title >
172
203
</ Helmet >
204
+ < Banner />
173
205
< IDEKeyHandlers getContent = { ( ) => cmRef . current ?. getContent ( ) } />
174
206
< WarnIfUnsavedChanges />
175
207
< Toast />
Original file line number Diff line number Diff line change 16
16
width : 100% ;
17
17
}
18
18
19
+ .banner {
20
+ width : 100% ;
21
+ min-height : 2.2rem ;
22
+ text-align : center ;
23
+ padding : 0.5rem ;
24
+ font-weight : bold ;
25
+ border-bottom : 1px dashed #A6A6A6 ;
26
+
27
+ @media (max-width : 770px ) {
28
+ min-height : 3.3rem ;
29
+ }
30
+ }
31
+
19
32
.sidebar {
20
33
width : 100% ;
21
34
height : 100% ;
You can’t perform that action at this time.
0 commit comments