stupid console.log and production build + blur phone numbers

This commit is contained in:
Jean Ouina 2020-07-18 00:49:00 +02:00
parent 7ec315a11f
commit 9f2ec39396
7 changed files with 79 additions and 67 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,51 +1,57 @@
/** /**
* Credits to @hellbound1337 on github for the css * Credits to @hellbound1337 on github for the css
*/ */
import DOMTools from "./domtools" import DOMTools from "./domtools"
import Utils from "./utils" import Utils from "./utils"
let selectors let selectors
const removeDa = Utils.removeDa const removeDa = Utils.removeDa
function getSelectors(){ function getSelectors(){
let standardSidebarView = BDModules.get(e => e.standardSidebarView)[0] let standardSidebarView = BDModules.get(e => e.standardSidebarView)[0]
if(!standardSidebarView)return null if(!standardSidebarView)return null
let defaultClassName = removeDa(standardSidebarView.standardSidebarView) let defaultClassName = removeDa(standardSidebarView.standardSidebarView)
let selects = [] let selects = []
selects.push(`#app-mount .${defaultClassName} .payment-info .${removeDa(BDModules.get(e => e.description && typeof e.description === "string" && e.description.includes("formText"))[0].description)}`) let userSettingsAccount = BDModules.get(e => e.userSettingsAccount)[0]
selects.push(`#app-mount .${defaultClassName} .${removeDa(BDModules.get(e => e.paymentSourceRow)[0].paymentSourceRow)} .${removeDa(BDModules.get(e => e.subText && e.descriptionWrapper)[0].subText)}`) const children = BDModules.get(e => typeof e.children === "string")[0]
selects.push(`#app-mount .${defaultClassName} .${removeDa(BDModules.get(e => e.userSettingsAccount)[0].userSettingsAccount)} div:nth-child(2)>div:nth-child(2)>.${removeDa(BDModules.get(e => e.viewBody)[0].viewBody)}`) selects.push(`#app-mount .${defaultClassName} .payment-info .${removeDa(BDModules.get(e => e.description && typeof e.description === "string" && e.description.includes("formText"))[0].description)}`)
return selects selects.push(`#app-mount .${defaultClassName} .${removeDa(BDModules.get(e => e.paymentSourceRow)[0].paymentSourceRow)} .${removeDa(BDModules.get(e => e.subText && e.descriptionWrapper)[0].subText)}`)
} if(userSettingsAccount){
selects.push(`#app-mount .${defaultClassName} .${removeDa(userSettingsAccount.userSettingsAccount)} div:nth-child(2)>div:nth-child(2)>.${removeDa(BDModules.get(e => e.viewBody)[0].viewBody)}`)
export default new class BlurPrivate { selects.push(`.${removeDa(userSettingsAccount.userSettingsSecurity)} .${removeDa(children.children)} > div:nth-child(2)`)
constructor(){ }
this.enabled = false console.log(selects)
} return selects
}
enable(){
if(this.enabled)return export default new class BlurPrivate {
this.enabled = true constructor(){
selectors = selectors || getSelectors() this.enabled = false
}
if(!selectors)console.error(new Error("Couldn't find selectors to blur personnal informations."))
DOMTools.addStyle("blurPrivate", ` enable(){
${selectors[0]}, ${selectors[1]}, ${selectors[2]} { if(this.enabled)return
transition: all 150ms cubic-bezier(.55,.085,.68,.53); this.enabled = true
filter: blur(4px); selectors = selectors || getSelectors()
opacity: .8;
} if(!selectors)console.error(new Error("Couldn't find selectors to blur personnal informations."))
DOMTools.addStyle("blurPrivate", `
${selectors[0]}:hover, ${selectors[1]}:hover, ${selectors[2]}:hover { ${selectors.join(", ")} {
transition: all 150ms cubic-bezier(.55,.09,.68,.53); transition: all 150ms cubic-bezier(.55,.085,.68,.53);
filter: none; filter: blur(4px);
opacity: 1; opacity: .8;
}`) }
}
${selectors.map(e => e+":hover").join(", ")} {
disable(){ transition: all 150ms cubic-bezier(.55,.09,.68,.53);
if(!this.enabled)return filter: none;
this.enabled = false opacity: 1;
DOMTools.removeStyle("blurPrivate") }`)
} }
disable(){
if(!this.enabled)return
this.enabled = false
DOMTools.removeStyle("blurPrivate")
}
} }

View File

@ -73,7 +73,7 @@ export default class ApiPreview extends React.PureComponent {
let renderPreview = () => { let renderPreview = () => {
return <div style={{margin: "20px"}}> return <div style={{margin: "20px"}}>
<div style={{ <div style={{
backgroundColor: "var(--background-primary)", backgroundColor: "var(--background-secondary)",
padding: "30px 30px", padding: "30px 30px",
borderRadius: "8px" borderRadius: "8px"
}} className="lc-tab-box-shadow"> }} className="lc-tab-box-shadow">
@ -84,7 +84,7 @@ export default class ApiPreview extends React.PureComponent {
let renderCode = () => { let renderCode = () => {
return <div style={{margin: "20px"}}> return <div style={{margin: "20px"}}>
<div style={{ <div style={{
backgroundColor: "var(--background-primary)", backgroundColor: "var(--background-secondary)",
padding: "30px 30px", padding: "30px 30px",
borderRadius: "8px" borderRadius: "8px"
}} className="lc-tab-box-shadow"> }} className="lc-tab-box-shadow">
@ -115,7 +115,7 @@ export default class ApiPreview extends React.PureComponent {
marginTop: "20px", marginBottom: "20px" marginTop: "20px", marginBottom: "20px"
}}, }},
React.createElement("div", {style: { React.createElement("div", {style: {
backgroundColor: "var(--background-primary)", backgroundColor: "var(--background-secondary)",
padding: "30px 30px", padding: "30px 30px",
borderRadius: "8px" borderRadius: "8px"
}, className: "lc-tab-box-shadow" }, }, className: "lc-tab-box-shadow" },
@ -127,7 +127,7 @@ export default class ApiPreview extends React.PureComponent {
marginTop: "20px", marginBottom: "20px" marginTop: "20px", marginBottom: "20px"
}}> }}>
<div style={{ <div style={{
backgroundColor: "var(--background-primary)", backgroundColor: "var(--background-secondary)",
padding: "30px 30px", padding: "30px 30px",
borderRadius: "8px" borderRadius: "8px"
}} className="lc-tab-box-shadow"> }} className="lc-tab-box-shadow">

View File

@ -731,7 +731,6 @@ class Profile extends React.Component {
activity: activity activity: activity
})).render().props.children // bypass tracking })).render().props.children // bypass tracking
console.log(profile)
profile.props.style = { profile.props.style = {
width: "auto" width: "auto"
} }

View File

@ -3,7 +3,7 @@ const path = require("path")
const terser = require("terser") const terser = require("terser")
const util = require("util") const util = require("util")
const production = false const production = true
let fs = require("fs") let fs = require("fs")

View File

@ -1,6 +1,6 @@
{ {
"name": "lightcord", "name": "lightcord",
"version": "0.1.2", "version": "0.1.3",
"description": "A simple - customizable - Discord Client.", "description": "A simple - customizable - Discord Client.",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {