push
This commit is contained in:
+1
-25
@@ -1,37 +1,13 @@
|
||||
/*
|
||||
HOME — hero with search + continue-watching row + trending rows.
|
||||
HOME — continue-watching row + trending rows.
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// quick-search chips in the hero — edit freely
|
||||
const QUICK_SEARCHES = ['Action', 'Comedy', 'Sci-Fi', 'Drama', 'Horror', 'Animation', 'Crime'];
|
||||
|
||||
SR.app.initChrome();
|
||||
|
||||
const sections = document.getElementById('sections');
|
||||
|
||||
const form = document.getElementById('heroForm');
|
||||
const input = document.getElementById('heroInput');
|
||||
if (form && input) {
|
||||
form.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
const q = input.value.trim();
|
||||
location.href = q ? `search.html?q=${encodeURIComponent(q)}` : 'search.html';
|
||||
});
|
||||
}
|
||||
|
||||
const chips = document.getElementById('heroChips');
|
||||
if (chips) {
|
||||
for (const term of QUICK_SEARCHES) {
|
||||
const a = document.createElement('a');
|
||||
a.className = 'chip';
|
||||
a.href = `search.html?q=${encodeURIComponent(term)}`;
|
||||
a.textContent = term;
|
||||
chips.appendChild(a);
|
||||
}
|
||||
}
|
||||
|
||||
const cont = SR.cards.continueRow();
|
||||
if (cont) sections.appendChild(cont);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user