1
- import React from 'react' ;
1
+ import React , { useState , useRef , useEffect } from 'react' ;
2
2
import clsx from 'clsx' ;
3
3
import Layout from '@theme/Layout' ;
4
4
import Link from '@docusaurus/Link' ;
@@ -12,7 +12,7 @@ const features = [
12
12
imageUrl : 'img/undraw_pair_programming_njlp.svg' ,
13
13
description : (
14
14
< >
15
- Ultroid has been written from scratch, making it more stable and less of crashes
15
+ Ultroid has been written from scratch, making it more stable and less prone to crashes.
16
16
</ >
17
17
) ,
18
18
} ,
@@ -22,7 +22,7 @@ const features = [
22
22
description : (
23
23
< >
24
24
Ultroid warns you when you try to install/execute dangerous stuff
25
- (people nowadays make plugins to hack user accounts, Ultroid is safe)
25
+ (people nowadays make plugins to hack user accounts, Ultroid is safe).
26
26
</ >
27
27
) ,
28
28
} ,
@@ -31,34 +31,168 @@ const features = [
31
31
imageUrl : 'img/undraw_cloud_hosting_aodd.svg' ,
32
32
description : (
33
33
< >
34
- Unlike many others userbots* which are being suspended by heroku , Ultroid doesn' t get suspended.
34
+ Unlike many other userbots which are suspended by Heroku , Ultroid doesn’ t get suspended.
35
35
</ >
36
36
) ,
37
37
} ,
38
+ {
39
+ title : 'Ultroid on Termux' ,
40
+ imageUrl : 'img/undraw_mobile-app_qxev.svg' ,
41
+ description : (
42
+ < >
43
+ Run Ultroid on Termux with just a few clicks — everything is automated for you. Fast, simple, beginner-friendly, and designed to work seamlessly on mobile devices.
44
+ </ >
45
+ ) ,
46
+ downloadLinks : [
47
+ {
48
+ label : 'arm64' ,
49
+ size : '32.80 MB' ,
50
+ href : 'https://github.com/TeamUltroid/Ultroid-Termux/releases/download/v0.118.0%2Bc579131-apt-android-7-github-debug/termux-app_v0.118.0+c579131-apt-android-7-github-debug_arm64-v8a.apk'
51
+ } ,
52
+ {
53
+ label : 'armeabi' ,
54
+ size : '31.00 MB' ,
55
+ href : 'https://github.com/TeamUltroid/Ultroid-Termux/releases/download/v0.118.0%2Bc579131-apt-android-7-github-debug/termux-app_v0.118.0+c579131-apt-android-7-github-debug_armeabi-v7a.apk'
56
+ } ,
57
+ {
58
+ label : 'universal' ,
59
+ size : '108.0 MB' ,
60
+ href : 'https://github.com/TeamUltroid/Ultroid-Termux/releases/download/v0.118.0%2Bc579131-apt-android-7-github-debug/termux-app_v0.118.0+c579131-apt-android-7-github-debug_universal.apk'
61
+ }
62
+ ] ,
63
+
64
+ } ,
65
+ {
66
+ title : 'Support Ultroid' ,
67
+ imageUrl : 'img/undraw_new-entries_xw4m.svg' ,
68
+
69
+ description : (
70
+ < >
71
+ If you liked our work and want to sponsor or fund the project, your support means the world to us! It helps us keep improving Ultroid for the community.
72
+ </ >
73
+ ) ,
74
+ sponsor : true ,
75
+ sponsorLinks : [
76
+ {
77
+ label : 'Sponsor on GitHub' ,
78
+ href : 'https://github.com/sponsors/TeamUltroid' ,
79
+ type : 'primary' ,
80
+ }
81
+ ] ,
82
+ } ,
38
83
] ;
39
84
40
- function Feature ( { imageUrl, title, description } ) {
85
+ function Feature ( { imageUrl, title, description, downloadLinks , sponsor , sponsorLinks } ) {
41
86
const imgUrl = useBaseUrl ( imageUrl ) ;
87
+ const [ menuOpen , setMenuOpen ] = useState ( false ) ;
88
+ const dropdownRef = useRef ( null ) ;
89
+
90
+ useEffect ( ( ) => {
91
+ function handleClickOutside ( event ) {
92
+ if ( dropdownRef . current && ! dropdownRef . current . contains ( event . target ) ) {
93
+ setMenuOpen ( false ) ;
94
+ }
95
+ }
96
+ function handleKeyDown ( event ) {
97
+ if ( event . key === 'Escape' ) {
98
+ setMenuOpen ( false ) ;
99
+ }
100
+ }
101
+ if ( menuOpen ) {
102
+ document . addEventListener ( 'mousedown' , handleClickOutside ) ;
103
+ window . addEventListener ( 'keydown' , handleKeyDown ) ;
104
+ }
105
+ return ( ) => {
106
+ document . removeEventListener ( 'mousedown' , handleClickOutside ) ;
107
+ window . removeEventListener ( 'keydown' , handleKeyDown ) ;
108
+ } ;
109
+ } , [ menuOpen ] ) ;
110
+
42
111
return (
43
112
< div className = { clsx ( 'col col--4' , styles . feature ) } >
44
113
{ imgUrl && (
45
114
< div className = "text--center" >
46
115
< img className = { styles . featureImage } src = { imgUrl } alt = { title } />
47
116
</ div >
48
117
) }
118
+
49
119
< h3 > { title } </ h3 >
50
- < p > { description } </ p >
120
+ < p className = { styles . justifyText } > { description } </ p >
121
+
122
+ { ( downloadLinks || sponsorLinks ) && (
123
+ < div className = { styles . buttonRow } >
124
+ { downloadLinks && ! sponsor && (
125
+ < div className = { styles . termuxDownloadWrapper } ref = { dropdownRef } >
126
+ < Link
127
+ className = { clsx ( 'button button--primary button--lg' , styles . downloadButton ) }
128
+ to = "#"
129
+ onClick = { ( e ) => {
130
+ e . preventDefault ( ) ;
131
+ setMenuOpen ( ! menuOpen ) ;
132
+ } }
133
+ >
134
+ Download{ ' ' }
135
+ < span
136
+ className = { clsx ( styles . downloadArrow , {
137
+ [ styles . rotated ] : menuOpen ,
138
+ } ) }
139
+ >
140
+ ▼
141
+ </ span >
142
+
143
+ </ Link >
144
+ < ul
145
+ className = { clsx ( styles . termuxDropdownMenu , {
146
+ [ styles . open ] : menuOpen ,
147
+ [ styles . closed ] : ! menuOpen ,
148
+ } ) }
149
+ style = { { pointerEvents : menuOpen ? 'auto' : 'none' } }
150
+ >
151
+ { downloadLinks . map ( ( { label, size, href } , i ) => (
152
+ < li key = { i } >
153
+ < Link
154
+ className = { styles . termuxDropdownItem }
155
+ to = { href }
156
+ target = "_blank"
157
+ rel = "noopener noreferrer"
158
+ >
159
+ < span className = { styles . itemName } > { label } </ span >
160
+ < span className = { styles . itemSize } > { size } </ span >
161
+ </ Link >
162
+ </ li >
163
+ ) ) }
164
+ </ ul >
165
+ </ div >
166
+ ) }
167
+
168
+ { sponsor && sponsorLinks && (
169
+ < div className = { styles . termuxDownloadWrapper } >
170
+ { sponsorLinks . map ( ( { label, href } , idx ) => (
171
+ < a
172
+ key = { idx }
173
+ href = { href }
174
+ target = "_blank"
175
+ rel = "noopener noreferrer"
176
+ className = { clsx ( 'button button--primary button--lg' , styles . downloadButton ) }
177
+ >
178
+ { label }
179
+ </ a >
180
+ ) ) }
181
+ </ div >
182
+ ) }
183
+ </ div >
184
+ ) }
185
+
186
+
51
187
</ div >
52
188
) ;
53
189
}
54
190
191
+
55
192
function Home ( ) {
56
- const context = useDocusaurusContext ( ) ;
57
- const { siteConfig = { } } = context ;
193
+ const { siteConfig = { } } = useDocusaurusContext ( ) ;
58
194
return (
59
- < Layout
60
- title = { `Ultroid Userbot` }
61
- description = "Ultroid Userbot Documentation" >
195
+ < Layout title = "Ultroid Userbot" description = "Ultroid Userbot Documentation" >
62
196
< header className = { clsx ( 'hero hero--primary' , styles . heroBanner ) } >
63
197
< div className = "container" >
64
198
< h1 className = "hero__title" > { siteConfig . title } </ h1 >
@@ -67,24 +201,17 @@ function Home() {
67
201
< Link
68
202
className = { clsx (
69
203
'margin-horiz--xs button button--outline button--secondary button--lg' ,
70
- styles . getStarted ,
204
+ styles . getStarted
71
205
) }
72
- to = { useBaseUrl ( 'docs/' ) } >
206
+ to = { useBaseUrl ( 'docs/' ) }
207
+ >
73
208
Get Started
74
209
</ Link >
75
- { /* <Link
76
- className={clsx(
77
- 'margin-horiz--xs button button--bg button--success button--lg',
78
- styles.deploy,
79
- )}
80
- to={useBaseUrl('docs/installation/heroku')}>
81
- Deploy Now
82
- </Link> */ }
83
210
</ div >
84
211
</ div >
85
212
</ header >
86
213
< main >
87
- { features && features . length > 0 && (
214
+ { features . length > 0 && (
88
215
< section className = { styles . features } >
89
216
< div className = "container" >
90
217
< div className = "row" >
0 commit comments