tiles compl

This commit is contained in:
2026-06-01 20:11:59 +05:30
parent 973745bcd8
commit a27147328a

View File

@@ -73,10 +73,24 @@
background: transparent !important;
background-color: transparent !important;
border: 0 !important;
box-shadow: inset 0 0 0 2px var(--politictalk-tile-border-color, rgba(179, 165, 228, 0.72)) !important;
box-shadow: none !important;
box-sizing: border-box !important;
}
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-themed-tile::after {
border: 2px solid var(--politictalk-tile-border-color, rgba(179, 165, 228, 0.72)) !important;
border-radius: 3px !important;
bottom: 2px;
box-sizing: border-box !important;
content: "";
left: 0;
pointer-events: none;
position: absolute;
right: 0;
top: 0;
z-index: 12;
}
html:not(.politictalk-direct-access-blocked) #videospace #largeVideoContainer,
html:not(.politictalk-direct-access-blocked) #videospace #largeVideoContainer.politictalk-themed-tile,
html:not(.politictalk-direct-access-blocked) #videospace .filmstrip,
@@ -1282,9 +1296,20 @@
return;
}
if (element.style.getPropertyValue(property) === value
&& element.style.getPropertyPriority(property) === 'important') {
return;
}
element.style.setProperty(property, value, 'important');
}
function addPoliticTalkClass(element, className) {
if (element && element.classList && !element.classList.contains(className)) {
element.classList.add(className);
}
}
function getPoliticTalkNumericStyle(element, property, fallback) {
if (!element) {
return fallback;
@@ -1547,39 +1572,28 @@
return;
}
videospace.querySelectorAll(
'.politictalk-themed-tile, .politictalk-tile-transparent-layer, .politictalk-avatar-shell, .politictalk-avatar-themed'
).forEach(function(element) {
element.classList.remove(
'politictalk-themed-tile',
'politictalk-tile-transparent-layer',
'politictalk-avatar-shell',
'politictalk-avatar-themed'
);
});
var tiles = getPoliticTalkTileCandidates(videospace);
applyPoliticTalkTileLayout(videospace, tiles);
tiles.forEach(function(tile) {
tile.classList.add('politictalk-themed-tile');
addPoliticTalkClass(tile, 'politictalk-themed-tile');
tile.querySelectorAll('div, span').forEach(function(candidate) {
if (isPoliticTalkAvatarShell(candidate, tile)) {
var initialsTarget = getPoliticTalkInitialsAvatarTarget(candidate);
candidate.classList.add('politictalk-avatar-shell');
addPoliticTalkClass(candidate, 'politictalk-avatar-shell');
if (initialsTarget) {
initialsTarget.classList.add('politictalk-avatar-themed');
addPoliticTalkClass(initialsTarget, 'politictalk-avatar-themed');
}
return;
}
if (isPoliticTalkTransparentTileLayer(candidate, tile)) {
candidate.classList.add('politictalk-tile-transparent-layer');
addPoliticTalkClass(candidate, 'politictalk-tile-transparent-layer');
}
});
});
@@ -1605,10 +1619,7 @@
window.politicTalkTileThemeFrame = window.requestAnimationFrame(applyPoliticTalkTileTheme);
});
window.politicTalkTileThemeObserver.observe(document.body, {
attributes: true,
attributeFilter: [ 'class', 'style' ],
childList: true,
characterData: true,
subtree: true
});