Restyled by clang-format

This commit is contained in:
Restyled.io 2022-08-03 04:54:23 +00:00
parent f0759b63ee
commit 0d4daa23e9
8 changed files with 6391 additions and 8619 deletions

View file

@ -166,7 +166,8 @@ defaultColorScheme = {
__color_select_menu_backdrop_border : "#484f58", __color_select_menu_backdrop_border : "#484f58",
__color_select_menu_tap_highlight : "rgba(48, 54, 61, 0.5)", __color_select_menu_tap_highlight : "rgba(48, 54, 61, 0.5)",
__color_select_menu_tap_focus_bg : "#0c2d6b", __color_select_menu_tap_focus_bg : "#0c2d6b",
__color_overlay_shadow: "0 0 0 1px #30363d, 0 16px 32px rgba(1, 4, 9, 0.85)", __color_overlay_shadow :
"0 0 0 1px #30363d, 0 16px 32px rgba(1, 4, 9, 0.85)",
__color_header_text : "rgba(255, 255, 255, 0.7)", __color_header_text : "rgba(255, 255, 255, 0.7)",
__color_header_bg : "#161b22", __color_header_bg : "#161b22",
__color_header_divider : "#8b949e", __color_header_divider : "#8b949e",
@ -470,26 +471,18 @@ colorSettings.forEach((colorSetting) => {
const colorSettingPersist = colorSetting; const colorSettingPersist = colorSetting;
chrome.storage.local.get([ `${colorSetting}` ], function(result) { chrome.storage.local.get([ `${colorSetting}` ], function(result) {
if (result[colorSetting] === undefined) { if (result[colorSetting] === undefined) {
console.log( console.log(`Key not In Place - ${colorSettingVar}: Defaulting ${
`Key not In Place - ${colorSettingVar}: Defaulting ${defaultColorScheme[colorSettingPersist]}` defaultColorScheme[colorSettingPersist]}`);
);
const key = {}; const key = {};
key[`${colorSetting}`] = defaultColorScheme[colorSetting]; key[`${colorSetting}`] = defaultColorScheme[colorSetting];
chrome.storage.local.set(key); chrome.storage.local.set(key);
document.documentElement.style.setProperty( document.documentElement.style.setProperty(
`${colorSettingVar}`, `${colorSettingVar}`, defaultColorScheme[colorSettingPersist],
defaultColorScheme[colorSettingPersist], "important");
"important"
);
} else { } else {
console.log(`Setting ${colorSettingVar}: ${result[colorSetting]}`); console.log(`Setting ${colorSettingVar}: ${result[colorSetting]}`);
document document.querySelector(":root").style.setProperty(
.querySelector(":root") `${colorSettingVar}`, `${result[colorSetting]}`, "important");
.style.setProperty(
`${colorSettingVar}`,
`${result[colorSetting]}`,
"important"
);
} }
}); });
}); });

View file

@ -283,7 +283,8 @@ defaultColorScheme = {
__color_open_fg : "#3fb950", __color_open_fg : "#3fb950",
__color_open_muted : "rgba(46, 160, 67, 0.4)", __color_open_muted : "rgba(46, 160, 67, 0.4)",
__color_open_subtle : "rgba(46, 160, 67, 0.15)", __color_open_subtle : "rgba(46, 160, 67, 0.15)",
__color_overlay_shadow: "0 0 0 1px #30363d, 0 16px 32px rgba(1, 4, 9, 0.85)", __color_overlay_shadow :
"0 0 0 1px #30363d, 0 16px 32px rgba(1, 4, 9, 0.85)",
__color_page_header_bg : "#0d1117", __color_page_header_bg : "#0d1117",
__color_prettylights_syntax_brackethighlighter_angle : "#8b949e", __color_prettylights_syntax_brackethighlighter_angle : "#8b949e",
__color_prettylights_syntax_brackethighlighter_unmatched : "#f85149", __color_prettylights_syntax_brackethighlighter_unmatched : "#f85149",
@ -478,11 +479,9 @@ chrome.runtime.onInstalled.addListener(() => {
}); });
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
chrome.scripting.executeScript( chrome.scripting.executeScript({
{
target : {tabId}, target : {tabId},
files : [ "initial.js" ], files : [ "initial.js" ],
}, },
() => chrome.runtime.lastError () => chrome.runtime.lastError);
);
}); });

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -5,11 +5,9 @@
var n = function() { var n = function() {
(void 0 !== window.pageYOffset (void 0 !== window.pageYOffset
? window.pageYOffset ? window.pageYOffset
: ( : (document.documentElement || document.body.parentNode ||
document.documentElement || document.body)
document.body.parentNode || .scrollTop) > 100
document.body
).scrollTop) > 100
? e.classList.add("navbar-shrink") ? e.classList.add("navbar-shrink")
: e.classList.remove("navbar-shrink"); : e.classList.remove("navbar-shrink");
}; };
@ -18,36 +16,30 @@
document.getElementsByClassName("popup-gallery").length > 0 && document.getElementsByClassName("popup-gallery").length > 0 &&
baguetteBox.run(".popup-gallery", {animation : "slideIn"}), baguetteBox.run(".popup-gallery", {animation : "slideIn"}),
(function() { (function() {
if ( if ("requestAnimationFrame" in window &&
"requestAnimationFrame" in window && !/Mobile|Android/.test(navigator.userAgent)) {
!/Mobile|Android/.test(navigator.userAgent)
) {
var e = document.querySelectorAll("[data-bss-parallax]"); var e = document.querySelectorAll("[data-bss-parallax]");
if (e.length) { if (e.length) {
var n, var n, t = [];
t = [];
window.addEventListener("scroll", a), window.addEventListener("scroll", a),
window.addEventListener("resize", a), window.addEventListener("resize", a), a();
a();
} }
} }
function a() { function a() {
t.length = 0; t.length = 0;
for (var a = 0; a < e.length; a++) { for (var a = 0; a < e.length; a++) {
var r = e[a].getBoundingClientRect(), var r = e[a].getBoundingClientRect(),
i = i = parseFloat(e[a].getAttribute("data-bss-parallax-speed"),
parseFloat(e[a].getAttribute("data-bss-parallax-speed"), 10) || 10) ||
0.5; 0.5;
r.bottom > 0 && r.bottom > 0 && r.top < window.innerHeight &&
r.top < window.innerHeight &&
t.push({speed : i, node : e[a]}); t.push({speed : i, node : e[a]});
} }
cancelAnimationFrame(n), t.length && (n = requestAnimationFrame(o)); cancelAnimationFrame(n), t.length && (n = requestAnimationFrame(o));
} }
function o() { function o() {
for (var e = 0; e < t.length; e++) { for (var e = 0; e < t.length; e++) {
var n = t[e].node, var n = t[e].node, a = t[e].speed;
a = t[e].speed;
n.style.transform = n.style.transform =
"translate3d(0, " + -window.scrollY * a + "px, 0)"; "translate3d(0, " + -window.scrollY * a + "px, 0)";
} }

View file

@ -538,7 +538,8 @@ export var cg69_bd561d = [
]; ];
// color group: 70 | default color: #bf4b8a // color group: 70 | default color: #bf4b8a
export var cg70_bf4b8a = ["__color_scale_pink_5", "__color_sponsors_emphasis"]; export var cg70_bf4b8a =
[ "__color_scale_pink_5", "__color_sponsors_emphasis" ];
// color group: 71 | default color: #c9d1d9 // color group: 71 | default color: #c9d1d9
export var cg71_c9d1d9 = [ export var cg71_c9d1d9 = [

View file

@ -167,14 +167,11 @@ export function updateCalendar(color, saturate, scale) {
} }
for (let i = 0; i < scale.length; i++) { for (let i = 0; i < scale.length; i++) {
updateMultiple( updateMultiple(scale[i], chroma(color)
scale[i],
chroma(color)
.brighten(3) .brighten(3)
.saturate(saturate) .saturate(saturate)
.alpha((i + 1) * 0.2) .alpha((i + 1) * 0.2)
.hex() .hex());
);
} }
} }
@ -197,22 +194,16 @@ export function updateSpecific(color, desaturate, saturate, scale) {
for (let i = 0; i < scale.length; i++) { for (let i = 0; i < scale.length; i++) {
/^\d/.test(color.slice(-4)) /^\d/.test(color.slice(-4))
? updateMultiple( ? updateMultiple(scale[i], chroma(color)
scale[i],
chroma(color)
.brighten(i * 0.4) .brighten(i * 0.4)
.saturate(saturate) .saturate(saturate)
.desaturate(desaturate) .desaturate(desaturate)
.hex() .hex())
) : updateMultiple(scale[i], chroma(color)
: updateMultiple(
scale[i],
chroma(color)
.darken(i * 0.4) .darken(i * 0.4)
.saturate(saturate) .saturate(saturate)
.desaturate(desaturate) .desaturate(desaturate)
.hex() .hex());
);
} }
} }
@ -245,15 +236,7 @@ export function generateSaturation(color, setting) {
const colors = []; const colors = [];
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
/^\d/.test(color.slice(-4)) /^\d/.test(color.slice(-4))
? colors.push( ? colors.push(chroma(color).darken(i * 0.4).hex())
chroma(color) : colors.push(chroma(color).brighten(i * 0.4).hex());
.darken(i * 0.4)
.hex()
)
: colors.push(
chroma(color)
.brighten(i * 0.4)
.hex()
);
} }
} }

View file

@ -27,9 +27,8 @@ export function pintSetNoReload(setting, value) {
* @param {string} setting - get this setting * @param {string} setting - get this setting
*/ */
export function pintGetUpdate(setting, func) { export function pintGetUpdate(setting, func) {
chrome.storage.local.get([`${setting}`], function (result) { chrome.storage.local.get([ `${setting}` ],
func(result[`${setting}`]); function(result) { func(result[`${setting}`]); });
});
} }
/** /**