-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
96 lines (84 loc) · 2.25 KB
/
index.html
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
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Brython Crash Course</title>
<script src="brython.js"></script>
<script src="brython_stdlib.js"></script>
<script src="main.py" type="text/python"></script>
<script src="main.js"></script>
</head>
<style>
#rotate-box {
width: 100px;
height: 100px;
background-color: red;
margin: 60px;
}
</style>
<body onload="brython()">
<!-- Alert & Insert -->
<h2 id="output-hello"></h2>
<button id="btn">Click Me</button>
<hr />
<!-- I/O in the same time -->
<input type="text" id="text" />
<span id="output"></span>
<hr />
<!-- Template Variable -->
<h2 id="hi-to">Hello {name}, How are you today ?</h2>
<h3 id="sum">{a} + {b} = {a + b}</h3>
<hr />
<!-- Ajax Call -->
<button id="joke-btn">Get joke</button>
<p id="show-joke">Click on "get joke" button for get a joke</p>
<hr />
<!-- load file -->
<input type="file" id="file-upload" />
<br />
<textarea id="file-text" cols="60" rows="10"></textarea>
<hr />
<!-- Animation -->
<button id="rotate-btn">Click to rotate</button>
<div id="rotate-box"></div>
<hr />
<!-- Local storage -->
<h2>
Saved Item:
<span id="show-saved"></span>
</h2>
<input type="text" id="get-item" />
<button id="add-btn">add</button>
<button id="remove-btn">remove</button>
<hr />
<!-- Drawing -->
<h2>Drawing by javascript and get data by brython</h2>
<input type="text" id="height" />
<br />
<br />
<input type="text" id="width" />
<br />
<br />
<input type="text" id="color" />
<br />
<br />
<button id="draw-btn">Draw</button>
<div id="shap"></div>
<hr />
<!-- Drawing -->
<h2>Drawing by brython and get data by javascript</h2>
<input type="text" id="height2" />
<br />
<br />
<input type="text" id="width2" />
<br />
<br />
<input type="text" id="color2" />
<br />
<br />
<button onclick="draw_js_2()">Draw</button>
<div id="shap2"></div>
</body>
</html>