Mattthew
commited on
Commit
•
19a603d
1
Parent(s):
bfddf3a
small bug fix to censoring option
Browse files
index.css
CHANGED
@@ -1224,7 +1224,7 @@ input[type="checkbox"]:checked::before {
|
|
1224 |
}
|
1225 |
|
1226 |
.image-item .censor_message {
|
1227 |
-
opacity:
|
1228 |
position: absolute;
|
1229 |
z-index: 1;
|
1230 |
left: 50%;
|
@@ -1236,8 +1236,8 @@ input[type="checkbox"]:checked::before {
|
|
1236 |
text-shadow: 0px 1px 8px black;
|
1237 |
}
|
1238 |
|
1239 |
-
.image-item .censor_message.
|
1240 |
-
opacity:
|
1241 |
}
|
1242 |
|
1243 |
.image-item .imgBox .img.hidden {
|
|
|
1224 |
}
|
1225 |
|
1226 |
.image-item .censor_message {
|
1227 |
+
opacity: 0;
|
1228 |
position: absolute;
|
1229 |
z-index: 1;
|
1230 |
left: 50%;
|
|
|
1236 |
text-shadow: 0px 1px 8px black;
|
1237 |
}
|
1238 |
|
1239 |
+
.image-item .censor_message.censored {
|
1240 |
+
opacity: 1;
|
1241 |
}
|
1242 |
|
1243 |
.image-item .imgBox .img.hidden {
|
index.js
CHANGED
@@ -374,7 +374,7 @@ function insertArtists() {
|
|
374 |
imgPortrait.src = unloadedImgSrc;
|
375 |
imgLandscape.src = unloadedImgSrc;
|
376 |
var censorMessage = document.createElement('div');
|
377 |
-
censorMessage.classList.add('censor_message'
|
378 |
censorMessage.textContent = 'risqué image hidden';
|
379 |
imgBox0.appendChild(imgArtwork);
|
380 |
imgBox0.appendChild(imgPortrait);
|
@@ -868,9 +868,9 @@ function rotatePromptsImages() {
|
|
868 |
image.classList.remove('hidden');
|
869 |
let censorMessage = image.closest('.imgBox').querySelector('.censor_message');
|
870 |
if(image.classList.contains('censored')) {
|
871 |
-
censorMessage.classList.
|
872 |
} else {
|
873 |
-
censorMessage.classList.
|
874 |
}
|
875 |
});
|
876 |
// switch prev and next button icons
|
@@ -1151,14 +1151,20 @@ function checkAllInCategory(theCheckbox) {
|
|
1151 |
}
|
1152 |
|
1153 |
function blurUnblurCensored() {
|
|
|
1154 |
let images = document.querySelectorAll('.img');
|
1155 |
images.forEach(function(img){
|
1156 |
img.classList.remove('censored');
|
1157 |
});
|
|
|
|
|
|
|
|
|
1158 |
let censored = document.querySelector('input[name="censored"]');
|
1159 |
if(censored.checked) {
|
1160 |
censored.parentNode.classList.remove('warning');
|
1161 |
} else {
|
|
|
1162 |
censored.parentNode.classList.add('warning');
|
1163 |
for (let i=0, il=artistsData.length; i<il; i++) {
|
1164 |
let artist = artistsData[i];
|
@@ -1179,7 +1185,9 @@ function blurUnblurCensored() {
|
|
1179 |
if(artist[0] == lastN && artist[1] == firstN) {
|
1180 |
let box = imageItem.querySelector('.imgBox');
|
1181 |
let image = box.querySelector(blurImage);
|
|
|
1182 |
image.classList.add('censored');
|
|
|
1183 |
break;
|
1184 |
}
|
1185 |
}
|
|
|
374 |
imgPortrait.src = unloadedImgSrc;
|
375 |
imgLandscape.src = unloadedImgSrc;
|
376 |
var censorMessage = document.createElement('div');
|
377 |
+
censorMessage.classList.add('censor_message');
|
378 |
censorMessage.textContent = 'risqué image hidden';
|
379 |
imgBox0.appendChild(imgArtwork);
|
380 |
imgBox0.appendChild(imgPortrait);
|
|
|
868 |
image.classList.remove('hidden');
|
869 |
let censorMessage = image.closest('.imgBox').querySelector('.censor_message');
|
870 |
if(image.classList.contains('censored')) {
|
871 |
+
censorMessage.classList.add('censored');
|
872 |
} else {
|
873 |
+
censorMessage.classList.remove('censored');
|
874 |
}
|
875 |
});
|
876 |
// switch prev and next button icons
|
|
|
1151 |
}
|
1152 |
|
1153 |
function blurUnblurCensored() {
|
1154 |
+
// un-censor all
|
1155 |
let images = document.querySelectorAll('.img');
|
1156 |
images.forEach(function(img){
|
1157 |
img.classList.remove('censored');
|
1158 |
});
|
1159 |
+
let messages = document.querySelectorAll('.censor_message');
|
1160 |
+
messages.forEach(function(censorMesssage){
|
1161 |
+
censorMesssage.classList.remove('censored');
|
1162 |
+
});
|
1163 |
let censored = document.querySelector('input[name="censored"]');
|
1164 |
if(censored.checked) {
|
1165 |
censored.parentNode.classList.remove('warning');
|
1166 |
} else {
|
1167 |
+
// censor some
|
1168 |
censored.parentNode.classList.add('warning');
|
1169 |
for (let i=0, il=artistsData.length; i<il; i++) {
|
1170 |
let artist = artistsData[i];
|
|
|
1185 |
if(artist[0] == lastN && artist[1] == firstN) {
|
1186 |
let box = imageItem.querySelector('.imgBox');
|
1187 |
let image = box.querySelector(blurImage);
|
1188 |
+
let censorMessage = box.querySelector('.censor_message');
|
1189 |
image.classList.add('censored');
|
1190 |
+
censorMessage.classList.add('censored');
|
1191 |
break;
|
1192 |
}
|
1193 |
}
|