Azuy commited on
Commit
d9a48e0
·
verified ·
1 Parent(s): 5743005

帮我做一个telegram的机器人

Browse files
Files changed (7) hide show
  1. README.md +8 -5
  2. components/footer.js +38 -0
  3. components/navbar.js +84 -0
  4. components/sidebar.js +75 -0
  5. index.html +136 -19
  6. script.js +58 -0
  7. style.css +34 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Telegram Bot Dashboard Delight
3
- emoji: 📚
4
- colorFrom: red
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: Telegram Bot Dashboard Delight 🤖
3
+ colorFrom: green
4
+ colorTo: gray
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
components/footer.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ footer {
7
+ background-color: #f9fafb;
8
+ }
9
+ </style>
10
+ <footer class="mt-12 border-t border-gray-200">
11
+ <div class="container mx-auto px-4 py-6">
12
+ <div class="flex flex-col md:flex-row justify-between items-center">
13
+ <div class="flex items-center space-x-2 mb-4 md:mb-0">
14
+ <i data-feather="send" class="w-5 h-5 text-gray-600"></i>
15
+ <span class="text-gray-700 font-medium">Telegram Bot Dashboard</span>
16
+ </div>
17
+ <div class="text-sm text-gray-500">
18
+ &copy; ${new Date().getFullYear()} Telegram Bot Dashboard. All rights reserved.
19
+ </div>
20
+ <div class="flex space-x-4 mt-4 md:mt-0">
21
+ <a href="#" class="text-gray-500 hover:text-gray-700">
22
+ <i data-feather="github" class="w-5 h-5"></i>
23
+ </a>
24
+ <a href="#" class="text-gray-500 hover:text-gray-700">
25
+ <i data-feather="twitter" class="w-5 h-5"></i>
26
+ </a>
27
+ <a href="#" class="text-gray-500 hover:text-gray-700">
28
+ <i data-feather="mail" class="w-5 h-5"></i>
29
+ </a>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </footer>
34
+ `;
35
+ }
36
+ }
37
+
38
+ customElements.define('custom-footer', CustomFooter);
components/navbar.js ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .navbar {
7
+ background-color: #0088cc;
8
+ }
9
+ .navbar-link:hover {
10
+ background-color: rgba(255, 255, 255, 0.1);
11
+ }
12
+ .mobile-menu {
13
+ transition: all 0.3s ease;
14
+ }
15
+ </style>
16
+ <nav class="navbar text-white shadow-md">
17
+ <div class="container mx-auto px-4">
18
+ <div class="flex justify-between items-center h-16">
19
+ <!-- Logo -->
20
+ <div class="flex items-center space-x-2">
21
+ <i data-feather="send" class="w-6 h-6"></i>
22
+ <span class="text-xl font-bold">Telegram Bot</span>
23
+ </div>
24
+
25
+ <!-- Desktop Menu -->
26
+ <div class="hidden md:flex items-center space-x-1">
27
+ <a href="#" class="navbar-link px-4 py-2 rounded-md font-medium flex items-center space-x-1">
28
+ <i data-feather="home" class="w-4 h-4"></i>
29
+ <span>Dashboard</span>
30
+ </a>
31
+ <a href="#" class="navbar-link px-4 py-2 rounded-md font-medium flex items-center space-x-1">
32
+ <i data-feather="settings" class="w-4 h-4"></i>
33
+ <span>Settings</span>
34
+ </a>
35
+ <a href="#" class="navbar-link px-4 py-2 rounded-md font-medium flex items-center space-x-1">
36
+ <i data-feather="users" class="w-4 h-4"></i>
37
+ <span>Users</span>
38
+ </a>
39
+ <a href="#" class="navbar-link px-4 py-2 rounded-md font-medium flex items-center space-x-1">
40
+ <i data-feather="message-square" class="w-4 h-4"></i>
41
+ <span>Messages</span>
42
+ </a>
43
+ </div>
44
+
45
+ <!-- User Profile & Mobile Menu Button -->
46
+ <div class="flex items-center space-x-4">
47
+ <div class="hidden md:flex items-center space-x-2 cursor-pointer">
48
+ <div class="w-8 h-8 rounded-full bg-white flex items-center justify-center text-blue-600 font-bold">A</div>
49
+ <span class="font-medium">Admin</span>
50
+ </div>
51
+ <button id="mobile-menu-button" class="md:hidden text-white focus:outline-none">
52
+ <i data-feather="menu" class="w-6 h-6"></i>
53
+ </button>
54
+ </div>
55
+ </div>
56
+ </div>
57
+
58
+ <!-- Mobile Menu -->
59
+ <div id="mobile-menu" class="md:hidden hidden mobile-menu">
60
+ <div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
61
+ <a href="#" class="block px-3 py-2 rounded-md text-base font-medium flex items-center space-x-2">
62
+ <i data-feather="home" class="w-4 h-4"></i>
63
+ <span>Dashboard</span>
64
+ </a>
65
+ <a href="#" class="block px-3 py-2 rounded-md text-base font-medium flex items-center space-x-2">
66
+ <i data-feather="settings" class="w-4 h-4"></i>
67
+ <span>Settings</span>
68
+ </a>
69
+ <a href="#" class="block px-3 py-2 rounded-md text-base font-medium flex items-center space-x-2">
70
+ <i data-feather="users" class="w-4 h-4"></i>
71
+ <span>Users</span>
72
+ </a>
73
+ <a href="#" class="block px-3 py-2 rounded-md text-base font-medium flex items-center space-x-2">
74
+ <i data-feather="message-square" class="w-4 h-4"></i>
75
+ <span>Messages</span>
76
+ </a>
77
+ </div>
78
+ </div>
79
+ </nav>
80
+ `;
81
+ }
82
+ }
83
+
84
+ customElements.define('custom-navbar', CustomNavbar);
components/sidebar.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomSidebar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .sidebar {
7
+ width: 250px;
8
+ }
9
+ .sidebar-item {
10
+ transition: all 0.2s ease;
11
+ }
12
+ .sidebar-item:hover {
13
+ background-color: #f3f4f6;
14
+ transform: translateX(4px);
15
+ }
16
+ .sidebar-item.active {
17
+ background-color: #e5e7eb;
18
+ border-left: 4px solid #0088cc;
19
+ }
20
+ </style>
21
+ <div class="sidebar hidden lg:block bg-white rounded-xl shadow-md p-4 h-fit">
22
+ <div class="space-y-2">
23
+ <a href="#" class="sidebar-item active flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
24
+ <i data-feather="home" class="w-5 h-5 text-gray-600"></i>
25
+ <span>Dashboard</span>
26
+ </a>
27
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
28
+ <i data-feather="settings" class="w-5 h-5 text-gray-600"></i>
29
+ <span>Bot Settings</span>
30
+ </a>
31
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
32
+ <i data-feather="users" class="w-5 h-5 text-gray-600"></i>
33
+ <span>User Management</span>
34
+ </a>
35
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
36
+ <i data-feather="message-square" class="w-5 h-5 text-gray-600"></i>
37
+ <span>Message Logs</span>
38
+ </a>
39
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
40
+ <i data-feather="command" class="w-5 h-5 text-gray-600"></i>
41
+ <span>Commands</span>
42
+ </a>
43
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
44
+ <i data-feather="activity" class="w-5 h-5 text-gray-600"></i>
45
+ <span>Analytics</span>
46
+ </a>
47
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
48
+ <i data-feather="file-text" class="w-5 h-5 text-gray-600"></i>
49
+ <span>Logs</span>
50
+ </a>
51
+ </div>
52
+
53
+ <div class="mt-8 pt-4 border-t border-gray-200">
54
+ <h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3 px-2">BOT TOOLS</h3>
55
+ <div class="space-y-2">
56
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
57
+ <i data-feather="send" class="w-5 h-5 text-gray-600"></i>
58
+ <span>Broadcast</span>
59
+ </a>
60
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
61
+ <i data-feather="database" class="w-5 h-5 text-gray-600"></i>
62
+ <span>Database</span>
63
+ </a>
64
+ <a href="#" class="sidebar-item flex items-center space-x-3 px-4 py-3 rounded-lg font-medium">
65
+ <i data-feather="terminal" class="w-5 h-5 text-gray-600"></i>
66
+ <span>API Console</span>
67
+ </a>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ `;
72
+ }
73
+ }
74
+
75
+ customElements.define('custom-sidebar', CustomSidebar);
index.html CHANGED
@@ -1,19 +1,136 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Telegram Bot Dashboard</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ </head>
12
+ <body class="bg-gray-100 min-h-screen">
13
+ <custom-navbar></custom-navbar>
14
+
15
+ <div class="container mx-auto px-4 py-8">
16
+ <div class="flex flex-col lg:flex-row gap-8">
17
+ <!-- Sidebar -->
18
+ <custom-sidebar></custom-sidebar>
19
+
20
+ <!-- Main Content -->
21
+ <div class="flex-1">
22
+ <div class="bg-white rounded-xl shadow-md p-6 mb-8">
23
+ <h1 class="text-3xl font-bold text-gray-800 mb-6">Telegram Bot Dashboard</h1>
24
+
25
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
26
+ <!-- Bot Stats Card -->
27
+ <div class="bg-blue-50 rounded-lg p-6 shadow-sm">
28
+ <div class="flex items-center justify-between mb-4">
29
+ <h2 class="text-lg font-semibold text-blue-800">Bot Statistics</h2>
30
+ <i data-feather="bar-chart-2" class="text-blue-600"></i>
31
+ </div>
32
+ <div class="space-y-3">
33
+ <div>
34
+ <p class="text-sm text-blue-700">Total Users</p>
35
+ <p class="text-2xl font-bold text-blue-900">1,248</p>
36
+ </div>
37
+ <div>
38
+ <p class="text-sm text-blue-700">Active Today</p>
39
+ <p class="text-2xl font-bold text-blue-900">327</p>
40
+ </div>
41
+ </div>
42
+ </div>
43
+
44
+ <!-- Commands Card -->
45
+ <div class="bg-green-50 rounded-lg p-6 shadow-sm">
46
+ <div class="flex items-center justify-between mb-4">
47
+ <h2 class="text-lg font-semibold text-green-800">Bot Commands</h2>
48
+ <i data-feather="command" class="text-green-600"></i>
49
+ </div>
50
+ <div class="space-y-3">
51
+ <div>
52
+ <p class="text-sm text-green-700">Total Commands</p>
53
+ <p class="text-2xl font-bold text-green-900">12</p>
54
+ </div>
55
+ <div>
56
+ <p class="text-sm text-green-700">Most Used</p>
57
+ <p class="text-2xl font-bold text-green-900">/help</p>
58
+ </div>
59
+ </div>
60
+ </div>
61
+
62
+ <!-- Recent Activity -->
63
+ <div class="bg-purple-50 rounded-lg p-6 shadow-sm">
64
+ <div class="flex items-center justify-between mb-4">
65
+ <h2 class="text-lg font-semibold text-purple-800">Recent Activity</h2>
66
+ <i data-feather="activity" class="text-purple-600"></i>
67
+ </div>
68
+ <div class="space-y-3">
69
+ <div>
70
+ <p class="text-sm text-purple-700">New Users (24h)</p>
71
+ <p class="text-2xl font-bold text-purple-900">43</p>
72
+ </div>
73
+ <div>
74
+ <p class="text-sm text-purple-700">Messages</p>
75
+ <p class="text-2xl font-bold text-purple-900">1,892</p>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+
82
+ <!-- Bot Configuration Section -->
83
+ <div class="bg-white rounded-xl shadow-md p-6">
84
+ <h2 class="text-2xl font-bold text-gray-800 mb-6">Bot Configuration</h2>
85
+
86
+ <div class="space-y-6">
87
+ <div>
88
+ <h3 class="text-lg font-semibold text-gray-700 mb-3">Bot Token</h3>
89
+ <div class="flex items-center space-x-2">
90
+ <input type="password" class="flex-1 border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" value="123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ">
91
+ <button class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
92
+ <i data-feather="refresh-cw" class="w-4 h-4"></i>
93
+ </button>
94
+ <button class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition">
95
+ <i data-feather="copy" class="w-4 h-4"></i>
96
+ </button>
97
+ </div>
98
+ </div>
99
+
100
+ <div>
101
+ <h3 class="text-lg font-semibold text-gray-700 mb-3">Webhook URL</h3>
102
+ <div class="flex items-center space-x-2">
103
+ <input type="text" class="flex-1 border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" value="https://yourdomain.com/webhook">
104
+ <button class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
105
+ <i data-feather="refresh-cw" class="w-4 h-4"></i>
106
+ </button>
107
+ <button class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition">
108
+ <i data-feather="copy" class="w-4 h-4"></i>
109
+ </button>
110
+ </div>
111
+ </div>
112
+
113
+ <div class="flex justify-end">
114
+ <button class="bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition flex items-center space-x-2">
115
+ <i data-feather="save" class="w-4 h-4"></i>
116
+ <span>Save Changes</span>
117
+ </button>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+
125
+ <custom-footer></custom-footer>
126
+
127
+ <script src="components/navbar.js"></script>
128
+ <script src="components/sidebar.js"></script>
129
+ <script src="components/footer.js"></script>
130
+ <script src="script.js"></script>
131
+ <script>
132
+ feather.replace();
133
+ </script>
134
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
135
+ </body>
136
+ </html>
script.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // Initialize tooltips for all elements with data-tooltip attribute
3
+ const tooltipElements = document.querySelectorAll('[data-tooltip]');
4
+
5
+ tooltipElements.forEach(el => {
6
+ el.addEventListener('mouseenter', function() {
7
+ const tooltip = document.createElement('div');
8
+ tooltip.className = 'absolute z-50 px-3 py-2 text-sm text-white bg-gray-800 rounded-md shadow-lg';
9
+ tooltip.textContent = this.getAttribute('data-tooltip');
10
+ tooltip.style.top = `${this.getBoundingClientRect().top - 40}px`;
11
+ tooltip.style.left = `${this.getBoundingClientRect().left + (this.offsetWidth / 2) - (tooltip.offsetWidth / 2)}px`;
12
+ tooltip.id = 'current-tooltip';
13
+ document.body.appendChild(tooltip);
14
+ });
15
+
16
+ el.addEventListener('mouseleave', function() {
17
+ const tooltip = document.getElementById('current-tooltip');
18
+ if (tooltip) {
19
+ tooltip.remove();
20
+ }
21
+ });
22
+ });
23
+
24
+ // Toggle mobile menu
25
+ const mobileMenuButton = document.querySelector('#mobile-menu-button');
26
+ const mobileMenu = document.querySelector('#mobile-menu');
27
+
28
+ if (mobileMenuButton && mobileMenu) {
29
+ mobileMenuButton.addEventListener('click', function() {
30
+ mobileMenu.classList.toggle('hidden');
31
+ });
32
+ }
33
+
34
+ // Copy to clipboard functionality
35
+ const copyButtons = document.querySelectorAll('[data-copy]');
36
+
37
+ copyButtons.forEach(button => {
38
+ button.addEventListener('click', function() {
39
+ const target = this.getAttribute('data-copy');
40
+ const element = document.querySelector(target);
41
+
42
+ if (element) {
43
+ element.select();
44
+ document.execCommand('copy');
45
+
46
+ // Show feedback
47
+ const originalText = this.innerHTML;
48
+ this.innerHTML = '<i data-feather="check" class="w-4 h-4"></i> Copied!';
49
+ feather.replace();
50
+
51
+ setTimeout(() => {
52
+ this.innerHTML = originalText;
53
+ feather.replace();
54
+ }, 2000);
55
+ }
56
+ });
57
+ });
58
+ });
style.css CHANGED
@@ -1,28 +1,44 @@
 
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
 
28
  }
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
2
+
3
  body {
4
+ font-family: 'Inter', sans-serif;
5
+ }
6
+
7
+ /* Custom scrollbar */
8
+ ::-webkit-scrollbar {
9
+ width: 8px;
10
+ height: 8px;
11
+ }
12
+
13
+ ::-webkit-scrollbar-track {
14
+ background: #f1f1f1;
15
+ border-radius: 10px;
16
+ }
17
+
18
+ ::-webkit-scrollbar-thumb {
19
+ background: #888;
20
+ border-radius: 10px;
21
  }
22
 
23
+ ::-webkit-scrollbar-thumb:hover {
24
+ background: #555;
 
25
  }
26
 
27
+ /* Animation for buttons */
28
+ button {
29
+ transition: all 0.2s ease-in-out;
 
 
30
  }
31
 
32
+ button:hover {
33
+ transform: translateY(-1px);
 
 
 
 
34
  }
35
 
36
+ /* Custom shadow for cards */
37
+ .shadow-telegram {
38
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
39
  }
40
+
41
+ /* Telegram-like accent color */
42
+ .bg-telegram {
43
+ background-color: #0088cc;
44
+ }