grey_filter fixed

This commit is contained in:
Bigsk 2022-12-29 14:55:14 +08:00
parent f65cec7057
commit 16bc36852f
4 changed files with 167 additions and 167 deletions

View File

@ -133,12 +133,12 @@
<script> <script>
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "https://open.geh.ink/gray_filter", url: "https://open.geh.ink/grey_filter",
dataType: "json", dataType: "json",
success: function(data, textStatus){ success: function(data, textStatus){
for (let i=0;i<data["accurate_slot"].length;i++) { for (let i=0;i<data["content"]["accurate_slot"].length;i++) {
// Accurate Slot // Accurate Slot
if (Date.now()/1000 >= data["accurate_slot"][i][0] && Date.now()/1000 <= data["accurate_slot"][i][1]) { if (Date.now()/1000 >= data["content"]["accurate_slot"][i][0] && Date.now()/1000 <= data["content"]["accurate_slot"][i][1]) {
$("html").css({ $("html").css({
'-webkit-filter': 'grayscale(100%)', '-webkit-filter': 'grayscale(100%)',
'-moz-filter': 'grayscale(100%)', '-moz-filter': 'grayscale(100%)',
@ -150,23 +150,23 @@
break; break;
} }
} }
for (let i=0;i<data["day_slot"].length;i++) { for (let i=0;i<data["content"]["day_slot"].length;i++) {
// Day Slot // Day Slot
let begin = new Date( let begin = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][0][0].toString() + "-" + data["content"]["day_slot"][i][0][0].toString() + "-" +
data["day_slot"][i][0][1].toString() + " " + data["content"]["day_slot"][i][0][1].toString() + " " +
data["day_slot"][i][0][2].toString() + ":" + data["content"]["day_slot"][i][0][2].toString() + ":" +
data["day_slot"][i][0][3].toString() + ":" + data["content"]["day_slot"][i][0][3].toString() + ":" +
data["day_slot"][i][0][4].toString() data["content"]["day_slot"][i][0][4].toString()
) )
let end = new Date( let end = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][1][0].toString() + "-" + data["content"]["day_slot"][i][1][0].toString() + "-" +
data["day_slot"][i][1][1].toString() + " " + data["content"]["day_slot"][i][1][1].toString() + " " +
data["day_slot"][i][1][2].toString() + ":" + data["content"]["day_slot"][i][1][2].toString() + ":" +
data["day_slot"][i][1][3].toString() + ":" + data["content"]["day_slot"][i][1][3].toString() + ":" +
data["day_slot"][i][1][4].toString() data["content"]["day_slot"][i][1][4].toString()
) )
if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) { if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) {
$("html").css({ $("html").css({

View File

@ -179,12 +179,12 @@
<script> <script>
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "https://open.geh.ink/gray_filter", url: "https://open.geh.ink/grey_filter",
dataType: "json", dataType: "json",
success: function(data, textStatus){ success: function(data, textStatus){
for (let i=0;i<data["accurate_slot"].length;i++) { for (let i=0;i<data["content"]["accurate_slot"].length;i++) {
// Accurate Slot // Accurate Slot
if (Date.now()/1000 >= data["accurate_slot"][i][0] && Date.now()/1000 <= data["accurate_slot"][i][1]) { if (Date.now()/1000 >= data["content"]["accurate_slot"][i][0] && Date.now()/1000 <= data["content"]["accurate_slot"][i][1]) {
$("html").css({ $("html").css({
'-webkit-filter': 'grayscale(100%)', '-webkit-filter': 'grayscale(100%)',
'-moz-filter': 'grayscale(100%)', '-moz-filter': 'grayscale(100%)',
@ -196,23 +196,23 @@
break; break;
} }
} }
for (let i=0;i<data["day_slot"].length;i++) { for (let i=0;i<data["content"]["day_slot"].length;i++) {
// Day Slot // Day Slot
let begin = new Date( let begin = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][0][0].toString() + "-" + data["content"]["day_slot"][i][0][0].toString() + "-" +
data["day_slot"][i][0][1].toString() + " " + data["content"]["day_slot"][i][0][1].toString() + " " +
data["day_slot"][i][0][2].toString() + ":" + data["content"]["day_slot"][i][0][2].toString() + ":" +
data["day_slot"][i][0][3].toString() + ":" + data["content"]["day_slot"][i][0][3].toString() + ":" +
data["day_slot"][i][0][4].toString() data["content"]["day_slot"][i][0][4].toString()
) )
let end = new Date( let end = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][1][0].toString() + "-" + data["content"]["day_slot"][i][1][0].toString() + "-" +
data["day_slot"][i][1][1].toString() + " " + data["content"]["day_slot"][i][1][1].toString() + " " +
data["day_slot"][i][1][2].toString() + ":" + data["content"]["day_slot"][i][1][2].toString() + ":" +
data["day_slot"][i][1][3].toString() + ":" + data["content"]["day_slot"][i][1][3].toString() + ":" +
data["day_slot"][i][1][4].toString() data["content"]["day_slot"][i][1][4].toString()
) )
if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) { if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) {
$("html").css({ $("html").css({

View File

@ -133,12 +133,12 @@
<script> <script>
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "https://open.geh.ink/gray_filter", url: "https://open.geh.ink/grey_filter",
dataType: "json", dataType: "json",
success: function(data, textStatus){ success: function(data, textStatus){
for (let i=0;i<data["accurate_slot"].length;i++) { for (let i=0;i<data["content"]["accurate_slot"].length;i++) {
// Accurate Slot // Accurate Slot
if (Date.now()/1000 >= data["accurate_slot"][i][0] && Date.now()/1000 <= data["accurate_slot"][i][1]) { if (Date.now()/1000 >= data["content"]["accurate_slot"][i][0] && Date.now()/1000 <= data["content"]["accurate_slot"][i][1]) {
$("html").css({ $("html").css({
'-webkit-filter': 'grayscale(100%)', '-webkit-filter': 'grayscale(100%)',
'-moz-filter': 'grayscale(100%)', '-moz-filter': 'grayscale(100%)',
@ -150,23 +150,23 @@
break; break;
} }
} }
for (let i=0;i<data["day_slot"].length;i++) { for (let i=0;i<data["content"]["day_slot"].length;i++) {
// Day Slot // Day Slot
let begin = new Date( let begin = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][0][0].toString() + "-" + data["content"]["day_slot"][i][0][0].toString() + "-" +
data["day_slot"][i][0][1].toString() + " " + data["content"]["day_slot"][i][0][1].toString() + " " +
data["day_slot"][i][0][2].toString() + ":" + data["content"]["day_slot"][i][0][2].toString() + ":" +
data["day_slot"][i][0][3].toString() + ":" + data["content"]["day_slot"][i][0][3].toString() + ":" +
data["day_slot"][i][0][4].toString() data["content"]["day_slot"][i][0][4].toString()
) )
let end = new Date( let end = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][1][0].toString() + "-" + data["content"]["day_slot"][i][1][0].toString() + "-" +
data["day_slot"][i][1][1].toString() + " " + data["content"]["day_slot"][i][1][1].toString() + " " +
data["day_slot"][i][1][2].toString() + ":" + data["content"]["day_slot"][i][1][2].toString() + ":" +
data["day_slot"][i][1][3].toString() + ":" + data["content"]["day_slot"][i][1][3].toString() + ":" +
data["day_slot"][i][1][4].toString() data["content"]["day_slot"][i][1][4].toString()
) )
if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) { if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) {
$("html").css({ $("html").css({

View File

@ -179,12 +179,12 @@
<script> <script>
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "https://open.geh.ink/gray_filter", url: "https://open.geh.ink/grey_filter",
dataType: "json", dataType: "json",
success: function(data, textStatus){ success: function(data, textStatus){
for (let i=0;i<data["accurate_slot"].length;i++) { for (let i=0;i<data["content"]["accurate_slot"].length;i++) {
// Accurate Slot // Accurate Slot
if (Date.now()/1000 >= data["accurate_slot"][i][0] && Date.now()/1000 <= data["accurate_slot"][i][1]) { if (Date.now()/1000 >= data["content"]["accurate_slot"][i][0] && Date.now()/1000 <= data["content"]["accurate_slot"][i][1]) {
$("html").css({ $("html").css({
'-webkit-filter': 'grayscale(100%)', '-webkit-filter': 'grayscale(100%)',
'-moz-filter': 'grayscale(100%)', '-moz-filter': 'grayscale(100%)',
@ -196,23 +196,23 @@
break; break;
} }
} }
for (let i=0;i<data["day_slot"].length;i++) { for (let i=0;i<data["content"]["day_slot"].length;i++) {
// Day Slot // Day Slot
let begin = new Date( let begin = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][0][0].toString() + "-" + data["content"]["day_slot"][i][0][0].toString() + "-" +
data["day_slot"][i][0][1].toString() + " " + data["content"]["day_slot"][i][0][1].toString() + " " +
data["day_slot"][i][0][2].toString() + ":" + data["content"]["day_slot"][i][0][2].toString() + ":" +
data["day_slot"][i][0][3].toString() + ":" + data["content"]["day_slot"][i][0][3].toString() + ":" +
data["day_slot"][i][0][4].toString() data["content"]["day_slot"][i][0][4].toString()
) )
let end = new Date( let end = new Date(
date.getFullYear().toString() + "-" + date.getFullYear().toString() + "-" +
data["day_slot"][i][1][0].toString() + "-" + data["content"]["day_slot"][i][1][0].toString() + "-" +
data["day_slot"][i][1][1].toString() + " " + data["content"]["day_slot"][i][1][1].toString() + " " +
data["day_slot"][i][1][2].toString() + ":" + data["content"]["day_slot"][i][1][2].toString() + ":" +
data["day_slot"][i][1][3].toString() + ":" + data["content"]["day_slot"][i][1][3].toString() + ":" +
data["day_slot"][i][1][4].toString() data["content"]["day_slot"][i][1][4].toString()
) )
if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) { if (Date.now() >= begin.getTime() && Date.now() <= end.getTime()) {
$("html").css({ $("html").css({