made the video cards components

This commit is contained in:
ghassan committed 2026-03-02 02:16:28 +03:00
1 parent 3aa49d638d
commit 72e9439727
16 files changed
+3973 -250

No files matched your search

+30
View File
@@ -302,6 +302,36 @@
</div>
</div>
<div class="form-group">
<label class="form-label">Video Type</label>
<div class="visibility-options">
<label class="visibility-option active">
<input type="radio" name="type" value="generic" checked>
<div class="visibility-content">
<i class="bi bi-film"></i>
<span class="visibility-title">Generic</span>
<span class="visibility-desc">Standard video</span>
</div>
</label>
<label class="visibility-option">
<input type="radio" name="type" value="music">
<div class="visibility-content">
<i class="bi bi-music-note"></i>
<span class="visibility-title">Music</span>
<span class="visibility-desc">Music video or song</span>
</div>
</label>
<label class="visibility-option">
<input type="radio" name="type" value="match">
<div class="visibility-content">
<i class="bi bi-trophy"></i>
<span class="visibility-title">Match</span>
<span class="visibility-desc">Sports match or competition</span>
</div>
</label>
</div>
</div>
<div class="form-group">
<label class="form-label">Privacy</label>
<div class="visibility-options">
+1 -86
View File
@@ -230,92 +230,7 @@
@else
<div class="yt-video-grid">
@foreach($videos as $video)
<div class="yt-video-card"
data-video-url="{{ asset('storage/videos/' . $video->filename) }}"
onmouseenter="playVideo(this)"
onmouseleave="stopVideo(this)">
<a href="{{ route('videos.show', $video->id) }}">
<div class="yt-video-thumb">
@if($video->thumbnail)
<img src="{{ asset('storage/thumbnails/' . $video->thumbnail) }}" alt="{{ $video->title }}">
@else
<img src="https://picsum.photos/seed/{{ $video->id }}/640/360" alt="{{ $video->title }}">
@endif
<video preload="none">
<source src="{{ asset('storage/videos/' . $video->filename) }}" type="{{ $video->mime_type ?? 'video/mp4' }}">
</video>
@if($video->duration)
<span class="yt-video-duration">{{ gmdate('i:s', $video->duration) }}</span>
@endif
</div>
</a>
<div class="yt-video-info">
<div class="yt-channel-icon">
@if($video->user && $video->user->avatar_url)
<img src="{{ $video->user->avatar_url }}" alt="{{ $video->user->name }}" style="width: 100%; height: 100%; object-fit: cover; border-radius: 50%;">
@endif
</div>
<div class="yt-video-details">
<h3 class="yt-video-title">
<a href="{{ route('videos.show', $video->id) }}">{{ $video->title }}</a>
</h3>
<div class="yt-channel-name">{{ $video->user->name ?? 'Unknown' }}</div>
<div class="yt-video-meta">
{{ number_format($video->size / 1024 / 1024, 0) }} MB • {{ $video->created_at->diffForHumans() }}
</div>
</div>
<div class="position-relative">
<button class="yt-more-btn" data-bs-toggle="dropdown">
<i class="bi bi-three-dots-vertical"></i>
</button>
<ul class="dropdown-menu dropdown-menu-dark yt-more-dropdown dropdown-menu-end">
<li>
<button class="yt-more-dropdown-item" onclick="addToQueue('{{ $video->id }}')">
<i class="bi bi-list-nested"></i> Add to queue
</button>
</li>
<li>
<button class="yt-more-dropdown-item" onclick="saveToWatchLater('{{ $video->id }}')">
<i class="bi bi-clock"></i> Save to Watch later
</button>
</li>
<li>
<button class="yt-more-dropdown-item" onclick="openPlaylistModal('{{ $video->id }}')">
<i class="bi bi-bookmark"></i> Save to playlist
</button>
</li>
<li>
<a class="yt-more-dropdown-item" href="{{ route('videos.download', $video->id) }}">
<i class="bi bi-download"></i> Download
</a>
</li>
@if($video->isShareable())
<li>
<button class="yt-more-dropdown-item" onclick="openShareModal('{{ $video->share_url }}', '{{ addslashes($video->title) }}')">
<i class="bi bi-share"></i> Share
</button>
</li>
@endif
<li><hr class="dropdown-divider"></li>
<li>
<button class="yt-more-dropdown-item" onclick="notInterested('{{ $video->id }}')">
<i class="bi bi-dash-circle"></i> Not interested
</button>
</li>
<li>
<button class="yt-more-dropdown-item" onclick="dontRecommendChannel('{{ $video->user_id }}')">
<i class="bi bi-x-circle"></i> Don't recommend channel
</button>
</li>
<li>
<button class="yt-more-dropdown-item" onclick="reportVideo('{{ $video->id }}')">
<i class="bi bi-flag"></i> Report
</button>
</li>
</ul>
</div>
</div>
</div>
<x-video-card :video="$video" />
@endforeach
</div>
+3 -1
View File
@@ -246,8 +246,10 @@
@endsection
@section('content')
<!-- Video Layout Container -->
<div class="video-layout-container" style="display: flex; gap: 24px; max-width: 1800px; margin: 0 auto;">
<!-- Video Section -->
<div class="yt-video-section">
<!-- Video Player -->
@@ -328,6 +330,7 @@
<!-- Placeholder for recommended videos - would be dynamic in full implementation -->
<div class="text-secondary">More videos coming soon...</div>
</div>
</div>
@include('layouts.partials.share-modal')
@@ -368,4 +371,3 @@
});
</script>
@endsection
-1
View File
@@ -1 +0,0 @@
test
@@ -0,0 +1,123 @@
<!-- Video Layout Container -->
<div class="video-layout-container" style="display: flex; gap: 24px; max-width: 1800px; margin: 0 auto;">
<!-- Video Section -->
<div class="yt-video-section">
<!-- Video Player -->
<div class="video-container @if($video->orientation === 'portrait') portrait @elseif($video->orientation === 'square') square @elseif($video->orientation === 'ultrawide') ultrawide @endif" id="videoContainer">
<video id="videoPlayer" controls playsinline preload="metadata" autoplay>
<source src="{{ route('videos.stream', $video->id) }}" type="video/mp4">
</video>
</div>
<!-- Video Title -->
<h1 class="video-title">{{ $video->title }}</h1>
<!-- Stats Row -->
<div class="video-stats-row">
<div class="video-stats-left">
<span>{{ number_format($video->size / 1024 / 1024, 0) }} MB</span>
<span>•</span>
<span>{{ $video->created_at->format('M d, Y') }}</span>
@if($video->width && $video->height)
<span>•</span>
<span>{{ $video->width }}x{{ $video->height }}</span>
@endif
</div>
<div class="video-actions">
@auth
<!-- Like Button -->
<form method="POST" action="{{ $video->isLikedBy(Auth::user()) ? route('videos.unlike', $video->id) : route('videos.like', $video->id) }}" class="d-inline">
@csrf
<button type="submit" class="yt-action-btn {{ $video->isLikedBy(Auth::user()) ? 'liked' : '' }}">
<i class="bi {{ $video->isLikedBy(Auth::user()) ? 'bi-hand-thumbs-up-fill' : 'bi-hand-thumbs-up' }}"></i>
{{ $video->like_count > 0 ? $video->like_count : 'Like' }}
</button>
</form>
<!-- Edit Button - Only for video owner -->
@if(Auth::id() === $video->user_id)
<button class="yt-action-btn" onclick="openEditVideoModal({{ $video->id }})">
<i class="bi bi-pencil"></i> Edit
</button>
@endif
@else
<a href="{{ route('login') }}" class="yt-action-btn">
<i class="bi bi-hand-thumbs-up"></i> Like
</a>
@endauth
@if($video->isShareable())
<button class="yt-action-btn" onclick="openShareModal('{{ $video->share_url }}', '{{ addslashes($video->title) }}')"><i class="bi bi-share"></i> Share</button>
@endif
</div>
</div>
<!-- Channel Row -->
<div class="channel-row">
<a href="{{ route('channel', $video->user_id) }}" class="channel-info text-decoration-none" style="color: inherit;">
@if($video->user)
<img src="{{ $video->user->avatar_url }}" class="channel-avatar" alt="{{ $video->user->name }}">
@else
<div class="channel-avatar"></div>
@endif
<div>
<div class="channel-name">{{ $video->user->name ?? 'Unknown' }}</div>
<div class="channel-subs">Video Creator</div>
</div>
</a>
</div>
<!-- Description -->
@if($video->description)
<div class="video-description">
<p class="description-text">{{ $video->description }}</p>
</div>
@endif
</div>
<!-- Sidebar -->
<div class="yt-sidebar-container">
<h3 style="font-size: 16px; font-weight: 500; margin-bottom: 12px;">Up Next</h3>
<!-- Placeholder for recommended videos - would be dynamic in full implementation -->
<div class="text-secondary">More videos coming soon...</div>
</div>
</div>
@include('layouts.partials.share-modal')
@include('layouts.partials.edit-video-modal')
@if(Session::has('openEditModal') && Session::get('openEditModal'))
@auth
<script>
document.addEventListener('DOMContentLoaded', function() {
// Auto-open edit modal when redirected from /videos/{id}/edit
openEditVideoModal({{ $video->id }});
});
</script>
@endauth
@endif
<script>
// Auto-play video with sound when page loads
document.addEventListener('DOMContentLoaded', function() {
var videoPlayer = document.getElementById('videoPlayer');
if (videoPlayer) {
// Set volume to 50%
videoPlayer.volume = 0.5;
// Try to autoplay with sound
var playPromise = videoPlayer.play();
if (playPromise !== undefined) {
playPromise.then(function() {
// Autoplay started successfully
console.log('Video autoplayed with sound at 50% volume');
}).catch(function(error) {
// Autoplay was prevented
console.log('Autoplay blocked');
});
}
}
});
</script>
File diff suppressed because it is too large. Load diff
Whitespace-only changes.