Skip to content

Instantly share code, notes, and snippets.

@klim0824
Last active March 15, 2025 16:20
Show Gist options
  • Select an option

  • Save klim0824/b69f6d79d5d97a628546eff20babc3c3 to your computer and use it in GitHub Desktop.

Select an option

Save klim0824/b69f6d79d5d97a628546eff20babc3c3 to your computer and use it in GitHub Desktop.
moviewalker.jpの映画一覧でカルーセル解除したり、キャプション追加したり、重複した映画は視認性下げたり
// ==UserScript==
// @name Add Caption to Movie Poster
// @namespace https://moviewalker.jp/theater/tokyo/
// @version 2025-03-09
// @description Add caption below movie poster and reduce opacity for duplicates
// @author You
// @match https://press.moviewalker.jp/theater/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=moviewalker.jp
// @grant none
// @noframes
// ==/UserScript==
(function() {
'use strict';
const seenAlts = new Map();
document.querySelectorAll('.bl_mvPosterListItem_wrapper').forEach(wrapper => {
wrapper.style.flexWrap = 'wrap';
wrapper.style.rowGap = '8px';
wrapper.querySelectorAll('.bl_mvPosterListItem').forEach(item => {
item.style.display = 'flex';
item.style.flexDirection = 'column';
item.style.height = 'auto';
item.style.fontSize = '12px';
const img = item.querySelector('img');
const noImage = item.querySelector('.hp_poster_noImage');
const altText = img ? img.alt : noImage?.querySelector('span')?.textContent.trim();
if (altText) {
if (seenAlts.has(altText)) {
item.style.height = '100px';
item.style.opacity = '0.1';
if (noImage) {
item.style.opacity = '0.4';
}
} else {
item.style.opacity = '1';
item.style.order = '-1';
seenAlts.set(altText, true);
}
}
if (img && !item.querySelector('.bl_mvPosterListItem__caption')) {
const caption = document.createElement('div');
caption.textContent = altText;
caption.className = 'bl_mvPosterListItem__caption';
item.appendChild(caption);
}
if (noImage) {
noImage.style.alignItems = 'flex-start';
noImage.style.background = 'none';
}
});
});
document.querySelectorAll('.un_affiBtn').forEach(btn => {
btn.style.display = 'none';
});
const theatersToHide = new Set([
'109シネマズプレミアム新宿'
]);
document.querySelectorAll('.un_theaterLists_list_one').forEach(theater => {
const theaterName = theater.querySelector('.un_theater_name h2');
if (theaterName && theatersToHide.has(theaterName.textContent.trim())) {
theater.style.display = 'none';
}
// .bl_mvPosterList を含まない場合は非表示
if (!theater.querySelector('.bl_mvPosterList')) {
theater.style.display = 'none';
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment