Skip to content

Commit e6e2d07

Browse files
authored
fix: enhance UI components for better user experience and accessibility (#93)
1 parent f5bf88b commit e6e2d07

File tree

3 files changed

+115
-24
lines changed

3 files changed

+115
-24
lines changed

README.md

Lines changed: 106 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,126 @@
1-
# [Live Site - HackRF.app](https://hackrf.app/)
1+
# Mayhem Hub
22

3-
This is a [Next.js](https://nextjs.org/) TypeScript project. We use [Tailwind](https://tailwindcss.com/) for styling.
3+
## [Live Site → HackRF.app](https://hackrf.app/)
44

5-
We have make this website a PWA, so you can load it even without an internet connection!
5+
The web interface for everything HackRF/Portapack Mayhem. This project provides a comprehensive, browser-based dashboard to interact with your device, eliminating the need for command-line tools or constant SD card swapping for many common tasks.
66

7-
# What is this?
7+
This application is a Progressive Web App (PWA), so you can install it on your desktop and use it offline!
88

9-
If you are new to *HackRF+PortaPack+Mayhem*, check this:
9+
## What is this?
10+
11+
If you are new to the _HackRF + PortaPack + Mayhem firmware_, this video provides a great overview of what the firmware can do:
1012

1113
[<img alt="The Best HackRF Portapack Firmware Yet - Mayhem Version 2" src="https://img.youtube.com/vi/WZqCENz-YAg/maxresdefault.jpg" width="512">](https://www.youtube.com/watch?v=WZqCENz-YAg)
1214

15+
Mayhem Hub extends the functionality of your device by bringing it to your web browser.
16+
17+
## Features
18+
19+
- **Live Screen Streaming**: View your PortaPack's screen in real-time on your computer.
20+
- **Remote Control**: Interact with your device's screen and buttons directly from the web UI, including keyboard shortcuts.
21+
- **File Management**: Upload and download files to/from your device's SD card without removing it.
22+
- **One-Click Firmware Updates**: Easily update to the latest stable or nightly Mayhem firmware builds.
23+
- **Custom Firmware Flashing**: Flash `.tar` firmware files of your choice.
24+
- **Serial Console**: Access a full serial console for sending commands and viewing logs.
25+
- **Scripting**: Run `.ppsc` scripts on your device.
26+
- **PWA Support**: Installable as a desktop app for a native-like experience and offline access.
27+
- **Customizable UI**: Toggle visibility of different UI components to suit your workflow.
28+
29+
## Requirements
30+
31+
### Hardware & Firmware
32+
33+
- A **HackRF** with a **PortaPack**.
34+
- **Mayhem Firmware**: Ensure you are running at least stable version `v2.0.0` or nightly `n_240114` (or newer).
35+
- Your PortaPack must be in **normal mode** (not HackRF mode) to connect.
36+
37+
### Browser Support
38+
39+
This application relies on the **Web Serial API**, which is not supported by all browsers. For the best experience, please use a compatible browser like:
40+
41+
- Google Chrome
42+
- Microsoft Edge
43+
- Opera
44+
45+
You can check the latest browser compatibility on [caniuse.com/web-serial](https://caniuse.com/web-serial).
46+
47+
### Operating System Notes
48+
49+
- **macOS Users**: There are known issues with Web Serial on macOS. If you encounter problems, please check and contribute to the discussion [here](https://github.com/portapack-mayhem/MayhemHub/issues/43).
50+
51+
## Tech Stack
52+
53+
- [Next.js](https://nextjs.org/) - React Framework
54+
- [TypeScript](https://www.typescriptlang.org/) - Language
55+
- [Tailwind CSS](https://tailwindcss.com/) - CSS Framework
56+
- [DaisyUI](https://daisyui.com/) - Tailwind CSS Component Library
57+
- [Web Serial API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API) - Hardware Communication
58+
- [PWA](https://web.dev/progressive-web-apps/) - for app-like features and offline support
1359

1460
## Getting Started
1561

16-
First, install the dependencies
62+
Follow these steps to get a local copy up and running.
63+
64+
### Prerequisites
65+
66+
- [Node.js](https://nodejs.org/) (v18.17.0 or later)
67+
- npm, yarn, or pnpm
68+
69+
### Installation & Running
70+
71+
1. **Clone the repository:**
1772

1873
```bash
19-
npm i
74+
git clone https://github.com/portapack-mayhem/MayhemHub.git
75+
cd MayhemHub
2076
```
2177

22-
Then, run the development server:
78+
2. **Install dependencies:**
2379

2480
```bash
25-
npm run dev
26-
# or
27-
yarn dev
28-
# or
29-
pnpm dev
30-
# or
31-
bun dev
81+
npm install
3282
```
3383

34-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
84+
3. **Run the development server:**
85+
86+
```bash
87+
npm run dev
88+
```
89+
90+
You can also use `yarn dev`, `pnpm dev`, or `bun dev`.
91+
92+
4. Open [http://localhost:3000](http://localhost:3000) with a compatible browser to see the result.
93+
94+
### Other Scripts
95+
96+
- **Build for production:**
97+
98+
```bash
99+
npm run build
100+
```
101+
102+
- **Lint the project:**
103+
104+
```bash
105+
npm run lint
106+
```
107+
108+
## Cloudflare Development
109+
110+
To run the Cloudflare Functions locally for development, you can use Wrangler:
111+
112+
```bash
113+
npx wrangler pages dev public
114+
```
115+
116+
## Contributing
117+
118+
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
35119

36-
## Cloudflare
120+
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
37121

38-
To run the Cloudflare Functions locally you can run
39-
`npx wrangler pages dev public`
122+
1. Fork the Project
123+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
124+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
125+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
126+
5. Open a Pull Request

src/components/Console/Console.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Console: React.FC<IConsole> = ({
3232
return (
3333
<div className="flex h-full w-full flex-col items-center justify-center gap-1">
3434
<textarea
35-
className="h-full w-full rounded-md bg-component p-2 font-mono text-white"
35+
className="h-full w-full rounded-md bg-component p-2 font-mono text-white resize-none"
3636
readOnly
3737
value={consoleMessageList}
3838
id="serial_console"
@@ -90,4 +90,4 @@ export const Console: React.FC<IConsole> = ({
9090
);
9191
};
9292

93-
export default Console;
93+
export default Console;

src/components/Controller/Controller.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ const Controller = () => {
322322
write={write}
323323
/>
324324

325-
<div className="flex flex-col items-center justify-center rounded-md bg-opacity-20 bg-slate-800 p-3 backdrop-blur-sm">
326-
<p className="pb-4 text-white font-medium drop-shadow-[0_0_4px_rgba(255,255,255,0.4)]">Live Screen</p>
325+
<div className="flex flex-col items-center justify-center rounded-md bg-opacity-20 bg-slate-600 p-3 backdrop-blur-sm">
326+
<p className="pb-4 text-white font-medium drop-shadow-[0_0_4px_rgba(255,255,255,0.4)]">
327+
Live Screen
328+
</p>
327329
<div className="flex flex-row items-center justify-center gap-5">
328330
<ToggleSwitch
329331
isToggle={autoUpdateFrame}
@@ -340,7 +342,9 @@ const Controller = () => {
340342
write("screenframeshort", false);
341343
}
342344
}}
343-
className={"size-6 min-w-6 rounded-sm bg-slate-700 hover:bg-slate-600 text-white p-1 transition-colors duration-150 hover:drop-shadow-[0_0_4px_rgba(255,255,255,0.4)] flex items-center justify-center"}
345+
className={
346+
"size-6 min-w-6 rounded-sm bg-slate-700 hover:bg-slate-600 text-white p-1 transition-colors duration-150 hover:drop-shadow-[0_0_4px_rgba(255,255,255,0.4)] flex items-center justify-center"
347+
}
344348
shortcutKeys={"mod+R"}
345349
/>
346350
</div>

0 commit comments

Comments
 (0)