-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
87 lines (79 loc) · 2.19 KB
/
index.html
File metadata and controls
87 lines (79 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>gibberish</title>
<link rel="stylesheet" href="public/css/bulma-0.7.2.min.css">
</head>
<body>
<section>
<div class="hero-body">
<div class="container">
<div id="gibberish"></div>
</div>
</div>
</section>
</body>
<script src="public/js/jquery-2.2.4.min.js"></script>
<script src="https://unpkg.com/react@16.3.1/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.3.1/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.min.js"></script>
<script src="public/js/script.js"></script>
<script type="text/babel">
const colors = [
'is-white',
'is-black',
'is-light',
'is-dark',
'is-primary',
'is-link',
'is-info',
'is-success',
'is-warning',
'is-danger'
];
const isBold = [true, false];
const theme = [
'hero',
random(colors),
'is-fullheight',
random(isBold) ? 'is-bold' : ''
].join(' ');
console.log(theme);
$('section').addClass(theme);
class Gibberish extends React.Component {
constructor(props) {
super(props);
this.state = {
gibberish: '',
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
this.setState({
gibberish: event.target.value,
});
}
render() {
const { gibberish } = this.state;
return (
<div className="field">
<div className="control is-large">
<input
className="input is-large is-rounded"
type="text"
value={gibberish}
onChange={this.handleChange}
/>
<div className="content is-large">
{gibberish.length ? <p>{renderGibberish(gibberish)}</p>: null}
</div>
</div>
</div>
);
}
}
ReactDOM.render(<Gibberish />, document.getElementById('gibberish'));
</script>
</html>