From b1753a5e7e3a8419b1f5c9d0c967da974ba8e2fc Mon Sep 17 00:00:00 2001 From: projectdx Date: Thu, 1 Jan 2026 02:19:22 +0900 Subject: [PATCH] feat: update UI with new styling for queue, search, and request pages, and adjust module logic. --- .gitignore | 2 + info.yaml | 2 +- mod_linkkf.py | 81 +++-- mod_ohli24.py | 64 ++++ templates/anime_downloader_linkkf_list.html | 327 +++++++++++++++++- templates/anime_downloader_linkkf_queue.html | 258 +++++++------- .../anime_downloader_linkkf_request.html | 248 ++++++++++++- templates/anime_downloader_linkkf_search.html | 92 +++-- .../anime_downloader_linkkf_setting.html | 36 +- .../anime_downloader_ohli24_request.html | 233 +++++++++++++ templates/anime_downloader_ohli24_search.html | 14 + 11 files changed, 1135 insertions(+), 222 deletions(-) diff --git a/.gitignore b/.gitignore index 63218f7..766bd44 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,5 @@ test.ipynb .DS_Store test*.py bin/ +debug_*.py +check_top_api.py diff --git a/info.yaml b/info.yaml index fef223e..6c5f844 100644 --- a/info.yaml +++ b/info.yaml @@ -1,5 +1,5 @@ title: "애니 다운로더" -version: "0.3.2" +version: "0.3.3" package_name: "anime_downloader" developer: "projectdx" description: "anime downloader" diff --git a/mod_linkkf.py b/mod_linkkf.py index d4dcca7..8227de7 100644 --- a/mod_linkkf.py +++ b/mod_linkkf.py @@ -1011,50 +1011,73 @@ class LogicLinkkf(PluginModuleBase): if cate == "ing": # url = f"{P.ModelSetting.get('linkkf_url')}/airing/page/{page}" - url = "https://linkkf.5imgdarr.top/api/singlefilter.php?categorytagid=1970&page=1&limit=20" - items_xpath = '//div[@class="ext-json-item"]' - title_xpath = './/a[@class="text-fff"]//text()' + # User requested to use 'anime-list' ID (categorytagid=2) for 'ing' + url = "https://linkkf.5imgdarr.top/api/singlefilter.php?categorytagid=2&page={}&limit=20".format(page) + items_xpath = None # JSON fetching + title_xpath = None elif cate == "movie": - url = f"{P.ModelSetting.get('linkkf_url')}/ani/page/{page}" - items_xpath = '//div[@class="myui-vodlist__box"]' - title_xpath = './/a[@class="text-fff"]//text()' + # url = f"{P.ModelSetting.get('linkkf_url')}/ani/page/{page}" + # items_xpath = '//div[@class="myui-vodlist__box"]' + # title_xpath = './/a[@class="text-fff"]//text()' + + # API Spec: categorytagid=5061 (Movie) + url = "https://linkkf.5imgdarr.top/api/singlefilter.php?categorytagid=5061&page={}&limit=20".format(page) + items_xpath = None + title_xpath = None + elif cate == "complete": - url = f"{P.ModelSetting.get('linkkf_url')}/anime-list/page/{page}" - items_xpath = '//div[@class="myui-vodlist__box"]' - title_xpath = './/a[@class="text-fff"]//text()' + # User requested to comment out for now (25-12-31) + # url = "https://linkkf.5imgdarr.top/api/singlefilter.php?categorytagid=2&page={}&limit=20".format(page) + url = "" # Disable + items_xpath = None + title_xpath = None elif cate == "top_view": - url = f"{P.ModelSetting.get('linkkf_url')}/topview/page/{page}" - items_xpath = '//div[@class="ext-json-item"]' - title_xpath = './/a[@class="text-fff"]//text()' + # API Spec: type=month|week|day, page=1 + url = "https://linkkf.5imgdarr.top/api/apiview.php?type=month&page={}".format(page) + items_xpath = None # JSON fetching + title_xpath = None else: url = "https://linkkf.5imgdarr.top/api/singlefilter.php?categorytagid=1970&page=1&limit=20" logger.info("url:::> %s", url) - logger.info("test..........................") - # logger.info("test..........................") + if self.referer is None: self.referer = "https://linkkf.live" data = {"ret": "success", "page": page} response_data = LogicLinkkf.get_html(url, timeout=10) - # P.logger.debug(response_data) - # P.logger.debug("debug.....................") - # P.logger.debug(response_data) - - # JSON 응답인지 확인 + + # JSON 응답 처리 (Top View 포함) try: json_data = json.loads(response_data) - P.logger.debug("Response is JSON format") - P.logger.debug(json_data) - # JSON 데이터를 그대로 반환하거나 필요한 형태로 가공 + # P.logger.debug(json_data) + + # top_view 처리는 별도 로직 (구조가 다름) + if cate == "top_view": + items = json_data if isinstance(json_data, list) else [] + data["episode_count"] = len(items) + data["total_page"] = 100 # API limits unclear, defaulting to enough + data["episode"] = [] + + for item in items: + entity = {} + # API: postid, postname, postthum, postdate, ... + entity["code"] = str(item.get("postid")) + entity["title"] = item.get("postname") + entity["image_link"] = item.get("postthum") + entity["link"] = f"https://linkkf.live/{entity['code']}" + entity["chapter"] = "Top" # Rank or simple tag + + data["episode"].append(entity) + return data + + # 기존 JSON 처리 (ing 등) if isinstance(json_data, dict): return json_data else: data["episode"] = json_data if isinstance(json_data, list) else [] return data except (json.JSONDecodeError, ValueError): - # HTML 응답인 경우 - P.logger.debug("Response is HTML format, parsing...") pass tree = html.fromstring(response_data) @@ -1317,6 +1340,16 @@ class LogicLinkkf(PluginModuleBase): entity["filename"] = LogicLinkkf.get_filename( data["save_folder"], data["season"], ep_name ) + + # Check for existing file (for Play button) + entity["filepath"] = os.path.join(entity["save_path"], entity["filename"]) + if os.path.exists(entity["filepath"]): + entity["exist_video"] = True + if "first_exist_filepath" not in data: + data["first_exist_filepath"] = entity["filepath"] + data["first_exist_filename"] = entity["filename"] + else: + entity["exist_video"] = False data["episode"].append(entity) diff --git a/mod_ohli24.py b/mod_ohli24.py index cc2be21..57a8ab6 100644 --- a/mod_ohli24.py +++ b/mod_ohli24.py @@ -851,6 +851,70 @@ class LogicOhli24(PluginModuleBase): if data["episode"]: logger.info(f"Final episode list range: {data['episode'][0]['title']} ~ {data['episode'][-1]['title']}") + + # [FILE EXISTENCE CHECK FOR UI PLAY BUTTON] + try: + # 1. Calculate Save Path (Replicating Ohli24QueueEntity logic) + save_path = P.ModelSetting.get("ohli24_download_path") + content_title = data["title"] + # Season info might be embedded in title or handled elsewhere, but here we use the base title from analysis + # Note: Ohli24QueueEntity extracts season from title regex. We should try that too. + + season = 1 + match = re.compile(r"(?P.*?)\s*((?P<season>\d+)%s)?\s*((?P<epi_no>\d+)%s)" % ("기", "화")).search(content_title) + if match: + content_title_clean = match.group("title").strip() + if "season" in match.groupdict() and match.group("season") is not None: + season = int(match.group("season")) + else: + content_title_clean = content_title + + if P.ModelSetting.get_bool("ohli24_auto_make_folder"): + folder_name = content_title_clean + if data.get("day", "").find("완결") != -1: + folder_name = "%s %s" % (P.ModelSetting.get("ohli24_finished_insert"), content_title_clean) + + folder_name = Util.change_text_for_use_filename(folder_name.strip()) + save_path = os.path.join(save_path, folder_name) + + if P.ModelSetting.get_bool("ohli24_auto_make_season_folder"): + save_path = os.path.join(save_path, "Season %s" % int(season)) + + # 2. Check for first available file + if os.path.exists(save_path): + import glob + # Pattern: Title.S01E01.*.mp4 (Ohli24QueueEntity format) + # We need to check available episodes. Let's check the first few to be safe. + # Note: file pattern uses content_title_clean + + for ep in data["episode"]: + # Parse episode number from title (e.g., "1화") + ep_num = 1 + ep_match = re.search(r"(\d+)화", ep["title"]) + if ep_match: + ep_num = int(ep_match.group(1)) + + # Construct glob pattern + # Pattern from Entity: "%s.S%sE%s.%s-OHNI24.mp4" + season_str = "0%s" % season if season < 10 else season + ep_str = "0%s" % ep_num if ep_num < 10 else ep_num + + # Use glob to match any quality + glob_pattern = f"{Util.change_text_for_use_filename(content_title_clean)}.S{season_str}E{ep_str}.*-OHNI24.mp4" + search_path = os.path.join(save_path, glob_pattern) + files = glob.glob(search_path) + + if files: + # Found a file! + valid_file = files[0] # Pick first match + data["first_exist_filepath"] = valid_file + data["first_exist_filename"] = os.path.basename(valid_file) + logger.info(f"Play button enabled: Found {data['first_exist_filename']}") + break # Stop after finding one + + except Exception as e: + logger.error(f"Error checking file existence: {e}") + # Don't fail the whole analysis, just skip play button self.current_data = data return data diff --git a/templates/anime_downloader_linkkf_list.html b/templates/anime_downloader_linkkf_list.html index 22a5a44..f6a253d 100644 --- a/templates/anime_downloader_linkkf_list.html +++ b/templates/anime_downloader_linkkf_list.html @@ -2,6 +2,303 @@ {% block content %} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/> + +<style> + :root { + --forest-950: #022c22; + --forest-900: #064e3b; + --forest-800: #065f46; + --forest-500: #10b981; + --forest-400: #34d399; + --forest-100: #d1fae5; + --accent-amber: #fbbf24; + } + + body { background-color: var(--forest-950); color: #ecfdf5; font-family: 'Inter', 'Noto Sans KR', sans-serif; } + + /* Layout Expansion */ + #main_container, .container, .container-fluid, .content-cloak { + max-width: 100% !important; + padding-left: 5px !important; + padding-right: 5px !important; + margin: 0 auto !important; + } + + .content-cloak { padding-top: 10px; } + + /* Navigation (Tabs) Optimization */ + /* Navigation Menu Override */ + ul.nav.nav-pills.bg-light { + background-color: rgba(6, 78, 59, 0.4) !important; + backdrop-filter: blur(10px); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 50rem !important; + padding: 6px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important; + display: inline-flex !important; + gap: 4px; + margin-bottom: 20px; + } + + ul.nav.nav-pills .nav-link { + color: #d1fae5 !important; + font-weight: 600 !important; + padding: 8px 20px !important; + border-radius: 50rem !important; + transition: all 0.3s ease !important; + border: 1px solid transparent !important; + } + + ul.nav.nav-pills .nav-link:hover { + background-color: rgba(16, 185, 129, 0.1) !important; + color: #fff !important; + transform: translateY(-1px); + } + + ul.nav.nav-pills .nav-link.active { + background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; + color: #fff !important; + box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; + } + + /* Search Container */ + .search-container { + background: rgba(6, 78, 59, 0.3); + backdrop-filter: blur(10px); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 12px; + padding: 10px; + margin-bottom: 12px; + display: flex; + flex-wrap: wrap; /* Allow wrapping on mobile */ + gap: 8px; + align-items: center; + } + + .search-group-left { + display: flex; gap: 8px; flex: 1; min-width: 140px; /* Ensure basic width */ + } + .search-group-right { + display: flex; gap: 8px; flex: 2; min-width: 200px; + } + + /* Mobile Search Adjustment */ + @media (max-width: 576px) { + .search-group-left, .search-group-right { flex: 100%; } /* Stack on small screens */ + } + + /* Form Controls */ + .custom-select, .custom-input { + background-color: rgba(2, 44, 34, 0.6) !important; + border: 1px solid rgba(16, 185, 129, 0.2) !important; + color: #ecfdf5 !important; + border-radius: 8px !important; + padding: 0 12px !important; + height: 38px !important; + font-size: 13px !important; + } + .custom-select:focus, .custom-input:focus { + box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important; + border-color: #10b981 !important; + } + + .custom-btn { + border-radius: 8px !important; + border: none !important; + padding: 0 16px !important; + height: 38px !important; + font-weight: 600 !important; + display: flex; align-items: center; gap: 6px; + transition: all 0.2s; + } + + .btn-search { + background: linear-gradient(135deg, #10b981 0%, #059669 100%); + color: white !important; + } + .btn-search:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); } + + .btn-reset { + background: rgba(6, 95, 70, 0.5); + color: #a7f3d0 !important; + } + .btn-reset:hover { background: rgba(6, 95, 70, 0.8); color: white !important; } + + /* List Styling */ + #list_div { + display: flex; flex-direction: column; gap: 8px; + } + + .item-row { + background: rgba(6, 78, 59, 0.2); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 12px; + padding: 10px; + display: flex; gap: 12px; + transition: all 0.2s; + position: relative; overflow: hidden; + } + .item-row:hover { + background: rgba(6, 78, 59, 0.4); + border-color: rgba(16, 185, 129, 0.3); + transform: translateY(-2px); + box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3); + } + + .poster-container { + width: 80px; height: 110px; flex-shrink: 0; border-radius: 8px; overflow: hidden; position: relative; + background: #022c22; + } + .poster-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; } + .item-row:hover .poster-img { transform: scale(1.05); } + + .episode-badge { + position: absolute; top: 0; left: 0; + background: rgba(16, 185, 129, 0.9); + color: white; + font-size: 10px; font-weight: 800; + padding: 2px 6px; + border-bottom-right-radius: 6px; + box-shadow: 1px 1px 4px rgba(0,0,0,0.3); + z-index: 5; + } + + .info-container { + flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; + } + + .item-title { + font-size: 15px; font-weight: 700; color: #ecfdf5; + margin-bottom: 4px; line-height: 1.3; + overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; + } + + .item-meta-row { + display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; + } + .meta-program { font-size: 12px; color: #34d399; font-weight: 600; display: flex; align-items: center; gap: 4px; } + .meta-date { font-size: 11px; color: #6ee7b7; opacity: 0.7; } + + .filename-text { + font-size: 11px; color: #94a3b8; background: rgba(0,0,0,0.2); padding: 4px 8px; border-radius: 6px; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; + border: 1px solid rgba(255,255,255,0.05); + } + + /* Action Buttons Area */ + .action-area { + display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; /* Scrollable if too many buttons */ + } + .action-area::-webkit-scrollbar { height: 0px; } /* Hide scrollbar */ + + .action-btn { + padding: 4px 10px; font-size: 11px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); + background: rgba(255,255,255,0.05); color: #d1fae5; white-space: nowrap; + display: flex; align-items: center; gap: 4px; transition: all 0.2s; + } + .action-btn:hover { background: rgba(16, 185, 129, 0.2); color: white; border-color: rgba(16, 185, 129, 0.4); } + .action-btn i { font-size: 10px; } + + /* Status colors */ + .status-completed { color: #34d399; } + .status-downloading { color: #60a5fa; } + .status-failed { color: #f87171; } + + /* Smooth Load CSS */ + .content-cloak, #menu_page_div { opacity: 0; transition: opacity 0.5s ease-out; } + .content-cloak.visible, #menu_page_div.visible { opacity: 1; } + + /* Video Player Modal Styles */ + .modal-content { + background: #022c22; + border-radius: 12px; + border: 1px solid rgba(16, 185, 129, 0.2); + } + .modal-header { + border-bottom: 1px solid rgba(16, 185, 129, 0.1); + } + .modal-title { + color: #ecfdf5; + } + .modal-header .close { + color: #ecfdf5; + } + .modal-body { + padding: 0; + } + .video-js { + width: 100%; + height: auto; + max-height: 75vh; + } + .playlist-controls { + padding: 12px 16px; + background: linear-gradient(135deg, rgba(2, 44, 34, 0.95) 0%, rgba(6, 78, 59, 0.95) 100%); + border-top: 1px solid rgba(16, 185, 129, 0.1); + } + .playlist-controls > div { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; + } + .playlist-nav-btn, .playlist-toggle-btn { + background: rgba(16, 185, 129, 0.2); + color: #ecfdf5; + border: none; + border-radius: 8px; + padding: 8px 12px; + font-size: 14px; + cursor: pointer; + transition: background 0.2s, color 0.2s; + } + .playlist-nav-btn:hover, .playlist-toggle-btn:hover { + background: rgba(16, 185, 129, 0.4); + color: white; + } + #current-video-title { + color: #10b981; + font-weight: 600; + font-size: 14px; + flex: 1; + min-width: 200px; + } + #playlist-progress { + color: #6ee7b7; + font-size: 12px; + margin-top: 2px; + } + #playlist-list-container { + display: none; + margin-top: 12px; + max-height: 200px; + overflow-y: auto; + background: rgba(0,0,0,0.3); + border-radius: 8px; + padding: 8px; + } + #playlist-list .playlist-item { + padding: 8px 10px; + color: #d1fae5; + cursor: pointer; + border-radius: 6px; + transition: background 0.2s; + font-size: 13px; + } + #playlist-list .playlist-item:hover { + background: rgba(16, 185, 129, 0.2); + } + #playlist-list .playlist-item.active { + background: rgba(16, 185, 129, 0.4); + color: white; + font-weight: 600; + } +</style> +<script type="text/javascript"> +$(document).ready(function(){ + setTimeout(function() { $('.content-cloak, #menu_page_div').addClass('visible'); }, 100); +}); +</script> <div class="content-cloak"> <form id="form_search" class="form-inline" style="text-align:left; width:100%;"> <div class="search-container"> @@ -118,34 +415,38 @@ .content-cloak { padding-top: 10px; } /* Navigation (Tabs) Optimization */ - .nav-pills { - background: rgba(6, 78, 59, 0.4) !important; + /* Navigation Menu Override */ + ul.nav.nav-pills.bg-light { + background-color: rgba(6, 78, 59, 0.4) !important; + backdrop-filter: blur(10px); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 50rem !important; padding: 6px !important; - border-radius: 12px !important; - border: 1px solid rgba(16, 185, 129, 0.1) !important; - margin-bottom: 20px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important; display: inline-flex !important; - gap: 4px !important; - box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; + gap: 4px; + margin-bottom: 20px; } - .nav-pills .nav-link { + + ul.nav.nav-pills .nav-link { color: #d1fae5 !important; font-weight: 600 !important; padding: 8px 20px !important; - border-radius: 8px !important; + border-radius: 50rem !important; transition: all 0.3s ease !important; border: 1px solid transparent !important; } - .nav-pills .nav-link:hover { - background: rgba(16, 185, 129, 0.1) !important; + + ul.nav.nav-pills .nav-link:hover { + background-color: rgba(16, 185, 129, 0.1) !important; color: #fff !important; transform: translateY(-1px); } - .nav-pills .nav-link.active { + + ul.nav.nav-pills .nav-link.active { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; - border: 1px solid rgba(255,255,255,0.1) !important; } /* Search Container */ diff --git a/templates/anime_downloader_linkkf_queue.html b/templates/anime_downloader_linkkf_queue.html index 603885b..918f346 100644 --- a/templates/anime_downloader_linkkf_queue.html +++ b/templates/anime_downloader_linkkf_queue.html @@ -1,6 +1,135 @@ {% extends "base.html" %} {% block content %} +<style> + :root { + --forest-950: #022c22; + --forest-900: #064e3b; + --forest-800: #065f46; + --forest-500: #10b981; + --forest-400: #34d399; + --forest-accent: #6ee7b7; + } + + body { background-color: var(--forest-950) !important; color: #ecfdf5; } + + /* Layout Expansion */ + #main_container, .container, .container-fluid, #anime_downloader_wrapper { + max-width: 100% !important; + padding-left: 5px !important; + padding-right: 5px !important; + margin: 0 auto !important; + } + + /* Navigation Menu Override */ + ul.nav.nav-pills.bg-light { + background-color: rgba(6, 78, 59, 0.4) !important; + backdrop-filter: blur(10px); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 50rem !important; + padding: 6px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important; + display: inline-flex !important; + gap: 4px; + margin-bottom: 20px; + } + + ul.nav.nav-pills .nav-link { + color: #d1fae5 !important; + font-weight: 600 !important; + padding: 8px 20px !important; + border-radius: 50rem !important; + transition: all 0.3s ease !important; + border: 1px solid transparent !important; + } + + ul.nav.nav-pills .nav-link:hover { + background-color: rgba(16, 185, 129, 0.1) !important; + color: #fff !important; + transform: translateY(-1px); + } + + ul.nav.nav-pills .nav-link.active { + background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; + color: #fff !important; + box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; + } + + .queue-header-container { + display: flex; justify-content: space-between; align-items: flex-end; + margin-bottom: 20px; border-bottom: 1px solid rgba(16, 185, 129, 0.2); padding-bottom: 10px; + } + .queue-title { color: var(--forest-accent); font-weight: 700; margin: 0; } + .queue-meta { font-size: 12px; color: #6ee7b7; opacity: 0.6; } + + .custom-queue-table { + background: rgba(6, 78, 59, 0.2); border-collapse: separate; border-spacing: 0 4px; color: #ecfdf5; + } + .custom-queue-table thead th { + background: rgba(2, 44, 34, 0.8) !important; color: #6ee7b7; font-size: 13px; + text-transform: uppercase; border: none !important; padding: 12px 8px !important; + text-align: center; + } + .custom-queue-table tbody tr { + background: rgba(6, 78, 59, 0.3); transition: all 0.2s; + } + .custom-queue-table tbody tr:hover { background: rgba(6, 78, 59, 0.5) !important; } + .custom-queue-table td { border: none !important; vertical-align: middle !important; padding: 14px 8px !important; } + + /* Badges & Status */ + .badge-status { + padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; + display: inline-block; min-width: 60px; text-align: center; + } + .status-downloading { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); } + .status-wait { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); } + .status-completed { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); } + .status-fail { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); } + + /* Progress Bar */ + .custom-progress { height: 18px; background: rgba(0,0,0,0.4); border-radius: 9px; overflow: hidden; border: 1px solid rgba(16, 185, 129, 0.1); } + .custom-progress .progress-bar { + background: linear-gradient(90deg, #10b981, #059669) !important; + font-weight: 700; font-size: 11px; + transition: width 0.4s ease-out; + box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); + } + + /* Action Buttons */ + .action-btn-mini { + width: 32px; height: 32px; border-radius: 8px; border: none; font-size: 14px; + display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; + } + .action-btn-mini.btn-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); } + .action-btn-mini.btn-danger:hover { background: #ef4444; color: white; transform: scale(1.1); } + .action-btn-mini.btn-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); } + .action-btn-mini.btn-warning:hover { background: #f59e0b; color: white; transform: scale(1.1); } + + .action-btn-group { display: flex; justify-content: center; gap: 4px; } + + .header-buttons { display: flex; gap: 10px; align-items: center; } + .queue-btn-top { + display: flex; align-items: center; gap: 6px; padding: 6px 14px; + border: none; border-radius: 8px; font-weight: 600; font-size: 13px; + cursor: pointer; transition: all 0.3s ease; + } + .queue-btn-top.btn-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); } + .queue-btn-top.btn-danger:hover { background: #ef4444; color: white; box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); } + .queue-btn-top.btn-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); } + .queue-btn-top.btn-warning:hover { background: #f59e0b; color: white; box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); } + + /* Details */ + .queue-detail-container { color: #d1fae5; font-size: 13px; } + .detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 20px; } + .detail-item { display: flex; gap: 10px; align-items: flex-start; } + .detail-item .label { color: #6ee7b7; font-weight: 700; min-width: 100px; opacity: 0.7; font-size: 11px; text-transform: uppercase; } + .detail-item .value { color: #ecfdf5; word-break: break-all; } + + /* Smooth Load */ + .content-cloak { opacity: 0; transition: opacity 0.5s ease-out; } + .content-cloak.visible { opacity: 1; } +</style> + <div class="content-cloak"> <div class="queue-header-container"> <h4 class="queue-title"><i class="fa fa-download"></i> 다운로드 큐</h4> @@ -271,135 +400,6 @@ function status_html(data) { } </script> -<style> - :root { - --forest-950: #022c22; - --forest-900: #064e3b; - --forest-800: #065f46; - --forest-500: #10b981; - --forest-400: #34d399; - --forest-accent: #6ee7b7; - } - - body { background-color: var(--forest-950) !important; color: #ecfdf5; } - - /* Layout Expansion */ - #main_container, .container, .container-fluid, #anime_downloader_wrapper { - max-width: 100% !important; - padding-left: 5px !important; - padding-right: 5px !important; - margin: 0 auto !important; - } - - /* Navigation (Tabs) Optimization */ - .nav-pills { - background: rgba(6, 78, 59, 0.4) !important; - padding: 6px !important; - border-radius: 12px !important; - border: 1px solid rgba(16, 185, 129, 0.1) !important; - margin-bottom: 20px !important; - display: inline-flex !important; - gap: 4px !important; - box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; - } - .nav-pills .nav-link { - color: #d1fae5 !important; - font-weight: 600 !important; - padding: 8px 20px !important; - border-radius: 8px !important; - transition: all 0.3s ease !important; - border: 1px solid transparent !important; - } - .nav-pills .nav-link:hover { - background: rgba(16, 185, 129, 0.1) !important; - color: #fff !important; - transform: translateY(-1px); - } - .nav-pills .nav-link.active { - background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; - color: #fff !important; - box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; - border: 1px solid rgba(255,255,255,0.1) !important; - } - - .queue-header-container { - display: flex; justify-content: space-between; align-items: flex-end; - margin-bottom: 20px; border-bottom: 1px solid rgba(16, 185, 129, 0.2); padding-bottom: 10px; - } - .queue-title { color: var(--forest-accent); font-weight: 700; margin: 0; } - .queue-meta { font-size: 12px; color: #6ee7b7; opacity: 0.6; } - - .custom-queue-table { - background: rgba(6, 78, 59, 0.2); border-collapse: separate; border-spacing: 0 4px; color: #ecfdf5; - } - .custom-queue-table thead th { - background: rgba(2, 44, 34, 0.8) !important; color: #6ee7b7; font-size: 13px; - text-transform: uppercase; border: none !important; padding: 12px 8px !important; - text-align: center; - } - .custom-queue-table tbody tr { - background: rgba(6, 78, 59, 0.3); transition: all 0.2s; - } - .custom-queue-table tbody tr:hover { background: rgba(6, 78, 59, 0.5) !important; } - .custom-queue-table td { border: none !important; vertical-align: middle !important; padding: 14px 8px !important; } - - /* Badges & Status */ - .badge-status { - padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; - display: inline-block; min-width: 60px; text-align: center; - } - .status-downloading { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); } - .status-wait { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); } - .status-completed { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); } - .status-fail { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); } - - /* Progress Bar */ - .custom-progress { height: 18px; background: rgba(0,0,0,0.4); border-radius: 9px; overflow: hidden; border: 1px solid rgba(16, 185, 129, 0.1); } - .custom-progress .progress-bar { - background: linear-gradient(90deg, #10b981, #059669) !important; - font-weight: 700; font-size: 11px; - transition: width 0.4s ease-out; - box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); - } - - /* Action Buttons */ - .action-btn-mini { - width: 32px; height: 32px; border-radius: 8px; border: none; font-size: 14px; - display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; - } - .action-btn-mini.btn-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); } - .action-btn-mini.btn-danger:hover { background: #ef4444; color: white; transform: scale(1.1); } - .action-btn-mini.btn-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); } - .action-btn-mini.btn-warning:hover { background: #f59e0b; color: white; transform: scale(1.1); } - - .action-btn-group { display: flex; justify-content: center; gap: 4px; } - - .header-buttons { display: flex; gap: 10px; align-items: center; } - .queue-btn-top { - display: flex; align-items: center; gap: 6px; padding: 6px 14px; - border: none; border-radius: 8px; font-weight: 600; font-size: 13px; - cursor: pointer; transition: all 0.3s ease; - } - .queue-btn-top.btn-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); } - .queue-btn-top.btn-danger:hover { background: #ef4444; color: white; box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); } - .queue-btn-top.btn-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); } - .queue-btn-top.btn-warning:hover { background: #f59e0b; color: white; box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); } - - /* Details */ - .queue-detail-container { color: #d1fae5; font-size: 13px; } - .detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 20px; } - .detail-item { display: flex; gap: 10px; align-items: flex-start; } - .detail-item .label { color: #6ee7b7; font-weight: 700; min-width: 100px; opacity: 0.7; font-size: 11px; text-transform: uppercase; } - .detail-item .value { color: #ecfdf5; word-break: break-all; } - - /* Smooth Load */ - .content-cloak { opacity: 0; transition: opacity 0.5s ease-out; } - .content-cloak.visible { opacity: 1; } -</style> - -<script type="text/javascript"> -$(document).ready(function(){ - setTimeout(function() { $('.content-cloak').addClass('visible'); }, 100); }); </script> diff --git a/templates/anime_downloader_linkkf_request.html b/templates/anime_downloader_linkkf_request.html index a6097b0..204f3cd 100644 --- a/templates/anime_downloader_linkkf_request.html +++ b/templates/anime_downloader_linkkf_request.html @@ -140,6 +140,9 @@ str += `<div class="d-flex flex-wrap align-items-center gap-2 p-3 rounded" style="background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);">`; // Standard Actions + if (data.first_exist_filepath) { + str += `<button class="btn btn-success btn-sm mr-2" onclick="play_video('${data.first_exist_filepath.replace(/\\/g, '\\\\')}', '${data.first_exist_filename}')"><i class="fa fa-play"></i> 재생</button>`; + } str += `<button id="check_download_btn" class="btn btn-primary btn-sm mr-2"><i class="fa fa-download"></i> 선택 다운로드</button>`; str += `<button id="all_check_on_btn" class="btn btn-outline-light btn-sm mr-1">전체 선택</button>`; str += `<button id="all_check_off_btn" class="btn btn-outline-secondary btn-sm mr-3">해제</button>`; @@ -364,34 +367,38 @@ } /* Navigation (Tabs) Optimization */ - .nav-pills { - background: rgba(6, 78, 59, 0.4) !important; + /* Navigation Menu Override */ + ul.nav.nav-pills.bg-light { + background-color: rgba(6, 78, 59, 0.4) !important; + backdrop-filter: blur(10px); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 50rem !important; padding: 6px !important; - border-radius: 12px !important; - border: 1px solid rgba(16, 185, 129, 0.1) !important; - margin-bottom: 20px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important; display: inline-flex !important; - gap: 4px !important; - box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; + gap: 4px; + margin-bottom: 20px; } - .nav-pills .nav-link { + + ul.nav.nav-pills .nav-link { color: #d1fae5 !important; font-weight: 600 !important; padding: 8px 20px !important; - border-radius: 8px !important; + border-radius: 50rem !important; transition: all 0.3s ease !important; border: 1px solid transparent !important; } - .nav-pills .nav-link:hover { - background: rgba(16, 185, 129, 0.1) !important; + + ul.nav.nav-pills .nav-link:hover { + background-color: rgba(16, 185, 129, 0.1) !important; color: #fff !important; transform: translateY(-1px); } - .nav-pills .nav-link.active { + + ul.nav.nav-pills .nav-link.active { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; - border: 1px solid rgba(255,255,255,0.1) !important; } /* Search Input Polishing */ @@ -1249,6 +1256,12 @@ } </style> +<style> + /* Smooth Load */ + .content-cloak, #menu_module_div, #menu_page_div { opacity: 0; transition: opacity 0.5s ease-out; } + .content-cloak.visible, #menu_module_div.visible, #menu_page_div.visible { opacity: 1; } +</style> + <script type="text/javascript"> $(document).ready(function(){ // Smooth Load Trigger @@ -1283,4 +1296,213 @@ $(document).ready(function(){ } } </style> + +<!-- Video Player Modal (Copied from List page) --> +<div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-hidden="true"> + <div class="modal-dialog modal-lg" style="max-width: 90%; margin: 1.75rem auto;"> + <div class="modal-content" style="background: #0f172a; border: 1px solid rgba(16, 185, 129, 0.2); border-radius: 16px;"> + <div class="modal-header" style="border-bottom: 1px solid rgba(255,255,255,0.05); padding: 15px 20px;"> + <h5 class="modal-title" style="color: #ecfdf5; font-weight: 700; display: flex; align-items: center; gap: 10px;"> + <i class="fa fa-youtube-play" style="color: #10b981;"></i> + <span id="current-video-title">Video Player</span> + </h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: #94a3b8; text-shadow: none; opacity: 1;"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="modal-body p-0" style="display: flex; flex-direction: column; height: 80vh;"> + <div style="flex-grow: 1; background: black; position: relative;"> + <video id="video-player" class="video-js vjs-big-play-centered vjs-theme-forest" controls preload="auto" style="width: 100%; height: 100%;"></video> + </div> + + <!-- Playlist Control Bar --> + <div style="height: 60px; background: rgba(6, 78, 59, 0.3); border-top: 1px solid rgba(16, 185, 129, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 20px;"> + <div style="display: flex; align-items: center; gap: 15px;"> + <button id="btn-prev-ep" class="playlist-nav-btn" title="이전 에피소드"><i class="fa fa-step-backward"></i></button> + <button id="btn-next-ep" class="playlist-nav-btn" title="다음 에피소드"><i class="fa fa-step-forward"></i></button> + <span id="playlist-progress" style="color: #d1fae5; font-weight: 600; font-size: 14px;"></span> + </div> + <button id="btn-toggle-playlist" class="playlist-toggle-btn active"> + <i class="fa fa-list"></i> 플레이리스트 + </button> + </div> + + <!-- Playlist Drawer --> + <div id="playlist-list-container" style="height: 0px; background: rgba(2, 44, 34, 0.95); transition: height 0.3s ease; overflow-y: auto; border-top: 1px solid rgba(16, 185, 129, 0.1); display: none;"> + <div id="playlist-list" style="padding: 10px;"> + <!-- JS generated items --> + </div> + </div> + </div> + </div> + </div> +</div> + +<link href="https://vjs.zencdn.net/7.20.3/video-js.css" rel="stylesheet" /> +<script src="https://vjs.zencdn.net/7.20.3/video.min.js"></script> + +<style> +/* VideoJS Customization */ +.vjs-theme-forest { --vjs-theme-forest--emerald: #10b981; } +.video-js.vjs-theme-forest .vjs-big-play-button { background-color: #10b981; border-color: #34d399; } + +.playlist-nav-btn { + width: 40px; height: 40px; background: linear-gradient(135deg, #10b981, #059669); + border: none; border-radius: 50%; color: white; font-size: 14px; + cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; +} +.playlist-nav-btn:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); } +.playlist-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; } + +.playlist-toggle-btn { + padding: 8px 14px; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); + border-radius: 8px; color: #6ee7b7; font-size: 13px; cursor: pointer; transition: all 0.2s ease; +} +.playlist-toggle-btn:hover { background: rgba(16, 185, 129, 0.2); color: #ecfdf5; } +.playlist-toggle-btn.active { background: rgba(16, 185, 129, 0.3); border-color: #10b981; color: #10b981; } + +.playlist-item { + padding: 10px 12px; border-radius: 6px; cursor: pointer; transition: all 0.2s; + color: #d1fae5; font-size: 13px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(16, 185, 129, 0.05); +} +.playlist-item:hover { background: rgba(16, 185, 129, 0.1); color: #fff; } +.playlist-item.active { background: rgba(16, 185, 129, 0.2); color: #10b981; font-weight: 600; border-left: 3px solid #10b981; } +</style> + +<script> +var videoPlayer = null; +var playlist = []; +var currentPlaylistIndex = 0; +var currentPlayingPath = null; +var playlistRefreshInterval = null; + +function play_video(path, filename) { + if (!path) { + $.notify('파일 경로를 찾을 수 없습니다.', { type: 'warning' }); + return; + } + + // 플레이리스트 정보 가져오기 + $.get('/' + package_name + '/ajax/' + sub + '/get_playlist?path=' + encodeURIComponent(path), function(data) { + playlist = data.playlist || [{path: path, name: filename}]; + currentPlaylistIndex = data.current_index || 0; + currentPlayingPath = path; + + $('#videoModal').modal('show'); + + if (!videoPlayer) { + videoPlayer = videojs('video-player', { + fluid: true, + playbackRates: [0.5, 1, 1.25, 1.5, 2] + }); + + videoPlayer.on('ended', function() { + if (currentPlaylistIndex < playlist.length - 1) { + playVideoAtIndex(currentPlaylistIndex + 1); + } + }); + } + + playVideoAtIndex(currentPlaylistIndex); + renderPlaylistItems(); + + // 실시간 갱신 시작 (10초) + if (playlistRefreshInterval) clearInterval(playlistRefreshInterval); + playlistRefreshInterval = setInterval(refreshPlaylistData, 10000); + + // Open playlist drawer by default + $('#playlist-list-container').show().css('height', '200px'); + }); +} + +function playVideoAtIndex(index) { + if (index < 0 || index >= playlist.length) return; + currentPlaylistIndex = index; + var item = playlist[index]; + currentPlayingPath = item.path; + + var streamUrl = '/' + package_name + '/ajax/' + sub + '/stream_video?path=' + encodeURIComponent(item.path); + + if (videoPlayer) { + videoPlayer.src({ type: 'video/mp4', src: streamUrl }); + videoPlayer.play(); + } + + $('#current-video-title').text(item.name); + updatePlaylistUI(); +} + +function updatePlaylistUI() { + var total = playlist.length; + var current = currentPlaylistIndex + 1; + $('#playlist-progress').text(current + ' / ' + total + ' 에피소드'); + + // 버튼 활성/비활성 + $('#btn-prev-ep').toggle(currentPlaylistIndex > 0); + $('#btn-next-ep').toggle(currentPlaylistIndex < playlist.length - 1); + + // 리스트 하이라이트 + $('#playlist-list .playlist-item').removeClass('active'); + $('#playlist-list .playlist-item').eq(currentPlaylistIndex).addClass('active'); +} + +function refreshPlaylistData(slient = true) { + if (!currentPlayingPath || !$('#videoModal').is(':visible')) return; + + $.get('/' + package_name + '/ajax/' + sub + '/get_playlist?path=' + encodeURIComponent(currentPlayingPath), function(data) { + if (data.playlist && data.playlist.length > 0) { + var oldLength = playlist.length; + playlist = data.playlist; + currentPlaylistIndex = data.current_index; + + if (playlist.length > oldLength) { + $.notify('새로운 에피소드가 감지되어 플레이리스트가 업데이트되었습니다.', { type: 'success' }); + } + + renderPlaylistItems(); + updatePlaylistUI(); + } + }); +} + +function renderPlaylistItems() { + var str = ''; + for (var i = 0; i < playlist.length; i++) { + var item = playlist[i]; + var isActive = (i === currentPlaylistIndex) ? 'active' : ''; + str += '<div class="playlist-item ' + isActive + '" onclick="playVideoAtIndex(' + i + ')">'; + str += '<i class="fa ' + (isActive ? 'fa-play-circle' : 'fa-play') + '"></i>'; + str += '<span>' + item.name + '</span>'; + str += '</div>'; + } + $('#playlist-list').html(str); +} + +// 모달 닫힐 때 중지 +$('#videoModal').on('hidden.bs.modal', function () { + if (videoPlayer) { + videoPlayer.pause(); + } + if (playlistRefreshInterval) { + clearInterval(playlistRefreshInterval); + playlistRefreshInterval = null; + } + currentPlayingPath = null; +}); + +// 플레이리스트 컨트롤러 핸들러 +$('#btn-prev-ep').click(function() { playVideoAtIndex(currentPlaylistIndex - 1); }); +$('#btn-next-ep').click(function() { playVideoAtIndex(currentPlaylistIndex + 1); }); +$('#btn-toggle-playlist').click(function() { + $(this).toggleClass('active'); + var container = $('#playlist-list-container'); + if (container.is(':visible')) { + container.css('height', '0'); + setTimeout(function() { container.hide(); }, 300); + } else { + container.show(); + setTimeout(function() { container.css('height', '200px'); }, 10); + } +}); +</script> {% endblock %} diff --git a/templates/anime_downloader_linkkf_search.html b/templates/anime_downloader_linkkf_search.html index ef02ff3..9268008 100644 --- a/templates/anime_downloader_linkkf_search.html +++ b/templates/anime_downloader_linkkf_search.html @@ -29,8 +29,9 @@ placeholder="Search" aria-label="Search" aria-describedby="search-addon" + style="height: 46px;" /> - <button id="btn_search" type="button" class="btn btn-primary"> + <button id="btn_search" type="button" class="btn btn-primary" style="height: 46px; display: flex; align-items: center; justify-content: center; padding: 0 20px; line-height: normal; margin: 0;"> search </button> </div> @@ -41,12 +42,12 @@ role="group" aria-label="Linkkf Button" > - <button id="ing" type="button" class="btn btn-success">방영중</button> - <button id="movie" type="button" class="btn btn-primary">극장판</button> - <button id="complete_anilist" type="button" class="btn btn-dark"> + <button id="ing" type="button" class="btn btn-elegant-ing">방영중</button> + <button id="movie" type="button" class="btn btn-elegant-movie">극장판</button> + <button id="complete_anilist" type="button" class="btn btn-dark" style="display:none;"> 완결 </button> - <button id="top_view" type="button" class="btn btn-yellow">Top</button> + <button id="top_view" type="button" class="btn btn-elegant-top">Top</button> </div> <form id="airing_list_form"> <div id="airing_list"></div> @@ -151,7 +152,7 @@ current_cate = 'ing' break; case 'movie': - url = '/' + package_name + '/ajax/' + sub + '/screen_movie_list' + url = '/' + package_name + '/ajax/' + sub + '/anime_list' current_cate = 'movie' break; case 'complete': @@ -159,8 +160,8 @@ current_cate = 'complete' break; case 'top_view': - url = '/' + package_name + '/ajax/' + sub + '/complete_list' - current_cate = 'complete' + url = '/' + package_name + '/ajax/' + sub + '/anime_list' + current_cate = 'top_view' break default: break; @@ -478,22 +479,22 @@ // spinner_loading.style.display = "block"; current_cate = "ing"; - get_anime_list(1, "ing"); + get_anime_list("ing", 1); break; case "movie": // console.log("movie") current_cate = "movie"; - get_anime_screen_movie(1); + get_anime_list("movie", 1); break; case "complete_anilist": // console.log("complete") current_cate = "complete"; - get_complete_anilist(1); + get_anime_list("complete", 1); break; case "top_view": // console.log("top_view") current_cate = "top_view"; - get_anime_list(1, "top_view"); + get_anime_list("top_view", 1); break; default: // console.log("default") @@ -834,34 +835,38 @@ } /* Navigation (Tabs) Optimization */ - .nav-pills { - background: rgba(6, 78, 59, 0.4) !important; + /* Navigation Menu Override */ + ul.nav.nav-pills.bg-light { + background-color: rgba(6, 78, 59, 0.4) !important; + backdrop-filter: blur(10px); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 50rem !important; padding: 6px !important; - border-radius: 12px !important; - border: 1px solid rgba(16, 185, 129, 0.1) !important; - margin-bottom: 20px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important; display: inline-flex !important; - gap: 4px !important; - box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; + gap: 4px; + margin-bottom: 20px; } - .nav-pills .nav-link { + + ul.nav.nav-pills .nav-link { color: #d1fae5 !important; font-weight: 600 !important; padding: 8px 20px !important; - border-radius: 8px !important; + border-radius: 50rem !important; transition: all 0.3s ease !important; border: 1px solid transparent !important; } - .nav-pills .nav-link:hover { - background: rgba(16, 185, 129, 0.1) !important; + + ul.nav.nav-pills .nav-link:hover { + background-color: rgba(16, 185, 129, 0.1) !important; color: #fff !important; transform: translateY(-1px); } - .nav-pills .nav-link.active { + + ul.nav.nav-pills .nav-link.active { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; - border: 1px solid rgba(255,255,255,0.1) !important; } .input-group { @@ -1109,7 +1114,36 @@ ::-webkit-scrollbar-track { background: var(--bg-primary); } ::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: var(--accent-secondary); } - /* Navigation Menu Override */ + /* Elegant Button Styles */ + .btn-elegant-ing, .btn-elegant-movie, .btn-elegant-top { + color: white; + border: none; + box-shadow: 0 4px 6px rgba(0,0,0,0.1); + transition: all 0.3s ease; + font-weight: 500; + letter-spacing: 0.5px; + } + .btn-elegant-ing { + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + } + .btn-elegant-movie { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + } + .btn-elegant-top { + background: linear-gradient(135deg, #f09819 0%, #edde5d 100%); + color: #333; /* Darker text for visibility on yellow */ + } + .btn-elegant-ing:hover, .btn-elegant-movie:hover, .btn-elegant-top:hover { + transform: translateY(-2px); + box-shadow: 0 6px 12px rgba(0,0,0,0.15); + color: white; + filter: brightness(1.1); + } + .btn-elegant-top:hover { + color: #fff; + } + + /* Navigation Menu Override */ ul.nav.nav-pills.bg-light { background-color: rgba(30, 41, 59, 0.6) !important; backdrop-filter: blur(10px); @@ -1211,6 +1245,12 @@ } </style> +<style> + /* Smooth Load */ + .content-cloak, #menu_module_div, #menu_page_div { opacity: 0; transition: opacity 0.5s ease-out; } + .content-cloak.visible, #menu_module_div.visible, #menu_page_div.visible { opacity: 1; } +</style> + <script type="text/javascript"> $(document).ready(function(){ // Smooth Load Trigger diff --git a/templates/anime_downloader_linkkf_setting.html b/templates/anime_downloader_linkkf_setting.html index c65f5f7..ba297af 100644 --- a/templates/anime_downloader_linkkf_setting.html +++ b/templates/anime_downloader_linkkf_setting.html @@ -110,34 +110,38 @@ } /* Navigation (Tabs) Optimization */ - .nav-pills { - background: rgba(6, 78, 59, 0.4) !important; + /* Navigation Menu Override */ + ul.nav.nav-pills.bg-light { + background-color: rgba(6, 78, 59, 0.4) !important; + backdrop-filter: blur(10px); + border: 1px solid rgba(16, 185, 129, 0.1); + border-radius: 50rem !important; padding: 6px !important; - border-radius: 12px !important; - border: 1px solid rgba(16, 185, 129, 0.1) !important; - margin-bottom: 20px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important; display: inline-flex !important; - gap: 4px !important; - box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; + gap: 4px; + margin-bottom: 20px; } - .nav-pills .nav-link { + + ul.nav.nav-pills .nav-link { color: #d1fae5 !important; font-weight: 600 !important; - padding: 8px 18px !important; - border-radius: 8px !important; + padding: 8px 20px !important; + border-radius: 50rem !important; transition: all 0.3s ease !important; border: 1px solid transparent !important; } - .nav-pills .nav-link:hover { - background: rgba(16, 185, 129, 0.1) !important; + + ul.nav.nav-pills .nav-link:hover { + background-color: rgba(16, 185, 129, 0.1) !important; color: #fff !important; transform: translateY(-1px); } - .nav-pills .nav-link.active { + + ul.nav.nav-pills .nav-link.active { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; - border: 1px solid rgba(255,255,255,0.1) !important; } /* Form Controls */ @@ -316,9 +320,9 @@ $("body").on('click', '#go_btn', function(e){ transform: translateY(-1px); } ul.nav.nav-pills .nav-link.active { - background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important; + background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; color: #fff !important; - box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4); + box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important; } </style> diff --git a/templates/anime_downloader_ohli24_request.html b/templates/anime_downloader_ohli24_request.html index d3acc03..ffff2cb 100644 --- a/templates/anime_downloader_ohli24_request.html +++ b/templates/anime_downloader_ohli24_request.html @@ -172,6 +172,9 @@ str += `<div class="d-flex flex-wrap align-items-center mobile-action-buttons rounded" style="background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 10px; gap: 8px;">`; // Standard Actions + if (data.first_exist_filepath) { + str += `<button class="btn btn-success btn-sm mr-2" onclick="play_video('${data.first_exist_filepath.replace(/\\/g, '\\\\')}', '${data.first_exist_filename}')"><i class="fa fa-play"></i> 재생</button>`; + } str += `<button id="check_download_btn" class="btn btn-primary btn-sm"><i class="fa fa-download"></i> 선택 다운로드</button>`; str += `<button id="all_check_on_btn" class="btn btn-outline-light btn-sm">전체 선택</button>`; str += `<button id="all_check_off_btn" class="btn btn-outline-secondary btn-sm">해제</button>`; @@ -1281,4 +1284,234 @@ $(document).ready(function(){ }, 100); }); </script> +</style> +<style> + /* Smooth Load */ + .content-cloak, #menu_module_div, #menu_page_div { opacity: 0; transition: opacity 0.5s ease-out; } + .content-cloak.visible, #menu_module_div.visible, #menu_page_div.visible { opacity: 1; } + + /* Mobile Menu Fix */ + @media (max-width: 768px) { + #menu_module_div { + padding-top: 60px; + } + } +</style> + +<script type="text/javascript"> +$(document).ready(function(){ + // Smooth Load Trigger + setTimeout(function() { + $('.content-cloak, #menu_module_div, #menu_page_div').addClass('visible'); + }, 100); +}); +</script> +<!-- Video Player Modal (Copied from List page) --> +<div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-hidden="true"> + <div class="modal-dialog modal-lg" style="max-width: 90%; margin: 1.75rem auto;"> + <div class="modal-content" style="background: #0f172a; border: 1px solid rgba(16, 185, 129, 0.2); border-radius: 16px;"> + <div class="modal-header" style="border-bottom: 1px solid rgba(255,255,255,0.05); padding: 15px 20px;"> + <h5 class="modal-title" style="color: #ecfdf5; font-weight: 700; display: flex; align-items: center; gap: 10px;"> + <i class="fa fa-youtube-play" style="color: #10b981;"></i> + <span id="current-video-title">Video Player</span> + </h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: #94a3b8; text-shadow: none; opacity: 1;"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="modal-body p-0" style="display: flex; flex-direction: column; height: 80vh;"> + <div style="flex-grow: 1; background: black; position: relative;"> + <video id="video-player" class="video-js vjs-big-play-centered vjs-theme-forest" controls preload="auto" style="width: 100%; height: 100%;"></video> + </div> + + <!-- Playlist Control Bar --> + <div style="height: 60px; background: rgba(6, 78, 59, 0.3); border-top: 1px solid rgba(16, 185, 129, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 20px;"> + <div style="display: flex; align-items: center; gap: 15px;"> + <button id="btn-prev-ep" class="playlist-nav-btn" title="이전 에피소드"><i class="fa fa-step-backward"></i></button> + <button id="btn-next-ep" class="playlist-nav-btn" title="다음 에피소드"><i class="fa fa-step-forward"></i></button> + <span id="playlist-progress" style="color: #d1fae5; font-weight: 600; font-size: 14px;"></span> + </div> + <button id="btn-toggle-playlist" class="playlist-toggle-btn active"> + <i class="fa fa-list"></i> 플레이리스트 + </button> + </div> + + <!-- Playlist Drawer --> + <div id="playlist-list-container" style="height: 0px; background: rgba(2, 44, 34, 0.95); transition: height 0.3s ease; overflow-y: auto; border-top: 1px solid rgba(16, 185, 129, 0.1); display: none;"> + <div id="playlist-list" style="padding: 10px;"> + <!-- JS generated items --> + </div> + </div> + </div> + </div> + </div> +</div> + +<link href="https://vjs.zencdn.net/7.20.3/video-js.css" rel="stylesheet" /> +<script src="https://vjs.zencdn.net/7.20.3/video.min.js"></script> + +<style> +/* VideoJS Customization */ +.vjs-theme-forest { --vjs-theme-forest--emerald: #10b981; } +.video-js.vjs-theme-forest .vjs-big-play-button { background-color: #10b981; border-color: #34d399; } + +.playlist-nav-btn { + width: 40px; height: 40px; background: linear-gradient(135deg, #10b981, #059669); + border: none; border-radius: 50%; color: white; font-size: 14px; + cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; +} +.playlist-nav-btn:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); } +.playlist-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; } + +.playlist-toggle-btn { + padding: 8px 14px; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); + border-radius: 8px; color: #6ee7b7; font-size: 13px; cursor: pointer; transition: all 0.2s ease; +} +.playlist-toggle-btn:hover { background: rgba(16, 185, 129, 0.2); color: #ecfdf5; } +.playlist-toggle-btn.active { background: rgba(16, 185, 129, 0.3); border-color: #10b981; color: #10b981; } + +.playlist-item { + padding: 10px 12px; border-radius: 6px; cursor: pointer; transition: all 0.2s; + color: #d1fae5; font-size: 13px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(16, 185, 129, 0.05); +} +.playlist-item:hover { background: rgba(16, 185, 129, 0.1); color: #fff; } +.playlist-item.active { background: rgba(16, 185, 129, 0.2); color: #10b981; font-weight: 600; border-left: 3px solid #10b981; } +</style> + +<script> +var videoPlayer = null; +var playlist = []; +var currentPlaylistIndex = 0; +var currentPlayingPath = null; +var playlistRefreshInterval = null; + +function play_video(path, filename) { + if (!path) { + $.notify('파일 경로를 찾을 수 없습니다.', { type: 'warning' }); + return; + } + + // 플레이리스트 정보 가져오기 + $.get('/' + package_name + '/ajax/' + sub + '/get_playlist?path=' + encodeURIComponent(path), function(data) { + playlist = data.playlist || [{path: path, name: filename}]; + currentPlaylistIndex = data.current_index || 0; + currentPlayingPath = path; + + $('#videoModal').modal('show'); + + if (!videoPlayer) { + videoPlayer = videojs('video-player', { + fluid: true, + playbackRates: [0.5, 1, 1.25, 1.5, 2] + }); + + videoPlayer.on('ended', function() { + if (currentPlaylistIndex < playlist.length - 1) { + playVideoAtIndex(currentPlaylistIndex + 1); + } + }); + } + + playVideoAtIndex(currentPlaylistIndex); + renderPlaylistItems(); + + // 실시간 갱신 시작 (10초) + if (playlistRefreshInterval) clearInterval(playlistRefreshInterval); + playlistRefreshInterval = setInterval(refreshPlaylistData, 10000); + + // Open playlist drawer by default + $('#playlist-list-container').show().css('height', '200px'); + }); +} + +function playVideoAtIndex(index) { + if (index < 0 || index >= playlist.length) return; + currentPlaylistIndex = index; + var item = playlist[index]; + currentPlayingPath = item.path; + + var streamUrl = '/' + package_name + '/ajax/' + sub + '/stream_video?path=' + encodeURIComponent(item.path); + + if (videoPlayer) { + videoPlayer.src({ type: 'video/mp4', src: streamUrl }); + videoPlayer.play(); + } + + $('#current-video-title').text(item.name); + updatePlaylistUI(); +} + +function updatePlaylistUI() { + var total = playlist.length; + var current = currentPlaylistIndex + 1; + $('#playlist-progress').text(current + ' / ' + total + ' 에피소드'); + + // 버튼 활성/비활성 + $('#btn-prev-ep').toggle(currentPlaylistIndex > 0); + $('#btn-next-ep').toggle(currentPlaylistIndex < playlist.length - 1); + + // 리스트 하이라이트 + $('#playlist-list .playlist-item').removeClass('active'); + $('#playlist-list .playlist-item').eq(currentPlaylistIndex).addClass('active'); +} + +function refreshPlaylistData(slient = true) { + if (!currentPlayingPath || !$('#videoModal').is(':visible')) return; + + $.get('/' + package_name + '/ajax/' + sub + '/get_playlist?path=' + encodeURIComponent(currentPlayingPath), function(data) { + if (data.playlist && data.playlist.length > 0) { + var oldLength = playlist.length; + playlist = data.playlist; + currentPlaylistIndex = data.current_index; + + if (playlist.length > oldLength) { + $.notify('새로운 에피소드가 감지되어 플레이리스트가 업데이트되었습니다.', { type: 'success' }); + } + + renderPlaylistItems(); + updatePlaylistUI(); + } + }); +} + +function renderPlaylistItems() { + var str = ''; + for (var i = 0; i < playlist.length; i++) { + var item = playlist[i]; + var isActive = (i === currentPlaylistIndex) ? 'active' : ''; + str += '<div class="playlist-item ' + isActive + '" onclick="playVideoAtIndex(' + i + ')">'; + str += '<i class="fa ' + (isActive ? 'fa-play-circle' : 'fa-play') + '"></i>'; + str += '<span>' + item.name + '</span>'; + str += '</div>'; + } + $('#playlist-list').html(str); +} + +// 모달 닫힐 때 중지 +$('#videoModal').on('hidden.bs.modal', function () { + if (videoPlayer) { + videoPlayer.pause(); + } + if (playlistRefreshInterval) { + clearInterval(playlistRefreshInterval); + playlistRefreshInterval = null; + } + currentPlayingPath = null; +}); + +// 플레이리스트 컨트롤러 핸들러 +$('#btn-prev-ep').click(function() { playVideoAtIndex(currentPlaylistIndex - 1); }); +$('#btn-next-ep').click(function() { playVideoAtIndex(currentPlaylistIndex + 1); }); +$('#btn-toggle-playlist').click(function() { + $(this).toggleClass('active'); + var container = $('#playlist-list-container'); + if (container.is(':visible')) { + container.css('height', '0'); + setTimeout(function() { container.hide(); }, 300); + } else { + container.show(); + setTimeout(function() { container.css('height', '200px'); }, 10); + } +}); +</script> {% endblock %} diff --git a/templates/anime_downloader_ohli24_search.html b/templates/anime_downloader_ohli24_search.html index 24388b2..61fbcdc 100644 --- a/templates/anime_downloader_ohli24_search.html +++ b/templates/anime_downloader_ohli24_search.html @@ -817,4 +817,18 @@ $(document).ready(function(){ } } </style> +<style> + /* Smooth Load */ + .content-cloak, #menu_module_div, #menu_page_div { opacity: 0; transition: opacity 0.5s ease-out; } + .content-cloak.visible, #menu_module_div.visible, #menu_page_div.visible { opacity: 1; } +</style> + +<script type="text/javascript"> +$(document).ready(function(){ + // Smooth Load Trigger + setTimeout(function() { + $('.content-cloak, #menu_module_div, #menu_page_div').addClass('visible'); + }, 100); +}); +</script> {% endblock %}