summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/js/app.js15
-rw-r--r--resources/views/dashboard.blade.php88
-rwxr-xr-xresources/views/home.blade.php2
-rw-r--r--resources/views/marked.blade.php5
-rwxr-xr-xresources/views/template.blade.php6
-rw-r--r--resources/views/writings/create.blade.php1
6 files changed, 20 insertions, 97 deletions
diff --git a/resources/js/app.js b/resources/js/app.js
new file mode 100644
index 0000000..f0fa127
--- /dev/null
+++ b/resources/js/app.js
@@ -0,0 +1,15 @@
+import htmx from 'htmx.org';
+import axios from 'axios';
+import jQuery from 'jquery';
+
+// Expose globally so inline scripts and Blade templates can use them
+window.htmx = htmx;
+window.axios = axios;
+window.$ = jQuery;
+window.jQuery = jQuery;
+
+// Set axios CSRF header from meta tag
+const token = document.querySelector('meta[name="csrf-token"]');
+if (token) {
+ axios.defaults.headers.common['X-CSRF-TOKEN'] = token.getAttribute('content');
+}
diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php
index e73bb2a..e460bde 100644
--- a/resources/views/dashboard.blade.php
+++ b/resources/views/dashboard.blade.php
@@ -163,36 +163,6 @@
<main>
<h1>Dashboard</h1>
- @php
- $user = Auth::user();
-
- // Storage stats
- $usedStorage = $user->getStorageUsed();
- $totalStorage = $user->storage_quota;
- $storagePercent = $totalStorage > 0 ? min(100, round(($usedStorage / $totalStorage) * 100)) : 0;
-
- // File stats
- #$fileCount = $user->files()->count();
- $fileCount = 0;
- #TODO later cause need to change the DB schema
- #$recentFiles = $user->files()->orderBy('created_at', 'desc')->take(3)->get();
- $recentFiles = [];
- // Writing stats
- $writingCount = $user->writings()->count();
- $recentWritings = $user->writings()->orderBy('created_at', 'desc')->take(3)->get();
-
- // Quest stats (if implemented)
- $questCount = method_exists($user, 'quests') ? $user->quests()->count() : 0;
- $activeQuests = method_exists($user, 'quests') ? $user->quests()
- ->wherePivot('status', 'in_progress')
- ->orderBy('created_at', 'desc')
- ->take(3)
- ->get() : collect();
-
- // Inventory stats (placeholder)
- $inventoryCount = 0; // Update when inventory is implemented
- @endphp
-
<!-- Profile Overview -->
<div class="dashboard-card" style="margin-bottom: 20px;">
<div class="avatar-container">
@@ -218,14 +188,6 @@
<div class="stat-number">{{ $writingCount }}</div>
<div class="stat-label">Writings</div>
</div>
- <div class="stat-item">
- <div class="stat-number">{{ $questCount }}</div>
- <div class="stat-label">Quests</div>
- </div>
- <div class="stat-item">
- <div class="stat-number">{{ $inventoryCount }}</div>
- <div class="stat-label">Items</div>
- </div>
</div>
<div class="dashboard-container">
@@ -281,56 +243,6 @@
<a href="{{ route('w.index') }}">All Writings →</a>
</div>
</div>
-
- <!-- Quests Card -->
- <div class="dashboard-card">
- <h2>Quests</h2>
-
- @if(method_exists($user, 'quests') && $activeQuests->count() > 0)
- <ul class="item-list">
- @foreach($activeQuests as $quest)
- <li>
- <div>
- <a href="{{ route('quests.show', $quest->id) }}">{{ Str::limit($quest->title, 35) }}</a>
- <div style="font-size: 0.8rem; color: #666;">
- Progress: {{ $quest->pivot->progress }}%
- </div>
- <div class="progress-bar" style="margin: 5px 0; height: 6px;">
- <div class="progress-fill" style="width: {{ $quest->pivot->progress }}%; background-color: #00a86b;"></div>
- </div>
- <div style="font-size: 0.8rem; color: #666;">
- <span class="badge badge-{{ $quest->difficulty == 'easy' ? 'success' : ($quest->difficulty == 'hard' ? 'warning' : 'primary') }}">
- {{ ucfirst($quest->difficulty) }}
- </span>
- {{ $quest->reward_points }} points
- </div>
- </div>
- </li>
- @endforeach
- </ul>
- @else
- <div class="empty-state">No active quests</div>
- @endif
-
- <div class="dashboard-card-footer">
- @if(method_exists($user, 'quests'))
- <a href="{{ route('quests.index') }}">View Quests →</a>
- @else
- <span style="color: #999;">Coming soon</span>
- @endif
- </div>
- </div>
-
- <!-- Inventory Card (Placeholder) -->
- <div class="dashboard-card">
- <h2>Inventory</h2>
-
- <div class="empty-state">Inventory system coming soon</div>
-
- <div class="dashboard-card-footer">
- <span style="color: #999;">Under development</span>
- </div>
- </div>
</div>
<!-- Tags Used -->
diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php
index c905d8f..c993212 100755
--- a/resources/views/home.blade.php
+++ b/resources/views/home.blade.php
@@ -70,7 +70,7 @@ UNDER CONSTRUCTION; APOLOGIES FOR LACKING FUNCTIONALITY.
</div>
</section>
<footer>
- <p>Last updated February 14th, 2026</p>
+ <p>Last updated March 6th, 2026</p>
</footer>
@endsection
</html>
diff --git a/resources/views/marked.blade.php b/resources/views/marked.blade.php
index 8208ac7..f1deefc 100644
--- a/resources/views/marked.blade.php
+++ b/resources/views/marked.blade.php
@@ -7,10 +7,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--<link rel="stylesheet" type="text/css" href="static/reset.css">-->
<link rel="stylesheet" type="text/css" href="style.css">
- <script src="https://unpkg.com/htmx.org@2.0.1"></script>
- <script src = "https://code.jquery.com/jquery-3.7.1.min.js"></script>
+ @vite('resources/js/app.js')
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
- @vite('resources/js/marked.js')
+ <script src="/js/marked.js"></script>
<!--<base href = "http://192.168.4.32:9002/">-->
<!--<base href = "http://localhost:9002/">-->
<title>markup playground</title>
diff --git a/resources/views/template.blade.php b/resources/views/template.blade.php
index 4305656..09c7389 100755
--- a/resources/views/template.blade.php
+++ b/resources/views/template.blade.php
@@ -30,9 +30,7 @@
<footer>
</footer>
</main>
+ @vite('resources/js/app.js')
+ @yield('scripts')
</body>
-<script src="https://unpkg.com/htmx.org@2.0.1"></script>
-<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
-<script src = "https://code.jquery.com/jquery-3.7.1.min.js"></script>
-@yield('scripts')
</html> \ No newline at end of file
diff --git a/resources/views/writings/create.blade.php b/resources/views/writings/create.blade.php
index 54b5deb..86264b9 100644
--- a/resources/views/writings/create.blade.php
+++ b/resources/views/writings/create.blade.php
@@ -2,7 +2,6 @@
@section('head')
<meta charset="UTF-8">
-<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script type = "module" src = "/js/writing_create.js"></script>
<link rel="stylesheet" href="/css/style.css">