latest update
This commit is contained in:
1 parent
64eadfaf56
commit
2a562b99f1
25 files changed
+2617
-2337
No files matched your search
@@ -93,7 +93,7 @@
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
right: 8px;
|
||||
background: rgba(0,0,0,0.8);
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
color: white;
|
||||
padding: 3px 6px;
|
||||
border-radius: 4px;
|
||||
@@ -137,7 +137,8 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.yt-channel-name, .yt-video-meta {
|
||||
.yt-channel-name,
|
||||
.yt-video-meta {
|
||||
color: var(--text-secondary);
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
@@ -192,7 +193,9 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.yt-more-dropdown-item:hover { background: var(--border-color); }
|
||||
.yt-more-dropdown-item:hover {
|
||||
background: var(--border-color);
|
||||
}
|
||||
|
||||
/* Empty State */
|
||||
.yt-empty {
|
||||
@@ -247,8 +250,8 @@
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
MOBILE RESPONSIVE STYLES
|
||||
============================================ */
|
||||
MOBILE RESPONSIVE STYLES
|
||||
============================================ */
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.channel-header {
|
||||
@@ -289,7 +292,8 @@
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.yt-channel-name, .yt-video-meta {
|
||||
.yt-channel-name,
|
||||
.yt-video-meta {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -498,8 +502,13 @@
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% { background-position: 200% 0; }
|
||||
100% { background-position: -200% 0; }
|
||||
0% {
|
||||
background-position: 200% 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Mobile touch optimizations */
|
||||
@@ -518,7 +527,7 @@
|
||||
@section('content')
|
||||
<div class="channel-header">
|
||||
<div class="d-flex align-items-center gap-4 flex-wrap">
|
||||
@if($user->avatar)
|
||||
@if ($user->avatar)
|
||||
<img src="{{ asset('storage/avatars/' . $user->avatar) }}" alt="{{ $user->name }}" class="channel-avatar">
|
||||
@else
|
||||
<img src="https://i.pravatar.cc/150?u={{ $user->id }}" alt="{{ $user->name }}" class="channel-avatar">
|
||||
@@ -530,17 +539,18 @@
|
||||
|
||||
<div class="channel-stats">
|
||||
<div>
|
||||
<span class="channel-stat-value">{{ $videos->total() }}</span>
|
||||
<span class="channel-stat-value">{{ $videos->count() }}</span>
|
||||
<span class="channel-meta"> videos</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="channel-stat-value">{{ \DB::table('video_views')->whereIn('video_id', $user->videos->pluck('id'))->count() }}</span>
|
||||
<span
|
||||
class="channel-stat-value">{{ \DB::table('video_views')->whereIn('video_id', $user->videos->pluck('id'))->count() }}</span>
|
||||
<span class="channel-meta"> views</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@auth
|
||||
@if(Auth::user()->id === $user->id)
|
||||
@if (Auth::user()->id === $user->id)
|
||||
<div class="channel-actions">
|
||||
<a href="{{ route('videos.create') }}" class="yt-upload-btn">
|
||||
<i class="bi bi-plus-lg"></i> <span>Upload Video</span>
|
||||
@@ -557,30 +567,37 @@
|
||||
|
||||
<!-- Playlists Section - Only show for own channel -->
|
||||
@auth
|
||||
@if(Auth::user()->id === $user->id && $playlists && $playlists->count() > 0)
|
||||
@if (Auth::user()->id === $user->id && $playlists && $playlists->count() > 0)
|
||||
<div class="playlists-section" style="margin-bottom: 24px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;">
|
||||
<h2 style="font-size: 20px; font-weight: 500;">My Playlists</h2>
|
||||
<a href="{{ route('playlists.index') }}" style="color: var(--text-secondary); text-decoration: none; font-size: 14px;">
|
||||
<a href="{{ route('playlists.index') }}"
|
||||
style="color: var(--text-secondary); text-decoration: none; font-size: 14px;">
|
||||
View all <i class="bi bi-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;">
|
||||
@foreach($playlists->take(6) as $playlist)
|
||||
<a href="{{ route('playlists.show', $playlist->id) }}" class="playlist-card-mini" style="text-decoration: none; color: inherit;">
|
||||
<div class="playlist-thumb-mini" style="position: relative; aspect-ratio: 16/9; background: var(--bg-secondary); border-radius: 8px; overflow: hidden; margin-bottom: 8px;">
|
||||
@if($playlist->thumbnail_url)
|
||||
<img src="{{ $playlist->thumbnail_url }}" alt="{{ $playlist->name }}" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
@foreach ($playlists->take(6) as $playlist)
|
||||
<a href="{{ route('playlists.show', $playlist->id) }}" class="playlist-card-mini"
|
||||
style="text-decoration: none; color: inherit;">
|
||||
<div class="playlist-thumb-mini"
|
||||
style="position: relative; aspect-ratio: 16/9; background: var(--bg-secondary); border-radius: 8px; overflow: hidden; margin-bottom: 8px;">
|
||||
@if ($playlist->thumbnail_url)
|
||||
<img src="{{ $playlist->thumbnail_url }}" alt="{{ $playlist->name }}"
|
||||
style="width: 100%; height: 100%; object-fit: cover;">
|
||||
@else
|
||||
<div style="display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-secondary);">
|
||||
<div
|
||||
style="display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-secondary);">
|
||||
<i class="bi bi-collection-play" style="font-size: 32px;"></i>
|
||||
</div>
|
||||
@endif
|
||||
<span class="playlist-count" style="position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,0.8); color: white; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 500;">
|
||||
<span class="playlist-count"
|
||||
style="position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,0.8); color: white; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 500;">
|
||||
{{ $playlist->video_count }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="playlist-name-mini" style="font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||
<div class="playlist-name-mini"
|
||||
style="font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||
{{ $playlist->name }}
|
||||
</div>
|
||||
</a>
|
||||
@@ -590,13 +607,13 @@
|
||||
@endif
|
||||
@endauth
|
||||
|
||||
@if($videos->isEmpty())
|
||||
@if ($videos->isEmpty())
|
||||
<div class="yt-empty">
|
||||
<i class="bi bi-camera-video yt-empty-icon"></i>
|
||||
<h2 class="yt-empty-title">No videos yet</h2>
|
||||
<p class="yt-empty-text">This channel hasn't uploaded any videos.</p>
|
||||
@auth
|
||||
@if(Auth::user()->id === $user->id)
|
||||
@if (Auth::user()->id === $user->id)
|
||||
<a href="{{ route('videos.create') }}" class="yt-upload-btn">
|
||||
<i class="bi bi-plus-lg"></i> Upload First Video
|
||||
</a>
|
||||
@@ -605,167 +622,178 @@
|
||||
</div>
|
||||
@else
|
||||
<div class="yt-video-grid">
|
||||
@foreach($videos as $video)
|
||||
@foreach ($videos as $video)
|
||||
<x-video-card :video="$video" size="small" />
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="mt-4">{{ $videos->links() }}</div>
|
||||
{{-- Pagination hidden on all screens --}}
|
||||
@endif
|
||||
|
||||
@include('layouts.partials.share-modal')
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
let currentPlayingVideo = null;
|
||||
<script>
|
||||
let currentPlayingVideo = null;
|
||||
|
||||
function playVideo(card) {
|
||||
// Skip on touch devices - handled by touch events
|
||||
if ('ontouchstart' in window) return;
|
||||
function playVideo(card) {
|
||||
// Skip on touch devices - handled by touch events
|
||||
if ('ontouchstart' in window) return;
|
||||
|
||||
const video = card.querySelector('video');
|
||||
if (video) {
|
||||
video.currentTime = 0;
|
||||
video.volume = 0.10;
|
||||
video.play().catch(function(e) {
|
||||
// Auto-play may be blocked, ignore error
|
||||
});
|
||||
video.classList.add('active');
|
||||
currentPlayingVideo = card;
|
||||
}
|
||||
}
|
||||
|
||||
function stopVideo(card) {
|
||||
const video = card.querySelector('video');
|
||||
if (video) {
|
||||
video.pause();
|
||||
video.currentTime = 0;
|
||||
video.classList.remove('active');
|
||||
}
|
||||
}
|
||||
|
||||
// Desktop hover behavior
|
||||
document.querySelectorAll('.yt-video-card').forEach(function(card) {
|
||||
card.addEventListener('mouseenter', function() {
|
||||
playVideo(this);
|
||||
});
|
||||
card.addEventListener('mouseleave', function() {
|
||||
stopVideo(this);
|
||||
});
|
||||
});
|
||||
|
||||
// Mobile touch support with tap-to-play/pause
|
||||
document.addEventListener('touchstart', function(e) {
|
||||
const card = e.target.closest('.yt-video-card');
|
||||
if (card) {
|
||||
// Stop currently playing video if different
|
||||
if (currentPlayingVideo && currentPlayingVideo !== card) {
|
||||
stopVideo(currentPlayingVideo);
|
||||
}
|
||||
|
||||
const video = card.querySelector('video');
|
||||
if (video) {
|
||||
if (card.classList.contains('playing')) {
|
||||
// Pause this video
|
||||
video.pause();
|
||||
card.classList.remove('playing');
|
||||
} else {
|
||||
// Play this video
|
||||
const video = card.querySelector('video');
|
||||
if (video) {
|
||||
video.currentTime = 0;
|
||||
video.volume = 0.10;
|
||||
video.play().catch(function(e) {});
|
||||
video.play().catch(function(e) {
|
||||
// Auto-play may be blocked, ignore error
|
||||
});
|
||||
video.classList.add('active');
|
||||
card.classList.add('playing');
|
||||
currentPlayingVideo = card;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, { passive: true });
|
||||
|
||||
// Stop video when tapping outside
|
||||
document.addEventListener('touchstart', function(e) {
|
||||
if (!e.target.closest('.yt-video-card')) {
|
||||
if (currentPlayingVideo) {
|
||||
stopVideo(currentPlayingVideo);
|
||||
currentPlayingVideo.classList.remove('playing');
|
||||
currentPlayingVideo = null;
|
||||
function stopVideo(card) {
|
||||
const video = card.querySelector('video');
|
||||
if (video) {
|
||||
video.pause();
|
||||
video.currentTime = 0;
|
||||
video.classList.remove('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function deleteVideo(videoId, videoTitle) {
|
||||
if (confirm('Are you sure you want to delete "' + videoTitle + '"? This action cannot be undone.')) {
|
||||
fetch(`/videos/${videoId}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||
'Accept': 'application/json',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success || data.redirect) {
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert('Failed to delete video. Please try again.');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Failed to delete video. Please try again.');
|
||||
// Desktop hover behavior
|
||||
document.querySelectorAll('.yt-video-card').forEach(function(card) {
|
||||
card.addEventListener('mouseenter', function() {
|
||||
playVideo(this);
|
||||
});
|
||||
card.addEventListener('mouseleave', function() {
|
||||
stopVideo(this);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Smooth scroll for pagination on mobile
|
||||
document.querySelectorAll('.pagination a').forEach(function(link) {
|
||||
link.addEventListener('click', function(e) {
|
||||
// Add loading indicator
|
||||
document.querySelector('.yt-video-grid').style.opacity = '0.5';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
// Mobile touch support with tap-to-play/pause
|
||||
document.addEventListener('touchstart', function(e) {
|
||||
const card = e.target.closest('.yt-video-card');
|
||||
if (card) {
|
||||
// Stop currently playing video if different
|
||||
if (currentPlayingVideo && currentPlayingVideo !== card) {
|
||||
stopVideo(currentPlayingVideo);
|
||||
}
|
||||
|
||||
const video = card.querySelector('video');
|
||||
if (video) {
|
||||
if (card.classList.contains('playing')) {
|
||||
// Pause this video
|
||||
video.pause();
|
||||
card.classList.remove('playing');
|
||||
} else {
|
||||
// Play this video
|
||||
video.currentTime = 0;
|
||||
video.volume = 0.10;
|
||||
video.play().catch(function(e) {});
|
||||
video.classList.add('active');
|
||||
card.classList.add('playing');
|
||||
currentPlayingVideo = card;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
// Stop video when tapping outside
|
||||
document.addEventListener('touchstart', function(e) {
|
||||
if (!e.target.closest('.yt-video-card')) {
|
||||
if (currentPlayingVideo) {
|
||||
stopVideo(currentPlayingVideo);
|
||||
currentPlayingVideo.classList.remove('playing');
|
||||
currentPlayingVideo = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function deleteVideo(videoId, videoTitle) {
|
||||
if (confirm('Are you sure you want to delete "' + videoTitle + '"? This action cannot be undone.')) {
|
||||
fetch(`/videos/${videoId}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||
'Accept': 'application/json',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success || data.redirect) {
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert('Failed to delete video. Please try again.');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Failed to delete video. Please try again.');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Smooth scroll for pagination on mobile
|
||||
document.querySelectorAll('.pagination a').forEach(function(link) {
|
||||
link.addEventListener('click', function(e) {
|
||||
// Add loading indicator
|
||||
document.querySelector('.yt-video-grid').style.opacity = '0.5';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
||||
<!-- Extra Mobile Styles -->
|
||||
<style>
|
||||
@media (max-width: 480px) {
|
||||
.channel-header {
|
||||
padding: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
.channel-avatar {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
.channel-name {
|
||||
font-size: 18px;
|
||||
}
|
||||
.channel-stats {
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
}
|
||||
.channel-stat-value {
|
||||
font-size: 16px;
|
||||
}
|
||||
.yt-video-grid {
|
||||
gap: 16px;
|
||||
}
|
||||
.yt-video-thumb {
|
||||
border-radius: 8px;
|
||||
}
|
||||
.yt-video-info {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.yt-channel-icon {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.yt-video-title {
|
||||
font-size: 13px;
|
||||
}
|
||||
<!-- Extra Mobile Styles -->
|
||||
<style>
|
||||
@media (max-width: 480px) {
|
||||
.channel-header {
|
||||
padding: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
.channel-avatar {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.channel-name {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.channel-stats {
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.channel-stat-value {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.yt-video-grid {
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.yt-video-thumb {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.yt-video-info {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.yt-channel-icon {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.yt-video-title {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user