Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,21 @@
|
|
1 |
from flask import Flask, Response
|
|
|
2 |
app = Flask(__name__)
|
3 |
|
4 |
@app.route('/')
|
5 |
def index():
|
6 |
html_content = '''
|
7 |
<!DOCTYPE html>
|
8 |
-
<html>
|
9 |
<head>
|
10 |
-
<title>TON Connect</title>
|
11 |
<meta charset="UTF-8">
|
12 |
-
<
|
|
|
13 |
<style>
|
14 |
body {
|
15 |
font-family: Arial, sans-serif;
|
16 |
-
background: #
|
17 |
-
color:
|
18 |
display: flex;
|
19 |
flex-direction: column;
|
20 |
align-items: center;
|
@@ -22,53 +23,33 @@ def index():
|
|
22 |
height: 100vh;
|
23 |
margin: 0;
|
24 |
}
|
25 |
-
|
26 |
-
|
27 |
-
background: #00aaff;
|
28 |
-
border: none;
|
29 |
-
color: white;
|
30 |
-
padding: 15px 30px;
|
31 |
-
font-size: 16px;
|
32 |
-
cursor: pointer;
|
33 |
-
border-radius: 10px;
|
34 |
-
transition: background 0.3s ease;
|
35 |
-
}
|
36 |
-
|
37 |
-
.button:hover {
|
38 |
-
background: #0077cc;
|
39 |
}
|
40 |
-
|
41 |
-
|
42 |
-
margin-top: 20px;
|
43 |
-
font-size: 14px;
|
44 |
-
color: #aaa;
|
45 |
}
|
46 |
</style>
|
47 |
</head>
|
48 |
<body>
|
49 |
-
<h1>Подключение к TON
|
50 |
-
<
|
51 |
-
<div id="status"
|
52 |
|
53 |
<script>
|
54 |
-
const
|
55 |
manifestUrl: 'https://huggingface.co/spaces/Aleksmorshen/MorshenGroup/resolve/main/tonconnect-manifest.json',
|
56 |
-
buttonRootId: 'connect-button'
|
57 |
});
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
tonConnect.onStatusChange(wallet => {
|
62 |
if (wallet) {
|
63 |
-
statusDiv.innerText =
|
64 |
} else {
|
65 |
-
statusDiv.innerText = 'Не подключено';
|
66 |
}
|
67 |
});
|
68 |
-
|
69 |
-
document.getElementById('connect-button').addEventListener('click', () => {
|
70 |
-
tonConnect.connectWallet();
|
71 |
-
});
|
72 |
</script>
|
73 |
</body>
|
74 |
</html>
|
|
|
1 |
from flask import Flask, Response
|
2 |
+
|
3 |
app = Flask(__name__)
|
4 |
|
5 |
@app.route('/')
|
6 |
def index():
|
7 |
html_content = '''
|
8 |
<!DOCTYPE html>
|
9 |
+
<html lang="ru">
|
10 |
<head>
|
|
|
11 |
<meta charset="UTF-8">
|
12 |
+
<title>TON Connect</title>
|
13 |
+
<script src="https://unpkg.com/@tonconnect/ui@latest/dist/tonconnect-ui.min.js"></script>
|
14 |
<style>
|
15 |
body {
|
16 |
font-family: Arial, sans-serif;
|
17 |
+
background-color: #111;
|
18 |
+
color: white;
|
19 |
display: flex;
|
20 |
flex-direction: column;
|
21 |
align-items: center;
|
|
|
23 |
height: 100vh;
|
24 |
margin: 0;
|
25 |
}
|
26 |
+
h1 {
|
27 |
+
margin-bottom: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
+
#ton-connect-button {
|
30 |
+
margin-top: 10px;
|
|
|
|
|
|
|
31 |
}
|
32 |
</style>
|
33 |
</head>
|
34 |
<body>
|
35 |
+
<h1>Подключение к TON</h1>
|
36 |
+
<div id="ton-connect-button"></div>
|
37 |
+
<div id="status">Статус: не подключено</div>
|
38 |
|
39 |
<script>
|
40 |
+
const tonConnectUI = new TON_CONNECT_UI.TonConnectUI({
|
41 |
manifestUrl: 'https://huggingface.co/spaces/Aleksmorshen/MorshenGroup/resolve/main/tonconnect-manifest.json',
|
42 |
+
buttonRootId: 'ton-connect-button'
|
43 |
});
|
44 |
|
45 |
+
tonConnectUI.onStatusChange(wallet => {
|
46 |
+
const statusDiv = document.getElementById('status');
|
|
|
47 |
if (wallet) {
|
48 |
+
statusDiv.innerText = `✅ Подключено: ${wallet.account.address}`;
|
49 |
} else {
|
50 |
+
statusDiv.innerText = '❌ Не подключено';
|
51 |
}
|
52 |
});
|
|
|
|
|
|
|
|
|
53 |
</script>
|
54 |
</body>
|
55 |
</html>
|