v0.1.2: 검색 속도 개선, 인피니티 스크롤 최적화, 미니 플레이어 추가

This commit is contained in:
2026-01-24 22:22:02 +09:00
parent b27bf655f2
commit 901fcd0541
15 changed files with 893 additions and 37 deletions

View File

@@ -0,0 +1,216 @@
{% extends "base.html" %} {% block content %}
<link rel="stylesheet" href="{{ url_for('.static', filename='youtube-dl_modern.css') }}?ver={{ arg['package_version'] }}">
<style>
.search-result-card {
background: var(--bg-surface);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
overflow: hidden;
transition: transform 0.2s, box-shadow 0.2s;
margin-bottom: 20px;
height: 100%;
display: flex;
flex-direction: column;
}
.search-result-card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-md);
border-color: var(--primary-color);
}
.thumbnail-wrapper {
position: relative;
padding-top: 56.25%; /* 16:9 */
background: #000;
overflow: hidden;
}
.thumbnail-wrapper img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.duration-badge {
position: absolute;
bottom: 8px;
right: 8px;
background: rgba(0,0,0,0.8);
color: #fff;
padding: 2px 6px;
border-radius: 4px;
font-size: 11px;
font-weight: 600;
}
.card-body-content {
padding: 12px;
flex-grow: 1;
display: flex;
flex-direction: column;
}
.video-title {
font-size: 14px;
font-weight: 600;
color: var(--text-main);
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin-bottom: 8px;
line-height: 1.4;
height: 2.8em;
}
.meta-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
font-size: 11px;
color: var(--text-muted);
}
.uploader-info {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 8px;
}
.upload-date {
flex-shrink: 0;
background: rgba(255,255,255,0.05);
padding: 2px 6px;
border-radius: 4px;
}
.card-actions {
margin-top: auto;
display: flex;
gap: 8px;
}
.search-container {
max-width: 800px;
margin: 0 auto 30px auto;
}
.search-input-group {
display: flex;
background: var(--bg-surface);
border: 1px solid var(--border-color);
border-radius: 9999px;
padding: 4px 4px 4px 20px;
box-shadow: var(--shadow-sm);
transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input-group:focus-within {
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.search-input {
flex-grow: 1;
background: transparent !important;
border: none !important;
color: var(--text-main) !important;
outline: none !important;
font-size: 15px;
height: 42px;
}
.search-btn {
background: var(--primary-color);
color: #0f172a;
border: none;
border-radius: 9999px;
padding: 0 24px;
font-weight: 600;
cursor: pointer;
transition: background 0.2s;
}
.search-btn:hover {
background: var(--primary-hover);
}
/* Play Icon Overlay */
.thumbnail-wrapper {
cursor: pointer;
}
.play-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.3);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.2s;
}
.thumbnail-wrapper:hover .play-overlay {
opacity: 1;
}
.play-overlay i {
color: #fff;
font-size: 3rem;
text-shadow: 0 0 20px rgba(0,0,0,0.5);
}
#player-wrapper {
width: 100%;
max-width: 800px;
aspect-ratio: 16 / 9;
margin: 0 auto 20px auto;
display: none;
background: #000;
border-radius: 8px;
overflow: hidden;
box-shadow: var(--shadow-md);
}
#player-wrapper .art-video-player {
width: 100% !important;
height: 100% !important;
}
#sentinel {
min-height: 100px;
}
/* 미니 플레이어 오른쪽 하단 위치 */
.art-mini-state {
right: 20px !important;
left: auto !important;
bottom: 20px !important;
transform: none !important;
}
</style>
<div class="search-container mt-4">
<div id="player-wrapper"></div>
<div class="search-input-group">
<input type="text" id="search_keyword" class="search-input" placeholder="유튜브 검색어 입력..." aria-label="Search">
<button id="search_btn" class="search-btn">검색</button>
</div>
</div>
<div id="search_results" class="row">
<div class="col-12 text-center py-5 text-muted" id="initial_message">
<i class="fa fa-search fa-3x mb-3" style="opacity: 0.3;"></i>
<p>검색어를 입력하고 검색 버튼을 눌러주세요.</p>
</div>
</div>
<div id="sentinel" class="py-4 text-center">
<!-- Spinner is shown/hidden via JS -->
<div id="sentinel_loading" style="display: none;">
<div class="spinner-border text-info" role="status"></div>
<p class="text-muted mt-2" style="font-size: 12px;">더 많은 결과 불러오는 중...</p>
</div>
</div>
<script>
'use strict';
const package_name = '{{ arg["package_name"] }}';
</script>
<script src="https://cdn.jsdelivr.net/npm/hls.js/dist/hls.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js"></script>
<script src="{{ url_for('.static', filename='%s.js' % arg['template_name']) }}?ver={{ arg['package_version'] }}"></script>
{% endblock %}