This commit is contained in:
Kavalar 2025-01-03 18:34:03 +03:00
parent d2ffae95dc
commit 069a5b223f
2 changed files with 8 additions and 0 deletions

View File

@ -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="<?= $resources ?>/css/bootstrap.min.css">
<link rel="stylesheet" href="<?= $resources ?>/css/style.css">
<script src="https://telegram.org/js/telegram-web-app.js"></script>
</head>
<body>
@ -66,6 +67,7 @@
<button type="button" class="btn-close closeAlertBtn"></button>
</div>
<?php endif; ?>
<div id="username_tag"></div>
<?= $content ?>
</div>
</div>
@ -74,5 +76,6 @@
<script src="<?= $resources ?>/js/popper.js"></script>
<script src="<?= $resources ?>/js/bootstrap.min.js"></script>
<script src="<?= $resources ?>/js/main.js"></script>
<script src="<?= $resources ?>/js/tg.js"></script>
</body>
</html>

5
resources/main/js/tg.js Normal file
View 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;
});