Skip to content

Instantly share code, notes, and snippets.

@robot00f
Last active October 20, 2024 15:15
Show Gist options
  • Save robot00f/a4ce0cbf073bd9cd504a3c0c33d0987c to your computer and use it in GitHub Desktop.
Save robot00f/a4ce0cbf073bd9cd504a3c0c33d0987c to your computer and use it in GitHub Desktop.

Revisions

  1. robot00f revised this gist Oct 20, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Filmaffinity old.js
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@
    // Ajustar la altura del contenedor .card-cast-debug
    var cardCastDebug = document.querySelector('.z-movie #left-column .movie-info .card-cast-debug');
    if (cardCastDebug) {
    cardCastDebug.style.height = '49px'; // Establecer la altura a 49px
    cardCastDebug.style.height = '58px'; // Establecer la altura a 58px
    }

    if (slickTrack) {
  2. robot00f revised this gist Sep 30, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Filmaffinity old.js
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@
    // @version 0.3
    // @description Filmaffinity old
    // @author You
    // @updateURL https://gist.github.com/robot00f/a4ce0cbf073bd9cd504a3c0c33d0987c/raw/5017348ec45d392a62962268fbbe7f1344d4b645/Filmaffinity%2520old.js
    // @downloadURL https://gist.github.com/robot00f/a4ce0cbf073bd9cd504a3c0c33d0987c/raw/5017348ec45d392a62962268fbbe7f1344d4b645/Filmaffinity%2520old.js
    // @match https://www.filmaffinity.com/*/film*
    // @grant none
    // ==/UserScript==
  3. robot00f renamed this gist Sep 30, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. robot00f created this gist Sep 30, 2024.
    58 changes: 58 additions & 0 deletions Filmaffinity old
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    // ==UserScript==
    // @name Filmaffinity old
    // @namespace http://tampermonkey.net/
    // @version 0.3
    // @description Filmaffinity old
    // @author You
    // @match https://www.filmaffinity.com/*/film*
    // @grant none
    // ==/UserScript==

    (function() {
    'use strict';

    // Seleccionar el contenedor principal que tiene la lista de actores
    var slickTrack = document.querySelector('.credits-scroller .slick-track');

    // Ajustar la altura del contenedor .card-cast-debug
    var cardCastDebug = document.querySelector('.z-movie #left-column .movie-info .card-cast-debug');
    if (cardCastDebug) {
    cardCastDebug.style.height = '49px'; // Establecer la altura a 49px
    }

    if (slickTrack) {
    // Obtener todos los elementos <li> que contienen los actores
    var actorItems = slickTrack.querySelectorAll('li[itemprop="actor"]');

    // Crear un nuevo elemento contenedor para los nombres
    var namesContainer = document.createElement('div');
    namesContainer.classList.add('names-container');
    namesContainer.style.display = 'inline-flex'; // Estilo para mostrar los nombres en línea
    namesContainer.style.flexWrap = 'wrap'; // Permitir que los nombres se envuelvan en caso de ser muchos

    // Extraer los nombres de los actores y concatenarlos
    var concatenatedNames = Array.from(actorItems).map(function(actorItem) {
    var nameElement = actorItem.querySelector('.name');
    return nameElement ? nameElement.textContent.trim() : '';
    }).join(', ');

    // Asignar la cadena de nombres al contenedor
    namesContainer.textContent = concatenatedNames;

    // Insertar el contenedor de nombres después del contenedor de actores
    slickTrack.parentNode.insertBefore(namesContainer, slickTrack.nextSibling);

    // Eliminar el contenedor de las imágenes de actores
    slickTrack.parentNode.removeChild(slickTrack);

    // Eliminar la flecha de navegación derecha si existe
    var arrowRight = document.querySelector('.arrow-right.slick-arrow');
    if (arrowRight) {
    arrowRight.remove();
    }

    // Permitir la selección y copia de los nombres
    namesContainer.style.userSelect = 'text';
    }

    })();