您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Баллы Humidex для Gismeteo
当前为
// ==UserScript== // @name GisMeteo Humidex // @version 2020.06.12 // @description Баллы Humidex для Gismeteo // @include http*://*gismeteo.ru/* // @exclude http*://*gismeteo.ru/*/10-days/ // @exclude http*://*gismeteo.ru/*/2-weeks/ // @icon https://www.google.com/s2/favicons?domain=gismeteo.ru // @author Rainbow-Spike // @namespace https://greasyfork.org/users/7568 // @homepage https://greasyfork.org/ru/users/7568-dr-yukon // @grant none // ==/UserScript== var temps = document.querySelectorAll ( '.w_temperature .value span:nth-of-type(1)' ), hums = document.querySelectorAll ( 'div[data-widget-id = humidity] .w-humidity' ), i, temp, hum, humidex, color; for ( i = 0; i < temps.length; i++ ) { temp = temps [ i ].innerHTML.replace ( '+', '' ) * 1; hum = hums [ i ].innerHTML * 1; humidex = Math.round ( temp + 5 / 9 * ( ( 6.112 * Math.pow ( 10, ( 7.5 * temp / ( 237.7 + temp ) ) ) * hum / 100 ) - 10 ) ); switch ( true ) { case humidex < 0: color = 'violet'; break; case humidex < 10: color = 'blue'; break; case humidex < 20: color = 'darkturquoise'; break; case humidex < 30: color = 'green'; break; case humidex < 40: color = 'gold'; break; case humidex < 45: color = 'orange'; break; case humidex < 54: color = 'red'; break; case humidex >= 54: color = 'darkred'; break; default: color = ''; break; } temps [ i ].innerHTML = temps [ i ].innerHTML + '<div style = "font-weight: bold; font-size: 90%; margin: 7px 0 0 12px; color: ' + color + '">' + humidex + '</div>'; }