images are now expanded when you click on them

This commit is contained in:
Ghostie 2025-01-08 21:04:36 -05:00
parent 2c6d0b4404
commit 3d5b146467
7 changed files with 30 additions and 8 deletions

View File

@ -63,7 +63,7 @@
- [x] Fix that weird json encoding in the object field of an activity
- [x] The profile attachments are not working, they are not being federalised somehow (the interests thingy)
- [x] Endpoints for getting notes (/ap/v1/note/{note})
- [ ] Fix hashtags on post update
- [ ] Fix hashtags and mentions on post update
- [x] Use jobs when posting activities
- [ ] Sign the get activities for mastodon when secure mode is enable
- [x] Set a minimum font size for the tags cloud

View File

@ -93,8 +93,8 @@ class HomeController extends Controller
}
}
$local_users = User::where ("name", "like", "%$query%")->orderBy ("created_at", "desc")->get ();
$actors = Actor::where ("name", "like", "%$query%")->orWhere ("preferredUsername", "like", "%$query%")->orderBy ("created_at", "desc")->get ();
$local_users = User::where ("name", "like", "%$query%")->orWhere ("summary", "like", "%$query%")->orderBy ("created_at", "desc")->get ();
$actors = Actor::where ("name", "like", "%$query%")->orWhere ("preferredUsername", "like", "%$query%")->orWhere ("summary", "like", "%$query%")->orderBy ("created_at", "desc")->get ();
$users = $local_users->merge ($actors)->take (10);
$hashtags = Hashtag::withCount ("get_notes")->where ("name", "like", "%$query%")->orderBy ("get_notes_count", "desc")->take (16)->get ()->shuffle ();

View File

@ -84,7 +84,7 @@ class ProfileController extends Controller
$image_data = $image->cover (256, 256)->toJpeg ();
Storage::disk ("public")->put ("avatars/" . $fname . ".jpg", $image_data);
$old_avatar = $user->avatar;
$old_avatar = "avatars/" . $user->avatar;
$user->avatar = $fname . ".jpg";
$user->actor->icon = env ("APP_URL") . $user->avatar;
@ -97,7 +97,7 @@ class ProfileController extends Controller
$file = $request->file ("song");
Storage::disk ("public")->put ("songs/" . $fname . ".mp3", file_get_contents ($file));
$old_song = $user->profile_song;
$old_song = "songs/" . $user->profile_song;
$user->profile_song = $fname . ".mp3";
$changing_song = true;
}

View File

@ -3787,3 +3787,11 @@ ul.cloud a {
color: #99c3e0; /* Muted blue for disabled links */
cursor: not-allowed;
}
img.expandable {
cursor: pointer;
}
img.expanded {
width: 100%;
}

View File

@ -1,4 +1,17 @@
import axios from 'axios';
/* import axios from 'axios';
window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
*/
(function () {
let elements = document.querySelectorAll(".expandable")
for (let i = 0; i < elements.length; i++)
{
let element = elements [i]
element.addEventListener("click", function () {
this.classList.toggle("expanded")
})
}
})()

View File

@ -71,7 +71,7 @@ else
<p>
@foreach ($display_post->attachments as $attachment)
<img loading="lazy" src="{{ $attachment->url }}" alt="{{ $attachment->name }}" width="100">
<img loading="lazy" src="{{ $attachment->url }}" alt="{{ $attachment->name }}" width="100" class="expandable">
@endforeach
</p>
@ -87,7 +87,7 @@ else
<p>
@foreach ($reply->attachments as $attachment)
<img loading="lazy" src="{{ $attachment->url }}" alt="{{ $attachment->name }}" width="100">
<img loading="lazy" src="{{ $attachment->url }}" alt="{{ $attachment->name }}" width="100" class="expandable">
@endforeach
</p>

View File

@ -40,5 +40,6 @@
@include ("partials.footer")
</div>
@vite(["resources/js/app.js"])
</body>
</html>