Merge branch 'RadiusProxy:main' into main
This commit is contained in:
commit
bd9b5def0c
2 changed files with 47 additions and 0 deletions
35
public/splash.json
Normal file
35
public/splash.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[
|
||||
{
|
||||
"splash": "testt22"
|
||||
},
|
||||
{
|
||||
"splash": "https://discord.gg/qsXnhSPtAK"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
},
|
||||
{
|
||||
"splash": "--placeholder--"
|
||||
}
|
||||
]
|
||||
|
|
@ -10,7 +10,18 @@ import store from 'store2'
|
|||
export default function Home() {
|
||||
const router = useRouter()
|
||||
const [shortcuts, setShortcuts] = useState<Item[]>([])
|
||||
const [splashText, setSplashText] = useState<string>('')
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
fetch('/splash.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const randomIndex = Math.floor(Math.random() * data.length);
|
||||
setSplashText(data[randomIndex].splash);
|
||||
})
|
||||
.catch(error => console.error('Error fetching splash text:', error));
|
||||
|
||||
store.set('shortcuts', [], false)
|
||||
const data: Item[] = store('shortcuts')
|
||||
setShortcuts(data)
|
||||
|
|
@ -36,6 +47,7 @@ export default function Home() {
|
|||
<Search className="h-4 w-4 text-muted-foreground absolute top-1/2 -translate-y-1/2 left-3" />
|
||||
</div>
|
||||
</div>
|
||||
<p style={{ fontSize: '1rem', fontWeight: 'normal', marginTop: '0.4rem' }}>{splashText}</p>
|
||||
{shortcuts.length > 0 && (
|
||||
<div className="py-2 flex flex-wrap gap-2 justify-center">
|
||||
{shortcuts.map((shortcut: Item) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue