js
This commit is contained in:
parent
d2ffae95dc
commit
069a5b223f
@ -20,6 +20,7 @@
|
|||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
|
||||||
<link rel="stylesheet" href="<?= $resources ?>/css/bootstrap.min.css">
|
<link rel="stylesheet" href="<?= $resources ?>/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="<?= $resources ?>/css/style.css">
|
<link rel="stylesheet" href="<?= $resources ?>/css/style.css">
|
||||||
|
<script src="https://telegram.org/js/telegram-web-app.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@ -66,6 +67,7 @@
|
|||||||
<button type="button" class="btn-close closeAlertBtn"></button>
|
<button type="button" class="btn-close closeAlertBtn"></button>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<div id="username_tag"></div>
|
||||||
<?= $content ?>
|
<?= $content ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -74,5 +76,6 @@
|
|||||||
<script src="<?= $resources ?>/js/popper.js"></script>
|
<script src="<?= $resources ?>/js/popper.js"></script>
|
||||||
<script src="<?= $resources ?>/js/bootstrap.min.js"></script>
|
<script src="<?= $resources ?>/js/bootstrap.min.js"></script>
|
||||||
<script src="<?= $resources ?>/js/main.js"></script>
|
<script src="<?= $resources ?>/js/main.js"></script>
|
||||||
|
<script src="<?= $resources ?>/js/tg.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
5
resources/main/js/tg.js
Normal file
5
resources/main/js/tg.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
let tg = window.Telegram.WebApp;
|
||||||
|
let username_tag = document.getElementById("username_tag")
|
||||||
|
username_tag.innerHTML = tg.initDataUnsafe.user.username;
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user