Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 497a3a74cd | |||
| 101460cd47 |
48
assets/controllers/hamburger_controller.js
Normal file
48
assets/controllers/hamburger_controller.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { Controller } from '@hotwired/stimulus';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following line makes this controller "lazy": it won't be downloaded until needed
|
||||||
|
* See https://symfony.com/bundles/StimulusBundle/current/index.html#lazy-stimulus-controllers
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* stimulusFetch: 'lazy' */
|
||||||
|
export default class extends Controller {
|
||||||
|
static outlets = ['navbar']
|
||||||
|
|
||||||
|
initialize() {
|
||||||
|
// Called once when the controller is first instantiated (per element)
|
||||||
|
|
||||||
|
// Here you can initialize variables, create scoped callables for event
|
||||||
|
// listeners, instantiate external libraries, etc.
|
||||||
|
// this._fooBar = this.fooBar.bind(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
connect() {
|
||||||
|
// Called every time the controller is connected to the DOM
|
||||||
|
// (on page load, when it's added to the DOM, moved in the DOM, etc.)
|
||||||
|
|
||||||
|
// Here you can add event listeners on the element or target elements,
|
||||||
|
// add or remove classes, attributes, dispatch custom events, etc.
|
||||||
|
// this.fooTarget.addEventListener('click', this._fooBar)
|
||||||
|
}
|
||||||
|
|
||||||
|
navbarOutletConnected(outlet) {
|
||||||
|
console.log(outlet)
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleMenu() {
|
||||||
|
console.log(this.navbarOutlet);
|
||||||
|
this.navbarOutlet.toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add custom controller actions here
|
||||||
|
// fooBar() { this.fooTarget.classList.toggle(this.bazClass) }
|
||||||
|
|
||||||
|
disconnect() {
|
||||||
|
// Called anytime its element is disconnected from the DOM
|
||||||
|
// (on page change, when it's removed from or moved in the DOM, etc.)
|
||||||
|
|
||||||
|
// Here you should remove all event listeners added in "connect()"
|
||||||
|
// this.fooTarget.removeEventListener('click', this._fooBar)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,9 +17,15 @@ export default class extends Controller {
|
|||||||
link.className = this.activeStyles;
|
link.className = this.activeStyles;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener("resize", (event) => {
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setActive() {
|
toggle() {
|
||||||
|
this.element.parentElement.classList.toggle('hidden');
|
||||||
|
this.element.classList.toggle('fixed');
|
||||||
|
this.element.classList.toggle('z-20');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ dialog[data-dialog-target="dialog"][closing] {
|
|||||||
|
|
||||||
.options-table {
|
.options-table {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 768px) {
|
@media screen and (min-width: 768px) {
|
||||||
|
|||||||
@@ -40,4 +40,11 @@ return [
|
|||||||
'stimulus-use' => [
|
'stimulus-use' => [
|
||||||
'version' => '0.52.2',
|
'version' => '0.52.2',
|
||||||
],
|
],
|
||||||
|
'animate.css' => [
|
||||||
|
'version' => '4.1.1',
|
||||||
|
],
|
||||||
|
'animate.css/animate.min.css' => [
|
||||||
|
'version' => '4.1.1',
|
||||||
|
'type' => 'css',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -13,7 +13,11 @@
|
|||||||
<twig:ux:icon name="material-symbols:logout" width="25px" class="text-orange-500" />
|
<twig:ux:icon name="material-symbols:logout" width="25px" class="text-orange-500" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="md:hidden">
|
<li {{ stimulus_controller('hamburger') }}
|
||||||
|
{{ stimulus_action('hamburger', 'toggleMenu', 'click') }}
|
||||||
|
data-hamburger-navbar-outlet="#navbar"
|
||||||
|
id="hamburger" class="cursor-pointer md:hidden"
|
||||||
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="text-orange-500 ml-4" width="25px" height="25px" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M0 3.75A.75.75 0 0 1 .75 3h14.5a.75.75 0 0 1 0 1.5H.75A.75.75 0 0 1 0 3.75M0 8a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H.75A.75.75 0 0 1 0 8m.75 3.5a.75.75 0 0 0 0 1.5h14.5a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="text-orange-500 ml-4" width="25px" height="25px" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M0 3.75A.75.75 0 0 1 .75 3h14.5a.75.75 0 0 1 0 1.5H.75A.75.75 0 0 1 0 3.75M0 8a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H.75A.75.75 0 0 1 0 8m.75 3.5a.75.75 0 0 0 0 1.5h14.5a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/></svg>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<nav {{ attributes }} {{ stimulus_controller('navbar') }} {{ stimulus_action('navbar', 'setActive')}} class="flex h-screen flex-col justify-between bg-cyan-950">
|
<nav id="navbar" {{ attributes }} {{ stimulus_controller('navbar') }} {{ stimulus_action('navbar', 'setActive')}} class="flex h-screen flex-col justify-between bg-cyan-950 animate__animated animate__slideInLeft animate__slow">
|
||||||
<div class="px-4 py-4 flex flex-col gap-12">
|
<div class="px-4 py-4 flex flex-col gap-12">
|
||||||
<h1 class="text-3xl font-extrabold text-orange-500 mb-3">Torsearch</h1>
|
<h1 class="text-3xl font-extrabold text-orange-500 mb-3">Torsearch</h1>
|
||||||
<ul class="space-y-1">
|
<ul class="space-y-1">
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 flex-row flex-no-wrap overflow-hidden {{ results.media.mediaType == "tvshows" ? "hidden" : "options-table" }}"
|
<table class="w-full max-w-[75vw] text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 flex-row flex-no-wrap {{ results.media.mediaType == "tvshows" ? "hidden" : "options-table" }}"
|
||||||
{{ stimulus_target(controller, "list") }}
|
{{ stimulus_target(controller, "list") }}
|
||||||
>
|
>
|
||||||
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
||||||
{% for result in results.results %}
|
{% for result in results.results %}
|
||||||
<tr class="dark:bg-stone-600 overflow-hidden flex flex-col md:flex-col flex-no wrap md:table-row mb-1 md:mb-0">
|
<tr class="dark:bg-stone-600 overflow-hidden flex flex-col md:flex-col flex-no wrap md:table-row border-b border-gray-500">
|
||||||
<th scope="col"
|
<th scope="col"
|
||||||
class="px-4 py-4 leading-[20px] font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
class="px-4 py-4 leading-[20px] font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
||||||
Size
|
Size
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody class="flex-1 sm:flex-none">
|
<tbody class="flex-1 sm:flex-none">
|
||||||
{% for result in results.results %}
|
{% for result in results.results %}
|
||||||
<tr class="bg-white dark:bg-slate-700 flex flex-col flex-no wrap sm:table-row mb-1 sm:mb-0" data-provider="{{ result.provider }}" data-languages="{{ result.languages|json_encode }}" {% if "tvshows" == results.media.mediaType %} data-season="{{ results.season }}"{% endif %}>
|
<tr class="bg-white dark:bg-slate-700 flex flex-col flex-no wrap sm:table-row border-b border-gray-500" data-provider="{{ result.provider }}" data-languages="{{ result.languages|json_encode }}" {% if "tvshows" == results.media.mediaType %} data-season="{{ results.season }}"{% endif %}>
|
||||||
<td id="size" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
|
<td id="size" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
|
||||||
{{ result.size }}
|
{{ result.size }}
|
||||||
</td>
|
</td>
|
||||||
@@ -53,10 +53,10 @@
|
|||||||
<td id="provider" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50 " data-provider="{{ result.provider }}">
|
<td id="provider" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50 " data-provider="{{ result.provider }}">
|
||||||
{{ result.provider }}
|
{{ result.provider }}
|
||||||
</td>
|
</td>
|
||||||
<td id="language" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50" data-languages="{{ result.languages|json_encode }}">
|
<td id="language" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50 overflow-scroll" data-languages="{{ result.languages|json_encode }}">
|
||||||
{{ result.languageFlags|raw }}
|
{{ result.languageFlags|raw }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-4 whitespace-nowrap text-sm text-end text-gray-800 dark:text-gray-50 flex flex-row gap-2 items-center justify-end">
|
<td class="px-4 py-4 whitespace-nowrap text-sm text-end text-gray-800 dark:text-gray-50 flex flex-row gap-2 items-center justify-start mb:justify-end">
|
||||||
<button class="download-btn p-1.5 bg-green-600 rounded-md text-gray-50"
|
<button class="download-btn p-1.5 bg-green-600 rounded-md text-gray-50"
|
||||||
{{ stimulus_controller('download_button', {
|
{{ stimulus_controller('download_button', {
|
||||||
url: result.url,
|
url: result.url,
|
||||||
|
|||||||
Reference in New Issue
Block a user