diff --git a/app/Livewire/Mailbox.php b/app/Livewire/Mailbox.php new file mode 100644 index 0000000..9a02873 --- /dev/null +++ b/app/Livewire/Mailbox.php @@ -0,0 +1,255 @@ + 1, 'address' => 'idevakk@imail.com', 'expires_at' => '23:59:12', 'progress' => 90], + ['id' => 2, 'address' => 'tester_99@devmail.ai', 'expires_at' => '45:12:05', 'progress' => 40], + ]; + + public $currentMailboxId = 1; + + public $activeFolder = 'inbox'; + + public $selectedEmailId = null; + + public $search = ''; + + public $page = 1; + + public $totalPages = 5; + + // Create State + public $showCreateModal = false; + + public $createType = 'random'; // random | custom + + public $customUsername = ''; + + public $customDomain = 'imail.com'; + + public $availableDomains = ['imail.com', 'devmail.ai', 'temp-inbox.net']; + + public function getEmailsProperty() + { + // Mock emails based on mailbox ID for demonstration + $emails = [ + 1 => [ + [ + 'id' => 1, + 'from_name' => 'GitHub Security', + 'from_email' => 'noreply@github.com', + 'subject' => '[GitHub] A new personal access token was created', + 'preview' => 'A new personal access token (classic) was recently added to your account.', + 'content' => '

Hi @idevakk,

A new personal access token (classic) was recently added to your account IDEVAKK.

If this was you, you can safely ignore this email.

If this was not you, please visit https://github.com/settings/tokens to revoke the token.

', + 'time' => '10:24 AM', + 'unread' => true, + 'flagged' => true, + 'attachments' => [], + ], + [ + 'id' => 101, + 'from_name' => 'Linear', + 'from_email' => 'updates@linear.app', + 'subject' => 'New issue assigned: [UI-124] Fix sidebar overflow', + 'preview' => 'You have been assigned to a new issue in the UI project. Please review the details...', + 'content' => '

Hello,

You have been assigned to [UI-124] Fix sidebar overflow in mobile view.

Priority: High

Project: Imail Revamp

View details at https://linear.app/imail/issue/UI-124

', + 'time' => '11:45 AM', + 'unread' => true, + 'flagged' => false, + 'attachments' => [], + ], + [ + 'id' => 102, + 'from_name' => 'Canva', + 'from_email' => 'design@canva.com', + 'subject' => 'Your design "Imail Presentation" is ready', + 'preview' => 'Collaborate with your team on your latest design for the Imail product launch.', + 'content' => '

Hey there!

Your team is waiting for your feedback on the Imail Presentation design.

Check the latest comments and approve the final version.

', + 'time' => '9:12 AM', + 'unread' => false, + 'flagged' => false, + 'attachments' => [ + ['name' => 'presentation_v1.pdf', 'size' => '4.2 MB'], + ], + ], + [ + 'id' => 103, + 'from_name' => 'Figma', + 'from_email' => 'notifications@figma.com', + 'subject' => 'Atul Kumar mentioned you in "Mobile App (Draft)"', + 'preview' => '"@idevakk take a look at the revised QR modal design, let me know if..."', + 'content' => '

Atul Kumar mentioned you in a comment on Mobile App (Draft):

"@idevakk take a look at the revised QR modal design, let me know if the proportions look right to you."

Reply in Figma or view the comment online.

', + 'time' => '8:30 AM', + 'unread' => false, + 'flagged' => true, + 'attachments' => [], + ], + ], + 2 => [ + [ + 'id' => 2, + 'from_name' => 'Stripe', + 'from_email' => 'support@stripe.com', + 'subject' => 'Your weekly payment report', + 'preview' => 'Your weekly report for the period of Feb 24 - Mar 2 is now available.', + 'content' => '

Hello,

Your weekly report for the period of Feb 24 - Mar 2 is now available in your dashboard.

Total Volume: $12,450.00

View the full report details online.

', + 'time' => 'Yesterday', + 'unread' => false, + 'flagged' => false, + 'attachments' => [ + ['name' => 'report_mar_02.pdf', 'size' => '1.2 MB'], + ], + ], + [ + 'id' => 201, + 'from_name' => 'Postmark', + 'from_email' => 'alerts@postmarkapp.com', + 'subject' => 'Outbound volume spike detected', + 'preview' => 'We noticed a sudden increase in outbound emails from your "Production" server.', + 'content' => '

Alert: Outbound volume spike.

Server: Production

We detected 5,000+ emails sent in the last hour. Please ensure this is expected activity.

', + 'time' => 'Yesterday', + 'unread' => true, + 'flagged' => false, + 'attachments' => [], + ], + [ + 'id' => 202, + 'from_name' => 'Vercel', + 'from_email' => 'deployments@vercel.com', + 'subject' => 'Team "idevakk" deployment successful', + 'preview' => 'Production deployment for the imail-frontend project has completed.', + 'content' => '

Your deployment is live!

Project: imail-frontend

Command: npm run build

View your deployment here: https://imail.app

', + 'time' => 'Mar 2', + 'unread' => false, + 'flagged' => false, + 'attachments' => [], + ], + ], + ]; + + return $emails[$this->currentMailboxId] ?? [ + [ + 'id' => 3, + 'from_name' => 'Slack', + 'from_email' => 'notifications@slack.com', + 'subject' => 'You have 12 unread messages from your team', + 'preview' => 'Atul Kumar: "Did you check the new API endpoints? We need them for..."', + 'content' => '

You have new activity in Slack.

', + 'time' => 'Mar 1', + 'unread' => true, + 'flagged' => false, + 'attachments' => [], + ], + [ + 'id' => 301, + 'from_name' => 'Zoom', + 'from_email' => 'no-reply@zoom.us', + 'subject' => 'Meeting Reminder: "Sprint Planning"', + 'preview' => 'Your Sprint Planning meeting is scheduled to start in 15 minutes.', + 'content' => '

Friendly reminder that your Sprint Planning call starts soon.

Link: https://zoom.us/j/123456789

', + 'time' => 'Feb 28', + 'unread' => false, + 'flagged' => false, + 'attachments' => [], + ], + ]; + } + + public function selectEmail($id) + { + $this->selectedEmailId = $id; + } + + public function switchMailbox($id) + { + $this->currentMailboxId = $id; + $this->selectedEmailId = null; + $this->search = ''; + } + + public function createMailbox() + { + $newAddress = $this->createType === 'random' + ? fake()->userName().'_'.rand(10, 99).'@'.$this->availableDomains[array_rand($this->availableDomains)] + : $this->customUsername.'@'.$this->customDomain; + + $newId = count($this->activeMailboxes) + 1; + $this->activeMailboxes[] = [ + 'id' => $newId, + 'address' => $newAddress, + 'expires_at' => '24:00:00', + 'progress' => 100, + ]; + + $this->currentMailboxId = $newId; + $this->showCreateModal = false; + $this->customUsername = ''; + } + + public function deleteMailbox($id) + { + $this->activeMailboxes = array_filter($this->activeMailboxes, fn ($m) => $m['id'] !== $id); + + if ($this->currentMailboxId === $id) { + $this->currentMailboxId = count($this->activeMailboxes) > 0 ? reset($this->activeMailboxes)['id'] : null; + $this->selectedEmailId = null; + } + } + + public function downloadEmail($id) + { + // Mock download logic + $this->js("alert('Downloading email #{$id}... (Mock Action)')"); + } + + public function printEmail($id) + { + // Mock print logic + $this->js('window.print()'); + } + + public function deleteEmail($id) + { + // Mock delete logic + $this->js("alert('Email #{$id} deleted successfully! (Mock Action)')"); + $this->selectedEmailId = null; + } + + public function nextPage() + { + if ($this->page < $this->totalPages) { + $this->page++; + } + } + + public function previousPage() + { + if ($this->page > 1) { + $this->page--; + } + } + + public function generateQrCode($address) + { + // Mock QR generation with a slight delay + usleep(800000); // 800ms + $this->dispatch('qrCodeGenerated', address: $address); + } + + public function render() + { + $currentMailbox = collect($this->activeMailboxes)->firstWhere('id', $this->currentMailboxId); + + return view('livewire.mailbox', [ + 'emails' => $this->getEmailsProperty(), + 'currentMailbox' => $currentMailbox, + ]); + } +} diff --git a/resources/views/components/bento/hero.blade.php b/resources/views/components/bento/hero.blade.php index aa1d39f..47aa40b 100644 --- a/resources/views/components/bento/hero.blade.php +++ b/resources/views/components/bento/hero.blade.php @@ -25,14 +25,14 @@

- + Imail in 100 seconds diff --git a/resources/views/components/bento/nav.blade.php b/resources/views/components/bento/nav.blade.php index e88ce3f..5c89da3 100644 --- a/resources/views/components/bento/nav.blade.php +++ b/resources/views/components/bento/nav.blade.php @@ -29,7 +29,7 @@
- + diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php index 3d15107..b79f068 100644 --- a/resources/views/components/layouts/app.blade.php +++ b/resources/views/components/layouts/app.blade.php @@ -1,5 +1,95 @@ - - + + + + + + {{ $title ?? 'Mailbox — Imail' }} + + + + + + + @vite(['resources/css/app.css', 'resources/js/app.js']) + + + + + + + + + {{ $slot }} - - + + +
+ +
+ + + + + diff --git a/resources/views/livewire/mailbox.blade.php b/resources/views/livewire/mailbox.blade.php new file mode 100644 index 0000000..804a87c --- /dev/null +++ b/resources/views/livewire/mailbox.blade.php @@ -0,0 +1,600 @@ +
+ + +
+ + +
+ + +
+ + +
+ + + +
+ + +
+ +
+ + +
+ @foreach($emails as $email) +
+ +
+ +
+
+ @if($email['unread']) +
+ @endif +

+ {{ $email['from_name'] }} +

+
+ {{ $email['time'] }} +
+ +
+ {{ $email['subject'] }} +
+ +

+ {{ $email['preview'] }} +

+ + @if(count($email['attachments']) > 0) +
+
+ + {{ $email['attachments'][0]['name'] }} +
+
+ @endif +
+ @endforeach +
+ + +
+ + +
+ {{ $page }} + / + {{ $totalPages }} +
+ + +
+
+ +
+
+ +
+ + +
+ +
+
+ + + +
+ +

Mailbox QR

+

Scan to access

+ +
+ +
+ +
+ + +
+
+
+ + +
+ + @php $currentEmail = $selectedEmailId ? collect($emails)->firstWhere('id', $selectedEmailId) : null; @endphp + @if($currentEmail) + + +
+ +
+
+ + +
+
+ +
+
+ + +
+
+
+
+
+ {{ substr($currentEmail['from_name'], 0, 1) }} +
+
+

{{ $currentEmail['from_name'] }}

+
{{ $currentEmail['from_email'] }}
+
+
+
+ Received {{ $currentEmail['time'] }} +
+
+ +

+ {{ $currentEmail['subject'] }} +

+ +
+ {!! $currentEmail['content'] !!} +
+ + @if(count($currentEmail['attachments']) > 0) +
+

Attachments ({{ count($currentEmail['attachments']) }})

+ +
+
+ @foreach($currentEmail['attachments'] as $attachment) +
+
+
+ +
+
+
{{ $attachment['name'] }}
+
{{ $attachment['size'] }}
+
+
+ @auth + + @endauth +
+ @endforeach +
+ + @guest + + @endguest +
+
+ @endif +
+
+ @else + +
+
+
+ +
+

Select an email to read

+

Choose one of your disposable emails from the list to view its full content and secure attachments.

+
+ @endif +
+ + + + +
diff --git a/routes/web.php b/routes/web.php index c990de9..55ee520 100644 --- a/routes/web.php +++ b/routes/web.php @@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Route; use Laravel\Fortify\Features; Route::get('/', \App\Livewire\LandingPage::class)->name('home'); +Route::get('/mailbox', \App\Livewire\Mailbox::class)->name('mailbox'); Route::get('/privacy-policy', \App\Livewire\PrivacyPolicy::class)->name('privacy'); Route::view('dashboard', 'dashboard')