Skip to content

Commit

Permalink
chore: ignore this commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Agitator committed Feb 17, 2024
1 parent 43b624c commit 764bc59
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
Binary file added public/lab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 48 additions & 2 deletions src/pages/Dev.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { Button } from '@nextui-org/react'
import { Response } from '@tauri-apps/api/http'
import { motion } from 'framer-motion'
import { useTheme } from 'next-themes'
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'

import i18n from '../i18n/index.ts'
import { getNetworks } from '../services/zerotierService.ts'
import { useAppStore } from '../store/app.ts'
import { InvokeEvent } from '../typings/enum.ts'
import { invokeCommand, readTextFile, writeTextFile } from '../utils/helpers/tauriHelpers.ts'

function Dev() {
const { restartAsAdmin } = useAppStore()
const { theme, setTheme } = useTheme()
const navigate = useNavigate()
const [assList, setAssList] = useState<JSX.Element[]>([])

async function readConfiguration() {
return await readTextFile()
Expand All @@ -36,8 +40,9 @@ function Dev() {
})

const btnList = [
invokeCommandButton('get_config'),
invokeCommandButton('get_zerotier_server_info'),
invokeCommandButton(InvokeEvent.GET_CONFIG),
invokeCommandButton(InvokeEvent.GET_ZEROTIER_SERVER_INFO),
invokeCommandButton(InvokeEvent.HIDE_MAIN_WINDOW),
apiButton(getNetworks),
{
text: '[i18n]: translation',
Expand Down Expand Up @@ -79,14 +84,55 @@ function Dev() {
},
]

function ass(): JSX.Element {
return (
<motion.div
className={'absolute top-0 font-bold'}
initial={{ opacity: 0 }}
animate={{ opacity: 1, scale: 1.2, y: -10 }}
exit={{ opacity: 0 }}
>
kiss my ass!
</motion.div>
)
}

const kissMyAssBtn = (
<div className={'relative'}>
<Button
onClick={() => {
const newAssList = [...assList]
newAssList.push(ass())
setAssList(newAssList)
setTimeout(() => {
const newAssList = [...assList]
newAssList.shift()
setAssList(newAssList)
}, 1000)
}}
size="lg"
className="flowing-gradient bg-gradient-to-r from-[#f02fc2] to-[#6094ea] font-bold py-2 px-4 m-1 relative"
>
🤩
</Button>
{assList.map((item, index) => (
<div key={index}>{item}</div>
))}
</div>
)

return (
<div className="w-full min-h-[100vh] p-3">
<div className="flex flex-row justify-center">
<img src="/lab.png" className="w-40" />
</div>
<div className="w-full mt-5 flex flex-wrap ">
{btnList.map(({ text, onClick }) => (
<Button size="lg" className="font-bold mt-2 ml-2 flex-grow" color="warning" onClick={onClick} key={text}>
{text}
</Button>
))}
{kissMyAssBtn}
</div>
</div>
)
Expand Down

0 comments on commit 764bc59

Please sign in to comment.