Giter Site home page Giter Site logo

badhost's Introduction

What.CD Bad Covers Collage Edition

Highlights all album covers in a collage not on a whitelisted host.

screenshot

About

This simply uses a red border to highlight album cover images which aren't hosted on WhatIMG (or any other domain on the script's whitelist). You will still need to click through to the album page if you want to rehost them. This should handle any of the options in the "Collage album covers to show per page" user setting (the bit of code that does could come in handy for those who wish to make collage-oriented scripts). It doesn't do anything for an album with no cover image.

It has been tested successfully in Chrome, and at least two users have had it work in Firefox.

Limitations

The border is inside the image, so it does cover a bit of the album cover. I ended up doing it this way because having the border on the outside was causing funky overlap issues when bad host images were next to good host ones, and the border was getting cut off at the edges of the grid due to CSS overflow parameters. Unfortunately, using a border means it's a little hard to tell if some images are bad-hosted or not if they're in the middle of a bunch of others that are (the middle image in the screenshot being a good example).

Experimenting

If you want to experiment with using a base64-encoded image to replace a bad-hosted album cover, just replace the two .style lines with this code snippet:

imgElement.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAB2Ag


> `MAAABgyY+CAAAABGdBTUEAALGPC/xhBQAAAAlQTFRFAAAA7Rwk////o0`
> `eFZAAAADVJREFUSMdjYBhIEIobBIxKD1LpqFVYwNRR6VHpUelR6VHpU`
> `elR6VHpUekRIT3aRh5c0gMHAADLOmi/TeqmAAAAAElFTkSuQmCC";`
> `// MSPaint to make a 118x118 image,`
> `// shrunk with http://tinypng.org/,`
> `// converted with http://www.base64-image.de/`

(The long string was screwing up the line wrapping of the README, so I put in some line breaks -- be sure to remove those!).

Discuss It / Install It

Discuss the script here; for a 1-click install, find it on UserScripts here.

badhost's People

Contributors

wingman4l7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.