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
*/
import DOMTools from "./domtools"
import Utils from "./utils"
let selectors
const removeDa = Utils.removeDa
function getSelectors(){
let standardSidebarView = BDModules.get(e => e.standardSidebarView)[0]
if(!standardSidebarView)return null
let defaultClassName = removeDa(standardSidebarView.standardSidebarView)
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)}`)
selects.push(`#app-mount .${defaultClassName} .${removeDa(BDModules.get(e => e.paymentSourceRow)[0].paymentSourceRow)} .${removeDa(BDModules.get(e => e.subText && e.descriptionWrapper)[0].subText)}`)
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)}`)
return selects
}
export default new class BlurPrivate {
constructor(){
this.enabled = false
}
enable(){
if(this.enabled)return
this.enabled = true
selectors = selectors || getSelectors()
if(!selectors)console.error(new Error("Couldn't find selectors to blur personnal informations."))
DOMTools.addStyle("blurPrivate", `
${selectors[0]}, ${selectors[1]}, ${selectors[2]} {
transition: all 150ms cubic-bezier(.55,.085,.68,.53);
filter: blur(4px);
opacity: .8;
}
${selectors[0]}:hover, ${selectors[1]}:hover, ${selectors[2]}:hover {
transition: all 150ms cubic-bezier(.55,.09,.68,.53);
filter: none;
opacity: 1;
}`)
}
disable(){
if(!this.enabled)return
this.enabled = false
DOMTools.removeStyle("blurPrivate")
}
/**
* Credits to @hellbound1337 on github for the css
*/
import DOMTools from "./domtools"
import Utils from "./utils"
let selectors
const removeDa = Utils.removeDa
function getSelectors(){
let standardSidebarView = BDModules.get(e => e.standardSidebarView)[0]
if(!standardSidebarView)return null
let defaultClassName = removeDa(standardSidebarView.standardSidebarView)
let selects = []
let userSettingsAccount = BDModules.get(e => e.userSettingsAccount)[0]
const children = BDModules.get(e => typeof e.children === "string")[0]
selects.push(`#app-mount .${defaultClassName} .payment-info .${removeDa(BDModules.get(e => e.description && typeof e.description === "string" && e.description.includes("formText"))[0].description)}`)
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)}`)
selects.push(`.${removeDa(userSettingsAccount.userSettingsSecurity)} .${removeDa(children.children)} > div:nth-child(2)`)
}
console.log(selects)
return selects
}
export default new class BlurPrivate {
constructor(){
this.enabled = false
}
enable(){
if(this.enabled)return
this.enabled = true
selectors = selectors || getSelectors()
if(!selectors)console.error(new Error("Couldn't find selectors to blur personnal informations."))
DOMTools.addStyle("blurPrivate", `
${selectors.join(", ")} {
transition: all 150ms cubic-bezier(.55,.085,.68,.53);
filter: blur(4px);
opacity: .8;
}
${selectors.map(e => e+":hover").join(", ")} {
transition: all 150ms cubic-bezier(.55,.09,.68,.53);
filter: none;
opacity: 1;
}`)
}
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 = () => {
return <div style={{margin: "20px"}}>
<div style={{
backgroundColor: "var(--background-primary)",
backgroundColor: "var(--background-secondary)",
padding: "30px 30px",
borderRadius: "8px"
}} className="lc-tab-box-shadow">
@ -84,7 +84,7 @@ export default class ApiPreview extends React.PureComponent {
let renderCode = () => {
return <div style={{margin: "20px"}}>
<div style={{
backgroundColor: "var(--background-primary)",
backgroundColor: "var(--background-secondary)",
padding: "30px 30px",
borderRadius: "8px"
}} className="lc-tab-box-shadow">
@ -115,7 +115,7 @@ export default class ApiPreview extends React.PureComponent {
marginTop: "20px", marginBottom: "20px"
}},
React.createElement("div", {style: {
backgroundColor: "var(--background-primary)",
backgroundColor: "var(--background-secondary)",
padding: "30px 30px",
borderRadius: "8px"
}, className: "lc-tab-box-shadow" },
@ -127,7 +127,7 @@ export default class ApiPreview extends React.PureComponent {
marginTop: "20px", marginBottom: "20px"
}}>
<div style={{
backgroundColor: "var(--background-primary)",
backgroundColor: "var(--background-secondary)",
padding: "30px 30px",
borderRadius: "8px"
}} className="lc-tab-box-shadow">

View File

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

View File

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

View File

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