浏览代码

Make more of the interface dark. Highlight NSFW entities and views

tags/v0.1.0
Fen Dweller 5 年前
父节点
当前提交
30ae0efd14
共有 3 个文件被更改,包括 90 次插入11 次删除
  1. +38
    -6
      macrovision.css
  2. +38
    -0
      macrovision.js
  3. +14
    -5
      media/attribution.js

+ 38
- 6
macrovision.css 查看文件

@@ -598,7 +598,6 @@ i.far {

#spawners > select,
#spawners > button {
padding-top: 2pt;
display: none;
}

@@ -724,13 +723,11 @@ i.far {
button {
border: 3px;
border-style: outset;
border-color: gray;
padding: 5px;
background: #eee;
}


button:hover {
background: #ccc;
background: #555;
}
button:enabled:active {
border-style: inset;
@@ -841,6 +838,7 @@ button:enabled:active {
left: 50%;
transform: translate(-50%, -50%);
}

#help-contents-holder {
flex: 1 1 70%;
background: #333;
@@ -893,4 +891,38 @@ button:enabled:active {
width: 80%;
max-width: 60em;
height: 60pt;
}
}

.nsfw {
color: red;
font-style: bold;
}

select {
background: #111;
color: #eee;
border-color: #444;
}


select > option {
color: #eee;
}

button:focus,
select:focus,
input:focus {
outline-color: #eee;
}

input {
background: #111;
color: #eee;
border-color: #444;
}

button {
background: #111;
color: #ddd;
border-color: #666;
}

+ 38
- 0
macrovision.js 查看文件

@@ -372,6 +372,7 @@ function createEntityMaker(info, views, sizes) {
maker.constructor = () => makeEntity(info, views, sizes);
maker.authors = [];
maker.owners = [];
maker.nsfw = false;

Object.values(views).forEach(view => {
const authors = authorsOf(view.image.source);
@@ -390,6 +391,10 @@ function createEntityMaker(info, views, sizes) {
}
});
}

if (isNsfw(view.image.source)) {
maker.nsfw = true;
}
});

return maker;
@@ -595,11 +600,32 @@ function configViewList(entity, selectedView) {
option.innerText = entity.views[view].name;
option.value = view;

if (isNsfw(entity.views[view].image.source)) {
option.classList.add("nsfw")
}

if (view === selectedView) {
option.selected = true;

if (option.classList.contains("nsfw")) {
list.classList.add("nsfw");
} else {
list.classList.remove("nsfw");
}
}
list.appendChild(option);
});


list.addEventListener("change", e => {
if (list.options[list.selectedIndex].classList.contains("nsfw")) {
list.classList.add("nsfw");
} else {
list.classList.remove("nsfw");
}
})
}

function clearViewList() {
@@ -2014,9 +2040,21 @@ function prepareEntities() {
option.innerText = entity.name;
select.appendChild(option);

if (entity.nsfw) {
option.classList.add("nsfw");
}

availableEntitiesByName[entity.name] = entity;
};

select.addEventListener("change", e => {
if (select.options[select.selectedIndex].classList.contains("nsfw")) {
select.classList.add("nsfw");
} else {
select.classList.remove("nsfw");
}
})

const button = document.createElement("button");
button.id = "create-entity-" + category + "-button";



+ 14
- 5
media/attribution.js 查看文件

@@ -2172,11 +2172,11 @@ const attributionData = {
{
prefix: "./media/characters/elbial/",
files: [
{ name: "front.svg", source: "https://www.furaffinity.net/view/15459294/" },
{ name: "side.svg", source: "https://www.furaffinity.net/view/15459294/" },
{ name: "back.svg", source: "https://www.furaffinity.net/view/15459294/" },
{ name: "front.svg", source: "https://www.furaffinity.net/view/15459294/", nsfw: true },
{ name: "side.svg", source: "https://www.furaffinity.net/view/15459294/", nsfw: true },
{ name: "back.svg", source: "https://www.furaffinity.net/view/15459294/", nsfw: true },
{ name: "front-dressed.svg", source: "https://www.furaffinity.net/view/15459294/" },
{ name: "genitals.svg", source: "https://www.furaffinity.net/view/15459294/" },
{ name: "genitals.svg", source: "https://www.furaffinity.net/view/15459294/", nsfw: true },
],
authors: [
"homogeneousrule"
@@ -12882,7 +12882,8 @@ function prepareAttribution() {
attribution.files[citation.prefix + file.name] = {
authors: citation.authors,
owners: citation.owners,
source: file.source
source: file.source,
nsfw: file.nsfw
}
})
}
@@ -12998,4 +12999,12 @@ function sourceOf(file) {
}
}

function isNsfw(file) {
if (attribution.files[file]) {
return attribution.files[file].nsfw === true;
}

return false;
}

prepareAttribution();

正在加载...
取消
保存