908 lines
36 KiB
HTML
908 lines
36 KiB
HTML
{% extends "base.html" %} {% block content %}
|
|
<link rel="stylesheet" href="{{ url_for('.static', filename='css/mobile_custom.css') }}"/>
|
|
<link rel="stylesheet" href="{{ url_for('.static', filename='css/' ~ arg['sub'] ~ '.css') }}"/>
|
|
|
|
|
|
<!-- Modern UI Loader -->
|
|
<div id="preloader" class="loader-bg">
|
|
<div class="modern-loader">
|
|
<div class="spinner-ring"></div>
|
|
<div class="spinner-ring"></div>
|
|
<div class="spinner-ring"></div>
|
|
<div class="loader-text">Loading Ohli24</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- AJAX Loading Spinner (Global) -->
|
|
<div id="ajax_loader" class="ajax-loader-container" style="display: none;">
|
|
<div class="ajax-spinner"></div>
|
|
</div>
|
|
<div id="ohli24_search_wrapper" class="ohli24-common-wrapper container-fluid content-cloak ohli24-search-page">
|
|
<!-- Search Section -->
|
|
<div class="glass-card p-4 mb-4">
|
|
<div class="ohli24-header">
|
|
<div class="ohli24-header-left">
|
|
<div class="ohli24-icon-box">
|
|
<i class="bi bi-search text-primary" style="font-size: 1.5rem;"></i>
|
|
</div>
|
|
<div>
|
|
<h3 class="ohli24-header-title">Ohli24 검색</h3>
|
|
<span class="ohli24-header-subtitle">애니메이션 검색 및 탐색</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr style="border-color: rgba(255,255,255,0.05); margin-bottom: 25px;">
|
|
|
|
<div class="row align-items-center">
|
|
<div class="col-md-8 mx-auto">
|
|
<div class="input-group input-group-responsive">
|
|
<input
|
|
id="input_search"
|
|
type="search"
|
|
class="form-control border-0 text-white"
|
|
placeholder="애니메이션 제목 검색..."
|
|
aria-label="Search"
|
|
style="background: rgba(0,0,0,0.4); border-radius: 12px 0 0 12px !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);"
|
|
/>
|
|
<div class="input-group-append">
|
|
<button id="btn_search" type="button" class="btn btn-primary px-4 font-weight-bold" style="border-radius: 0 12px 12px 0 !important; box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);">
|
|
<i class="bi bi-search"></i> 검색
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Category Buttons -->
|
|
<div class="row mt-4 justify-content-center">
|
|
<div id="anime_category" class="d-flex flex-wrap justify-content-center" role="group">
|
|
<button id="ing" type="button" class="btn btn-success btn-pill px-4 mx-1 active active-glow mb-2">방영중</button>
|
|
<button id="fin" type="button" class="btn btn-outline-light btn-pill px-4 mx-1 active-glow mb-2">완결</button>
|
|
<button id="theater" type="button" class="btn btn-outline-primary btn-pill px-4 mx-1 active-glow mb-2">극장판</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Year Selection (Sub-category) -->
|
|
<div id="year_filter_row" class="row mt-3 justify-content-center animate__animated animate__fadeIn" style="display: none;">
|
|
<div id="year_category" class="d-flex flex-wrap justify-content-center" role="group">
|
|
<button data-sca="" type="button" class="btn btn-sm btn-outline-secondary btn-pill px-3 mx-1 mb-2 active">전체</button>
|
|
<button data-sca="2025" type="button" class="btn btn-sm btn-outline-secondary btn-pill px-3 mx-1 mb-2">2025</button>
|
|
<button data-sca="2024" type="button" class="btn btn-sm btn-outline-secondary btn-pill px-3 mx-1 mb-2">2024</button>
|
|
<button data-sca="2023" type="button" class="btn btn-sm btn-outline-secondary btn-pill px-3 mx-1 mb-2">2023</button>
|
|
<button data-sca="2022" type="button" class="btn btn-sm btn-outline-secondary btn-pill px-3 mx-1 mb-2">2022</button>
|
|
<button data-sca="2021" type="button" class="btn btn-sm btn-outline-secondary btn-pill px-3 mx-1 mb-2">2021</button>
|
|
<button data-sca="2020" type="button" class="btn btn-sm btn-outline-secondary btn-pill px-3 mx-1 mb-2">2020</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<form id="airing_list_form">
|
|
<div id="airing_list"></div>
|
|
</form>
|
|
<form id="screen_movie_list_form">
|
|
<div id="screen_movie_list"></div>
|
|
</form>
|
|
|
|
<form id="program_auto_form">
|
|
<div id="episode_list"></div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!--전체-->
|
|
|
|
<script
|
|
type="text/javascript"
|
|
src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"
|
|
></script>
|
|
<script src="{{ url_for('.static', filename='js/sjva_ui14.js') }}"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"
|
|
integrity="sha512-jNDtFf7qgU0eH/+Z42FG4fw3w7DM/9zbgNPe3wfJlCylVDTT3IgKW5r92Vy9IHa6U50vyMz5gRByIu4YIXFtaQ=="
|
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script type="text/javascript">
|
|
const package_name = "{{arg['package_name'] }}";
|
|
const sub = "{{arg['sub'] }}";
|
|
const anilife_url = "{{arg['anilife_url']}}";
|
|
// let current_data = null;
|
|
let page = 1;
|
|
let next_page = Number
|
|
let current_cate = 'ing'
|
|
let current_sca = ''
|
|
let current_query = ''
|
|
|
|
const loader = document.getElementById("preloader");
|
|
|
|
const dismissLoadingScreen = function () {
|
|
loader.style.display = "none";
|
|
};
|
|
|
|
const wait3seconds = function () {
|
|
// REFERENCE: https://www.w3schools.com/jsref/met_win_settimeout.asp
|
|
const result = setTimeout(dismissLoadingScreen, 1000);
|
|
};
|
|
|
|
window.addEventListener("load", wait3seconds);
|
|
// window.addEventListener("load", dismissLoadingScreen);
|
|
|
|
|
|
const observer = lozad('.lozad', {
|
|
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
|
threshold: 0.1, // ratio of element convergence
|
|
enableAutoReload: true // it will reload the new image when validating attributes changes
|
|
});
|
|
observer.observe();
|
|
|
|
|
|
const get_anime_list = (type, page, sca = '') => {
|
|
// console.log(`type: ${type}, page: ${page}, sca: ${sca}`)
|
|
let url = ''
|
|
let data = {"page": page, "type": type}
|
|
if (sca) data.sca = sca;
|
|
current_sca = sca;
|
|
|
|
switch (type) {
|
|
case 'ing':
|
|
url = '/' + package_name + '/ajax/' + sub + '/anime_list'
|
|
current_cate = 'ing'
|
|
break;
|
|
case 'movie':
|
|
url = '/' + package_name + '/ajax/' + sub + '/screen_movie_list'
|
|
current_cate = 'movie'
|
|
break;
|
|
case 'theater':
|
|
url = '/' + package_name + '/ajax/' + sub + '/anime_list'
|
|
current_cate = 'theater'
|
|
break;
|
|
case 'fin':
|
|
url = '/' + package_name + '/ajax/' + sub + '/complete_list'
|
|
current_cate = 'fin'
|
|
break
|
|
default:
|
|
break;
|
|
}
|
|
|
|
$('#ajax_loader').show();
|
|
$.ajax({
|
|
url: url,
|
|
type: "POST",
|
|
data: data,
|
|
cache: false,
|
|
global: false,
|
|
dataType: "json",
|
|
complete: () => {
|
|
$('#ajax_loader').hide();
|
|
},
|
|
success: (ret) => {
|
|
let current_screen_movie_data = ret
|
|
// console.log('ret::>', ret)
|
|
|
|
if (ret.ret === 'success') {
|
|
if (type === "ing") {
|
|
make_airing_list(ret.data, page)
|
|
// observer.observe();
|
|
} else if (type === "fin") {
|
|
make_screen_movie_list(ret.data, page)
|
|
// observer.observe();
|
|
} else if (type === "theater") {
|
|
make_screen_movie_list(ret.data, page)
|
|
// observer.observe();
|
|
} else {
|
|
make_screen_movie_list(ret.data, page)
|
|
}
|
|
// div_visible = true
|
|
// // console.log(div_visible)
|
|
} else {
|
|
$.notify('<strong>데이터를 불러오지 못했습니다.</strong><br>' + (ret.log || ''), {type: 'danger'});
|
|
}
|
|
next_page = page + 1
|
|
}
|
|
})
|
|
}
|
|
|
|
// Common card HTML generator to ensure consistency
|
|
function generate_card_html(item, linkUrl) {
|
|
let tmp = '<div class="anime-card-wrapper">';
|
|
tmp += '<div class="card glass-card w-100 border-0 h-100">';
|
|
tmp += '<div class="position-relative overflow-hidden" style="border-radius: 12px 12px 0 0;">';
|
|
|
|
// Image with hover effect wrapper
|
|
tmp += '<div class="img-wrapper">';
|
|
tmp += '<img class="card-img-top lazyload" src="../static/img_loader_x200.svg" data-original="' + item.image_link + '" style="cursor: pointer; aspect-ratio: 2/3; object-fit: cover;" onclick="location.href=\'' + linkUrl + '\'"/>';
|
|
tmp += '</div>'; // End img-wrapper
|
|
|
|
tmp += '</div>'; // End relative container
|
|
|
|
tmp += '<div class="card-body p-3 d-flex flex-column">';
|
|
|
|
// Title
|
|
tmp += '<h6 class="card-title text-white font-weight-bold mb-2 text-truncate" title="' + item.title + '">' + item.title + '</h6>';
|
|
|
|
// Code & Heart Button Row
|
|
tmp += '<div class="d-flex justify-content-between align-items-center mt-auto mb-3">';
|
|
tmp += '<span class="badge badge-secondary opacity-75 small">' + item.code + '</span>';
|
|
tmp += '<button id="add_whitelist" name="add_whitelist" class="btn btn-sm btn-circle btn-outline-danger border-0" data-code="' + item.code + '" title="스케쥴링 추가"><i class="bi bi-heart-fill"></i></button>';
|
|
tmp += '</div>';
|
|
|
|
// Action Button
|
|
tmp += '<a href="' + linkUrl + '" class="btn btn-primary btn-sm btn-block shadow-sm">상세보기</a>';
|
|
|
|
tmp += '</div>'; // End card-body
|
|
tmp += '</div>'; // End card
|
|
tmp += '</div>'; // End wrapper
|
|
return tmp;
|
|
}
|
|
|
|
function make_airing_list(data, page) {
|
|
if (!data || !data.anime_list) {
|
|
console.error("Invalid data received for airing list:", data);
|
|
$.notify('<strong>데이터를 불러오지 못했습니다.</strong>', {type: 'danger'});
|
|
return;
|
|
}
|
|
let str = ''
|
|
|
|
str += '<div class="d-flex justify-content-between align-items-center mb-3">';
|
|
str += '<h5 class="text-white font-weight-bold border-left pl-3" style="border-width: 4px !important; border-color: #00d4ff !important;">방영중 애니메이션</h5>';
|
|
str += '<button type="button" class="btn btn-sm btn-dark rounded-pill px-3">Page <span class="badge badge-warning ml-1">' + page + '</span></button>';
|
|
str += '</div>';
|
|
|
|
str += '<div id="inner_screen_movie" class="anime-grid infinite-scroll">';
|
|
for (let i in data.anime_list) {
|
|
let item = data.anime_list[i];
|
|
let request_url = './request?code=' + item.code;
|
|
str += generate_card_html(item, request_url);
|
|
}
|
|
str += '</div>';
|
|
|
|
str += m_hr_black();
|
|
|
|
if (page > 1) {
|
|
const temp = document.createElement('div')
|
|
temp.innerHTML = str;
|
|
while (temp.firstChild) {
|
|
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
|
}
|
|
page++
|
|
} else {
|
|
document.getElementById("screen_movie_list").innerHTML = str;
|
|
}
|
|
|
|
$("img.lazyload").lazyload({
|
|
threshold: 10,
|
|
effect: "fadeIn",
|
|
});
|
|
}
|
|
|
|
function make_search_result_list(data, page) {
|
|
if (!data || !data.anime_list) {
|
|
console.error("Invalid data received for search result list:", data);
|
|
$.notify('<strong>검색 결과를 불러오지 못했습니다.</strong>', {type: 'danger'});
|
|
return;
|
|
}
|
|
let str = ''
|
|
let list = data.anime_list || [];
|
|
|
|
str += '<div class="d-flex justify-content-between align-items-center mb-3">';
|
|
str += '<h5 class="text-white font-weight-bold border-left pl-3" style="border-width: 4px !important; border-color: #ff007f !important;">검색 결과</h5>';
|
|
str += '<button type="button" class="btn btn-sm btn-dark rounded-pill px-3">Page <span class="badge badge-warning ml-1">' + page + '</span></button>';
|
|
str += '</div>';
|
|
|
|
str += '<div id="inner_screen_movie" class="anime-grid infinite-scroll">';
|
|
|
|
for (let i in list) {
|
|
let item = list[i];
|
|
let request_url = './request?code=' + item.code;
|
|
|
|
if (item.wr_id !== '' && item.wr_id !== undefined) {
|
|
const re = /bo_table=([^&]+)/
|
|
const bo_table = item.link.match(re)
|
|
if (bo_table != null) {
|
|
request_url += '&wr_id=' + item.wr_id + '&bo_table=' + bo_table[1];
|
|
}
|
|
}
|
|
|
|
str += generate_card_html(item, request_url);
|
|
}
|
|
str += '</div>';
|
|
str += m_hr_black();
|
|
|
|
if (page > 1) {
|
|
const temp = document.createElement('div')
|
|
temp.innerHTML = str;
|
|
while (temp.firstChild) {
|
|
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
|
}
|
|
page++
|
|
} else {
|
|
document.getElementById("screen_movie_list").innerHTML = str;
|
|
}
|
|
}
|
|
|
|
function make_screen_movie_list(data, page) {
|
|
if (!data || !data.anime_list) {
|
|
console.error("Invalid data received for screen movie list:", data);
|
|
return;
|
|
}
|
|
let str = '';
|
|
|
|
str += '<div class="d-flex justify-content-between align-items-center mb-3">';
|
|
let title = current_cate === 'movie' ? '극장판' : (current_cate === 'theater' ? '극장판(구)' : '완결 애니메이션');
|
|
if (current_sca) title += ' (' + current_sca + ')';
|
|
str += '<h5 class="text-white font-weight-bold border-left pl-3" style="border-width: 4px !important; border-color: #ffd700 !important;">' + title + '</h5>';
|
|
str += '<button type="button" class="btn btn-sm btn-dark rounded-pill px-3">Page <span class="badge badge-warning ml-1">' + page + '</span></button>';
|
|
str += '</div>';
|
|
|
|
str += '<div id="inner_screen_movie" class="anime-grid infinite-scroll">';
|
|
for (let i in data.anime_list) {
|
|
let item = data.anime_list[i];
|
|
let request_url = './request?code=' + item.code;
|
|
|
|
str += generate_card_html(item, request_url);
|
|
}
|
|
str += '</div>';
|
|
str += m_hr_black();
|
|
|
|
if (page > 1) {
|
|
const temp = document.createElement('div')
|
|
temp.innerHTML = str;
|
|
while (temp.firstChild) {
|
|
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
|
}
|
|
page++
|
|
} else {
|
|
document.getElementById("screen_movie_list").innerHTML = str;
|
|
}
|
|
$("img.lazyload").lazyload({
|
|
threshold: 10,
|
|
effect: "fadeIn",
|
|
});
|
|
}
|
|
|
|
|
|
$(document).ready(function () {
|
|
// Force parent container to be fluid to allow full width
|
|
$("#main_container").removeClass("container").addClass("container-fluid");
|
|
|
|
// if ( "{{arg['anilife_current_code']}}" !== "" ) {
|
|
// document.getElementById("code").value = "{{arg['anilife_current_code']}}";
|
|
// // 값이 공백이 아니면 분석 버튼 계속 누름
|
|
// document.getElementById("analysis_btn").click();
|
|
// }
|
|
$("#input_search").keydown(function (key) {
|
|
if (key.keyCode === 13) {
|
|
$("#btn_search").trigger("click");
|
|
}
|
|
})
|
|
|
|
get_anime_list("ing", 1)
|
|
|
|
|
|
const observer = lozad('.lozad', {
|
|
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
|
threshold: 0.1, // ratio of element convergence
|
|
enableAutoReload: true // it will reload the new image when validating attributes changes
|
|
});
|
|
observer.observe();
|
|
|
|
});
|
|
|
|
$("body").on("click", "#btn_search", function (e) {
|
|
e.preventDefault();
|
|
let query = $("#input_search").val();
|
|
// console.log(query);
|
|
current_cate = "search"
|
|
current_query = query
|
|
|
|
if ($("#input_search").val() === "") {
|
|
// console.log("search keyword nothing");
|
|
return false;
|
|
}
|
|
|
|
$('#ajax_loader').show();
|
|
$.ajax({
|
|
url: "/" + package_name + "/ajax/" + sub + "/search",
|
|
type: "POST",
|
|
cache: false,
|
|
global: false,
|
|
data: {query: query, type: current_cate, page: page},
|
|
// dataType: "json",
|
|
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
|
|
complete: () => {
|
|
$('#ajax_loader').hide();
|
|
},
|
|
success: function (ret) {
|
|
if (ret.ret) {
|
|
// console.log('ret:::', ret)
|
|
make_search_result_list(ret.data, 1);
|
|
next_page = page + 1
|
|
} else {
|
|
$.notify("<strong>분석 실패</strong><br>" + ret.log, {
|
|
type: "warning",
|
|
});
|
|
}
|
|
},
|
|
});
|
|
});
|
|
|
|
// Category button active state handling
|
|
function updateActiveButton(id) {
|
|
$('#anime_category button').removeClass('active btn-success btn-light btn-primary text-dark');
|
|
$('#anime_category button#ing').addClass('btn-outline-success');
|
|
$('#anime_category button#fin').addClass('btn-outline-light');
|
|
$('#anime_category button#theater').addClass('btn-outline-primary');
|
|
|
|
const btn = $('#' + id);
|
|
btn.addClass('active');
|
|
if (id === 'ing') btn.removeClass('btn-outline-success').addClass('btn-success');
|
|
else if (id === 'fin') btn.removeClass('btn-outline-light').addClass('btn-light text-dark');
|
|
else if (id === 'theater') btn.removeClass('btn-outline-primary').addClass('btn-primary');
|
|
}
|
|
|
|
$('#anime_category #ing').on("click", function () {
|
|
updateActiveButton('ing');
|
|
get_anime_list("ing", 1)
|
|
})
|
|
|
|
$('#anime_category #fin').on("click", function () {
|
|
updateActiveButton('fin');
|
|
$('#year_filter_row').fadeIn();
|
|
get_anime_list("fin", 1, current_sca)
|
|
})
|
|
|
|
$('#year_category button').on("click", function() {
|
|
$('#year_category button').removeClass('active btn-secondary').addClass('btn-outline-secondary');
|
|
$(this).removeClass('btn-outline-secondary').addClass('active btn-secondary');
|
|
current_sca = $(this).data('sca');
|
|
get_anime_list("fin", 1, current_sca);
|
|
});
|
|
|
|
$('#anime_category #ing, #anime_category #theater').on("click", function() {
|
|
$('#year_filter_row').hide();
|
|
});
|
|
|
|
$('#anime_category #theater').on("click", function () {
|
|
updateActiveButton('theater');
|
|
get_anime_list("theater", 1)
|
|
})
|
|
|
|
// 분석 버튼 클릭시 호출
|
|
$("body").on('click', '#analysis_btn', function (e) {
|
|
e.preventDefault();
|
|
const code = document.getElementById("code").value
|
|
// console.log(code)
|
|
$('#ajax_loader').show();
|
|
$.ajax({
|
|
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
|
type: "POST",
|
|
cache: false,
|
|
global: false,
|
|
data: {code: code},
|
|
dataType: "json",
|
|
complete: () => {
|
|
$('#ajax_loader').hide();
|
|
},
|
|
success: function (ret) {
|
|
if (ret.ret === 'success' && ret.data != null) {
|
|
// // console.log(ret.code)
|
|
// console.log(ret.data)
|
|
make_program(ret.data)
|
|
} else {
|
|
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$("body").on('click', '#go_anilife_btn', function (e) {
|
|
e.preventDefault();
|
|
window.open("{{arg['anilife_url']}}", "_blank");
|
|
});
|
|
|
|
$("body").on("click", "#add_whitelist", function (e) {
|
|
e.preventDefault();
|
|
let data_code = $(this).attr("data-code");
|
|
// console.log(data_code);
|
|
$.ajax({
|
|
url: "/" + package_name + "/ajax/" + sub + "/add_whitelist",
|
|
type: "POST",
|
|
cache: false,
|
|
data: JSON.stringify({data_code: data_code}),
|
|
contentType: "application/json;charset=UTF-8",
|
|
dataType: "json",
|
|
success: function (ret) {
|
|
if (ret.ret) {
|
|
$.notify("<strong>추가하였습니다.</strong><br>", {
|
|
type: "success",
|
|
});
|
|
// make_program(ret);
|
|
} else {
|
|
$.notify("<strong>추가 실패</strong><br>" + ret.log, {
|
|
type: "warning",
|
|
});
|
|
}
|
|
},
|
|
});
|
|
});
|
|
|
|
$("body").on('click', '#all_check_on_btn', function (e) {
|
|
e.preventDefault();
|
|
$('input[id^="checkbox_"]').bootstrapToggle('on')
|
|
});
|
|
|
|
$("body").on('click', '#all_check_off_btn', function (e) {
|
|
e.preventDefault();
|
|
$('input[id^="checkbox_"]').bootstrapToggle('off')
|
|
});
|
|
|
|
$("body").on('click', '#add_queue_btn', function (e) {
|
|
e.preventDefault();
|
|
data = current_data.episode[$(this).data('idx')];
|
|
// console.log('data:::>', data)
|
|
$.ajax({
|
|
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
|
type: "POST",
|
|
cache: false,
|
|
data: {data: JSON.stringify(data)},
|
|
dataType: "json",
|
|
success: function (data) {
|
|
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist' || data.ret == 'enqueue_gdm_success') {
|
|
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
|
|
} else if (data.ret == 'queue_exist') {
|
|
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
|
|
} else if (data.ret == 'db_completed') {
|
|
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
|
|
} else {
|
|
$.notify('<strong>추가 실패</strong><br>' + data.log, {type: 'warning'});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// const observer = lozad();
|
|
// const el = document.querySelector('img');
|
|
// const observer = lozad(el); // passing a `NodeList` (e.g. `document.querySelectorAll()`) is also valid
|
|
// observer.observe();
|
|
const loadNextAnimes = (cate, page) => {
|
|
// spinner.style.display = "block";
|
|
let data = {type: cate, page: String(page)};
|
|
if (current_sca) data.sca = current_sca;
|
|
let url = ''
|
|
switch (cate) {
|
|
case 'ing':
|
|
url = '/' + package_name + '/ajax/' + sub + '/anime_list'
|
|
current_cate = 'ing'
|
|
break;
|
|
case 'movie':
|
|
url = '/' + package_name + '/ajax/' + sub + '/screen_movie_list'
|
|
current_cate = 'movie'
|
|
break;
|
|
case 'theater':
|
|
url = '/' + package_name + '/ajax/' + sub + '/anime_list'
|
|
current_cate = 'theater'
|
|
break;
|
|
case 'fin':
|
|
url = '/' + package_name + '/ajax/' + sub + '/complete_list'
|
|
current_cate = 'fin'
|
|
break
|
|
case 'search':
|
|
url = "/" + package_name + "/ajax/" + sub + "/search"
|
|
current_cate = 'search'
|
|
data.query = current_query
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
$('#ajax_loader').show();
|
|
fetch(url, {
|
|
method: "POST",
|
|
cache: "no-cache",
|
|
headers: {
|
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
},
|
|
body: new URLSearchParams(data),
|
|
})
|
|
.then((res) => res.json())
|
|
.then((response) => {
|
|
// // console.log("Success:", JSON.stringify(response));
|
|
// {#imagesContainer.appendChild()#}
|
|
// console.log("return page:::> ", String(response.page));
|
|
// {#page = response.page#}
|
|
if (current_cate === 'search') {
|
|
make_search_result_list(response.data, response.page);
|
|
|
|
} else {
|
|
make_screen_movie_list(response.data, response.page);
|
|
}
|
|
page++;
|
|
next_page++;
|
|
})
|
|
.catch((error) => console.error("Error:", error))
|
|
.finally(() => {
|
|
$('#ajax_loader').hide();
|
|
});
|
|
};
|
|
|
|
|
|
const onScroll = (e) => {
|
|
console.dir(e.target.scrollingElement.scrollHeight);
|
|
const {scrollTop, scrollHeight, clientHeight} = e.target.scrollingElement;
|
|
if (Math.round(scrollHeight - scrollTop) <= clientHeight) {
|
|
// document.getElementById("spinner").style.display = "block";
|
|
// console.log("loading");
|
|
// console.log("now page::> ", page);
|
|
// console.log("next_page::> ", String(next_page));
|
|
loadNextAnimes(current_cate, next_page);
|
|
}
|
|
};
|
|
|
|
const debounce = (func, delay) => {
|
|
let timeoutId = null;
|
|
return (...args) => {
|
|
clearTimeout(timeoutId);
|
|
timeoutId = setTimeout(func.bind(null, ...args), delay);
|
|
};
|
|
};
|
|
|
|
document.addEventListener("scroll", debounce(onScroll, 300));
|
|
</script>
|
|
<style>
|
|
/* Responsive Grid System */
|
|
|
|
/* Responsive Grid System */
|
|
.anime-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
|
gap: 20px;
|
|
width: 100%;
|
|
}
|
|
|
|
.anime-card-wrapper {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
/* Adjust for smaller screens */
|
|
@media (max-width: 576px) {
|
|
.anime-grid {
|
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
gap: 15px;
|
|
}
|
|
}
|
|
|
|
|
|
.glass-card:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
|
|
border-color: rgba(96, 165, 250, 0.5) !important;
|
|
}
|
|
|
|
/* Image Wrapper for Hover Zoom */
|
|
.img-wrapper {
|
|
overflow: hidden;
|
|
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
}
|
|
|
|
.img-wrapper img {
|
|
transition: transform 0.5s ease;
|
|
}
|
|
|
|
.glass-card:hover .img-wrapper img {
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
/* Card Text Readability Improvements */
|
|
.glass-card .card-body {
|
|
background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.8) 100%) !important;
|
|
}
|
|
|
|
.glass-card .card-title {
|
|
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
|
|
font-size: 1rem !important;
|
|
letter-spacing: 0.02em !important;
|
|
color: #fff !important;
|
|
}
|
|
|
|
.glass-card .card-body .badge,
|
|
.glass-card .badge.badge-secondary {
|
|
background: #475569 !important;
|
|
color: #f1f5f9 !important;
|
|
font-weight: 600 !important;
|
|
padding: 0.4em 0.7em !important;
|
|
font-size: 0.72rem !important;
|
|
max-width: 140px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
opacity: 1 !important;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
/* Category Buttons */
|
|
.btn-pill {
|
|
border-radius: 50rem !important;
|
|
font-weight: 600;
|
|
border-width: 2px;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.btn-pill:hover, .btn-pill:focus, .btn-pill.active {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
|
|
}
|
|
|
|
/* Modern Premium Preloader */
|
|
.loader-bg {
|
|
position: fixed;
|
|
top: 0; left: 0; width: 100%; height: 100%;
|
|
background: #0f172a;
|
|
display: flex; align-items: center; justify-content: center;
|
|
z-index: 10000;
|
|
}
|
|
|
|
.modern-loader {
|
|
position: relative;
|
|
width: 120px; height: 120px;
|
|
display: flex; align-items: center; justify-content: center;
|
|
}
|
|
|
|
.spinner-ring {
|
|
position: absolute;
|
|
width: 100%; height: 100%;
|
|
border: 4px solid transparent;
|
|
border-top-color: #3b82f6;
|
|
border-radius: 50%;
|
|
animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
}
|
|
|
|
.spinner-ring:nth-child(2) { border-top-color: #00d4ff; animation-delay: -0.3s; width: 80%; height: 80%; }
|
|
.spinner-ring:nth-child(3) { border-top-color: #fbbf24; animation-delay: -0.6s; width: 60%; height: 60%; }
|
|
|
|
.loader-text {
|
|
position: absolute;
|
|
bottom: -40px;
|
|
color: #94a3b8;
|
|
font-size: 14px;
|
|
font-weight: 700;
|
|
letter-spacing: 2px;
|
|
text-transform: uppercase;
|
|
animation: pulse 1.5s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
|
|
|
|
/* AJAX Global Spinner */
|
|
.ajax-loader-container {
|
|
position: fixed;
|
|
top: 50%; left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
z-index: 9999;
|
|
background: rgba(15, 23, 42, 0.8);
|
|
backdrop-filter: blur(8px);
|
|
padding: 25px;
|
|
border-radius: 20px;
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.ajax-spinner {
|
|
width: 50px; height: 50px;
|
|
border: 4px solid rgba(59, 130, 246, 0.1);
|
|
border-left-color: #3b82f6;
|
|
border-radius: 50%;
|
|
animation: spin 0.8s linear infinite;
|
|
}
|
|
|
|
/* Scrollbar */
|
|
::-webkit-scrollbar {
|
|
width: 8px;
|
|
}
|
|
::-webkit-scrollbar-track {
|
|
background: #0f172a;
|
|
}
|
|
::-webkit-scrollbar-thumb {
|
|
background: #475569;
|
|
border-radius: 4px;
|
|
}
|
|
::-webkit-scrollbar-thumb:hover {
|
|
background: #64748b;
|
|
}
|
|
|
|
/* Utilities */
|
|
.cut-text {
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.btn-circle {
|
|
width: 32px;
|
|
height: 32px;
|
|
padding: 0;
|
|
border-radius: 50%;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
</style>
|
|
<link href="{{ url_for('.static', filename='css/bootstrap.min.css') }}" type="text/css" rel="stylesheet" />
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
|
|
|
|
<style>
|
|
/* Smooth Load Transition */
|
|
.content-cloak,
|
|
#menu_module_div,
|
|
#menu_page_div {
|
|
opacity: 0;
|
|
transition: opacity 0.5s ease-out;
|
|
}
|
|
|
|
/* Staggered Delays for Natural Top-Down Flow */
|
|
#menu_module_div.visible {
|
|
opacity: 1;
|
|
transition-delay: 0ms;
|
|
}
|
|
|
|
#menu_page_div.visible {
|
|
opacity: 1;
|
|
transition-delay: 150ms;
|
|
}
|
|
|
|
.content-cloak.visible {
|
|
opacity: 1;
|
|
transition-delay: 300ms;
|
|
}
|
|
|
|
</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>
|
|
<style>
|
|
/* Mobile Margin Fix */
|
|
@media (max-width: 768px) {
|
|
body { overflow-x: hidden !important; padding: 0 !important; margin: 0 !important; }
|
|
.container, .container-fluid, .row, form, #program_list, #program_auto_form, #episode_list, .queue-container, #ohli24_search_wrapper, #main_container {
|
|
width: 100% !important; max-width: 100% !important;
|
|
padding-left: 4px !important; padding-right: 4px !important;
|
|
margin-left: 0 !important; margin-right: 0 !important;
|
|
box-sizing: border-box !important;
|
|
}
|
|
.form-group, .form-inline, [class*="col-"] {
|
|
flex: 0 0 100% !important; max-width: 100% !important; width: 100% !important;
|
|
padding-left: 0 !important; padding-right: 0 !important;
|
|
}
|
|
.row { margin-left: 0 !important; margin-right: 0 !important; }
|
|
.card, .card.p-4, .card.p-lg-5, .card.border-light {
|
|
width: calc(100% - 8px) !important; max-width: 100% !important;
|
|
padding: 8px !important; margin: 4px !important;
|
|
border-radius: 12px !important; box-sizing: border-box !important;
|
|
}
|
|
.badge {
|
|
white-space: normal !important; text-align: left !important;
|
|
line-height: 1.4 !important; height: auto !important; display: inline-block !important;
|
|
}
|
|
}
|
|
</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 %}
|