-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
used CodeSandox as it's happening upstream: reactjs/react.dev#913 ...which allows uploading CSS (currently we can't with CodePen)
Showing
10 changed files
with
311 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.BordoFigo { | ||
padding: 10px 10px; | ||
border: 10px solid; | ||
} | ||
|
||
.BordoFigo-blue { | ||
border-color: blue; | ||
} | ||
|
||
.Finestra-titolo { | ||
margin: 0; | ||
font-family: sans-serif; | ||
} | ||
|
||
.Finestra-messaggio { | ||
font-size: larger; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './1.css'; | ||
|
||
function BordoFigo(props) { | ||
return ( | ||
<div className={'BordoFigo BordoFigo-' + props.colore}> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
|
||
function FinestraBenvenuto() { | ||
return ( | ||
<BordoFigo colore="blue"> | ||
<h1 className="Finestra-titolo">Benvenuto/a!</h1> | ||
<p className="Finestra-messaggio"> | ||
Ti ringraziamo per questa tua visita nella nostra | ||
nave spaziale! | ||
</p> | ||
</BordoFigo> | ||
); | ||
} | ||
|
||
ReactDOM.render( | ||
<FinestraBenvenuto />, | ||
document.getElementById('root') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
html, body, #root { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.Pannello { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.Pannello-sinistra { | ||
float: left; | ||
width: 30%; | ||
height: 100%; | ||
} | ||
|
||
.Pannello-destra { | ||
float: left; | ||
width: 70%; | ||
height: 100%; | ||
} | ||
|
||
.Contatti { | ||
width: 100%; | ||
height: 100%; | ||
background: lightblue; | ||
} | ||
|
||
.Chat { | ||
width: 100%; | ||
height: 100%; | ||
background: pink; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './2.css'; | ||
|
||
function Contatti() { | ||
return <div className="Contatti" />; | ||
} | ||
|
||
function Chat() { | ||
return <div className="Chat" />; | ||
} | ||
|
||
function Pannello(props) { | ||
return ( | ||
<div className="Pannello"> | ||
<div className="Pannello-sinistra"> | ||
{props.sinistra} | ||
</div> | ||
<div className="Pannello-destra">{props.destra}</div> | ||
</div> | ||
); | ||
} | ||
|
||
function App() { | ||
return ( | ||
<Pannello sinistra={<Contatti />} destra={<Chat />} /> | ||
); | ||
} | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.BordoFigo { | ||
padding: 10px 10px; | ||
border: 10px solid; | ||
} | ||
|
||
.BordoFigo-blue { | ||
border-color: blue; | ||
} | ||
|
||
.Finestra-titolo { | ||
margin: 0; | ||
font-family: sans-serif; | ||
} | ||
|
||
.Finestra-messaggio { | ||
font-size: larger; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './3.css'; | ||
|
||
function BordoFigo(props) { | ||
return ( | ||
<div className={'BordoFigo BordoFigo-' + props.colore}> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
|
||
function Finestra(props) { | ||
return ( | ||
<BordoFigo colore="blue"> | ||
<h1 className="Finestra-titolo">{props.titolo}</h1> | ||
<p className="Finestra-messaggio">{props.messaggio}</p> | ||
</BordoFigo> | ||
); | ||
} | ||
|
||
function FinestraBenvenuto() { | ||
return ( | ||
<Finestra | ||
titolo="Benvenuto/a!" | ||
messaggio="Ti ringraziamo per questa tua visita nella nostra | ||
nave spaziale!" | ||
/> | ||
); | ||
} | ||
|
||
ReactDOM.render( | ||
<FinestraBenvenuto />, | ||
document.getElementById('root') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.BordoFigo { | ||
padding: 10px 10px; | ||
border: 10px solid; | ||
} | ||
|
||
.BordoFigo-blue { | ||
border-color: blue; | ||
} | ||
|
||
.Finestra-titolo { | ||
margin: 0; | ||
font-family: sans-serif; | ||
} | ||
|
||
.Finestra-messaggio { | ||
font-size: larger; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './4.css'; | ||
|
||
function BordoFigo(props) { | ||
return ( | ||
<div className={'BordoFigo BordoFigo-' + props.colore}> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
|
||
function Finestra(props) { | ||
return ( | ||
<BordoFigo colore="blue"> | ||
<h1 className="Finestra-titolo">{props.titolo}</h1> | ||
<p className="Finestra-messaggio"> | ||
{props.messaggio} | ||
</p> | ||
{props.children} | ||
</BordoFigo> | ||
); | ||
} | ||
|
||
class FinestraRegistrazione extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.handleChange = this.handleChange.bind(this); | ||
this.handleSignUp = this.handleSignUp.bind(this); | ||
this.state = {login: ''}; | ||
} | ||
|
||
render() { | ||
return ( | ||
<Finestra | ||
titolo="Programma di Esplorazione di Marte" | ||
messaggio="Qual'è il tuo nome?"> | ||
<input | ||
value={this.state.login} | ||
onChange={this.handleChange} | ||
/> | ||
<button onClick={this.handleSignUp}> | ||
Registrami! | ||
</button> | ||
</Finestra> | ||
); | ||
} | ||
|
||
handleChange(e) { | ||
this.setState({login: e.target.value}); | ||
} | ||
|
||
handleSignUp() { | ||
alert(`Benvenuto/a a bordo, ${this.state.login}!`); | ||
} | ||
} | ||
|
||
ReactDOM.render( | ||
<FinestraRegistrazione />, | ||
document.getElementById('root') | ||
); |