Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JeroenVdb/07df4bef7d1d3c0516c85184ac33e5b5 to your computer and use it in GitHub Desktop.
Save JeroenVdb/07df4bef7d1d3c0516c85184ac33e5b5 to your computer and use it in GitHub Desktop.
Liquipedia Spoiler Hider
// ==UserScript==
// @name Liquipedia Spoiler Hider
// @namespace www.jeroenvdb.be
// @description Hides CS2 tournament spoilers on the Liquipedia
// @include https://liquipedia.net/*
// @version 1.0
// @grant none
// @copyright Jeroen Van den Berghe
// @license MIT License
// ==/UserScript==
(function() {
addGlobalStyle(
`
/* Rounds, matches, score cell */
.brkts-matchlist-score .brkts-matchlist-cell-content:not(:empty) {
filter: blur(5px);
background-color: #ccc;
font-weight: normal;
}
/* Rounds, matches, winner cell */
.brkts-matchlist-slot-winner {
background-color: unset;
font-weight: normal
}
/* Results Overview table */
.swisstable {
filter: blur(5px);
background-color: #ccc;
font-weight: normal;
}
/* Price pool table*/
.prizepooltable {
filter: blur(5px);
background-color: #ccc;
font-weight: normal;
}
.prizepooltable .name {
display: none;
}
.prizepooltable .name:after {
content: "Team Name";
}
/* Results Overview table: up, stayup, stay, down, drop */
.bg-u, .bg-up, .bg-proceed, .bg-win,
.swisstable-bgc-win, .swisstable-bgc-lose
.bg-su, .bg-stayup,
.bg-s, .bg-stay,
.bg-sd, .bg-staydown,
.bg-d, .bg-down, .bg-drop {
background-color: unset !important;
}
/* Results Overview table: lose and win cells */
.swisstable-bgc-win, .swisstable-bgc-lose {
background-color: unset !important;
}
/* Results Overview table: names and scores */
.team-template-image-icon {
display: none;
}
.team-template-text {
filter: blur(5px);
background-color: #ccc;
font-weight: normal;
}
.team-template-text > a {
display: none;
}
.team-template-text:after {
content: "Team Name";
}
/* Popup: scores */
.brkts-popup-header-opponent-score-left, .brkts-popup-header-opponent-score-right {
filter: blur(5px);
background-color: #ccc;
font-weight: normal;
}
.brkts-popup-body-game table {
display: none;
}
.brkts-cs-score-color-t, .brkts-cs-score-color-ct {
color: unset !important;
}
.brkts-popup-spaced-map-skip > a {
text-decoration: unset !important;
}
.fa-check {
display: none;
}
.brkts-popup-winloss-icon {
display: none;
}
.brkts-popup s {
text-decoration: none !important;
}
/* brackets */
.brkts-opponent-entry-left {
font-weight: normal;
}
.team-template-team-icon {
display: none !important;
}
.brkts-opponent-score-inner {
filter: blur(5px);
background-color: #ccc;
font-weight: normal;
}
[title="Watch Game 2"],
[title="Watch Game 3"],
[title="Watch Game 4"],
[title="Watch Game 5"],
[title="Stats on HLTV for Game 2"],
[title="Stats on HLTV for Game 3"],
[title="Stats on HLTV for Game 4"],
[title="Stats on HLTV for Game 5"] {
display: none !important;
}
.brkts-popup-body-game {
display: block !important;
}
.team-name-mask {
display: none;
}
.team-name-mask:after {
content: "Team Name";
}
`)
})();
document.querySelectorAll('.brkts-match').forEach(match => {
const hasNoScores = match.querySelectorAll('.brkts-opponent-score-inner:empty').length > 0;
if (hasNoScores) {
match.querySelectorAll('.block-team').forEach(team => {
team.innerText = 'Winner previous bracket'
})
}
})
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment