Files
hstream/resources/views/modals/partials/download-subtitles.blade.php
2025-09-18 15:31:27 +02:00

35 lines
1.8 KiB
PHP

<br>
<p class="font-bold text-gray-800 dark:text-gray-200">
<i class="fa-solid fa-lock-open pr-[4px] text-green-400"></i> Subtitles
</p>
<div class="flex flex-wrap justify-around">
@php
$subtitles = collect([['English' => 'eng']])
->merge($episode->subtitles->map(fn($sub) => [
$sub->subtitle->name => 'autotrans/' . $sub->subtitle->slug,
]))
->toArray();
$streamDomains = config('hstream.stream_domain');
@endphp
@foreach($subtitles as $subtitle)
@foreach ($subtitle as $language => $value)
<a href="{{ $streamDomains[array_rand($streamDomains)] }}/{{ $episode->url }}/{{ $value }}.ass" download="{{ $episode->slug }}-{{ $language }}.ass">
<button class="group rounded-md shadow bg-rose-600 text-white cursor-pointer flex justify-between items-center overflow-hidden transition-all hover:glow m-1 w-[180px]">
<div class="relative w-12 h-12 bg-white bg-opacity-20 text-white flex justify-center items-center transition-all"><svg id="arrow" class="w-4 h-4 transition-all group-hover:-translate-y-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
</svg>
<div id="progress" class="absolute w-full h-0 bg-white bg-opacity-20 top-0 duration-200"></div>
</div>
<div class="w-32 text-center">
<p class="px-5 text-sm row-span-2">{{ $language }}</p>
@if ($language != 'English')
<p class="px-5 text-xs">Auto Translated</p>
@endif
</div>
</button>
</a>
@endforeach
@endforeach
</div>