Remove debug logs
This commit is contained in:
parent
bfcad7a7c7
commit
9089fee899
4
build.js
4
build.js
|
@ -4,13 +4,13 @@ import { sassPlugin } from 'esbuild-sass-plugin'
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
|
|
||||||
const serve = process.env.ESBUILD_SERVE === '1'
|
const serve = process.env.ESBUILD_SERVE === '1'
|
||||||
const baseurl = process.env.ESBUILD_BASEURL
|
const baseurl = process.env.ESBUILD_BASEURL || '/'
|
||||||
|
|
||||||
console.log(`Building with baseurl ${baseurl}`)
|
console.log(`Building with baseurl ${baseurl}`)
|
||||||
|
|
||||||
const ctx = await esbuild.context({
|
const ctx = await esbuild.context({
|
||||||
entryPoints: ['src/index.ts'],
|
entryPoints: ['src/index.ts'],
|
||||||
minify: !serve,
|
minify: true,
|
||||||
bundle: true,
|
bundle: true,
|
||||||
metafile: true,
|
metafile: true,
|
||||||
splitting: true,
|
splitting: true,
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
/**
|
/**
|
||||||
* In case the guys who look at my projet open the console -_-
|
* In case the people who look at my projet open the console -_-
|
||||||
*/
|
*/
|
||||||
export const logWelcome = () => {
|
export const logWelcome = () => {
|
||||||
const commonStyles = 'padding: 3px'
|
const commonStyles = 'padding: 3px'
|
||||||
const titleStyles = `font-size: 3em;`
|
const titleStyles = `font-size: 3em;`
|
||||||
|
|
||||||
// console.log('%c Hello!',` `${titleStyles})
|
|
||||||
console.log(
|
console.log(
|
||||||
`%c Hello
|
`%c Hello
|
||||||
%c I don't know if you see this,
|
%c I don't know if you see this,
|
||||||
|
@ -15,7 +14,7 @@ export const logWelcome = () => {
|
||||||
(in case someone randomly openes it), but now i don't even know what i'm doing :)
|
(in case someone randomly openes it), but now i don't even know what i'm doing :)
|
||||||
Anyways, I hope you are having a good time in my simulator!!!`
|
Anyways, I hope you are having a good time in my simulator!!!`
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(s => s.trim())
|
.map((s) => s.trim())
|
||||||
.join(' '),
|
.join(' '),
|
||||||
`${titleStyles}`,
|
`${titleStyles}`,
|
||||||
`${commonStyles}`
|
`${commonStyles}`
|
||||||
|
|
|
@ -12,7 +12,6 @@ import LogicGate from './LogicGate'
|
||||||
const LogicGatePage = () => {
|
const LogicGatePage = () => {
|
||||||
const gates = useObservable(() => LogicGateList, [])
|
const gates = useObservable(() => LogicGateList, [])
|
||||||
const renderer = getRendererSafely()
|
const renderer = getRendererSafely()
|
||||||
console.log('got this far')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main>
|
<main>
|
||||||
|
@ -24,8 +23,7 @@ const LogicGatePage = () => {
|
||||||
.filter((template) => {
|
.filter((template) => {
|
||||||
return (
|
return (
|
||||||
renderer.simulation.mode === 'project' ||
|
renderer.simulation.mode === 'project' ||
|
||||||
template.metadata.name !==
|
template.metadata.name !== renderer.simulation.name
|
||||||
renderer.simulation.name
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.map((template, index) => {
|
.map((template, index) => {
|
||||||
|
|
|
@ -19,18 +19,13 @@ export class Wire {
|
||||||
end.value.addPair(start.value, true, !ic)
|
end.value.addPair(start.value, true, !ic)
|
||||||
start.value.addPair(end.value, false, !ic)
|
start.value.addPair(end.value, false, !ic)
|
||||||
|
|
||||||
// if (ic) {
|
|
||||||
// start.value.state.subscribe(console.log)
|
|
||||||
// end.value.state.subscribe(console.log)
|
|
||||||
// }
|
|
||||||
|
|
||||||
this.id = id !== undefined ? id : idStore.generate()
|
this.id = id !== undefined ? id : idStore.generate()
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose() {
|
public dispose() {
|
||||||
this.end.value.removePair(this.start.value)
|
this.end.value.removePair(this.start.value)
|
||||||
this.start.value.removePair(this.end.value)
|
this.start.value.removePair(this.end.value)
|
||||||
this.end.value.state.next("0")
|
this.end.value.state.next('0')
|
||||||
|
|
||||||
this.active = false
|
this.active = false
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,21 +9,19 @@ export const pinFill = (renderer: SimulationRenderer, pin: Pin) => {
|
||||||
const { open, closed } = renderer.options.gates.pinFill
|
const { open, closed } = renderer.options.gates.pinFill
|
||||||
const digits = Array.from(pin.state.value).map(Number)
|
const digits = Array.from(pin.state.value).map(Number)
|
||||||
|
|
||||||
const colors = digits.map(digit => (digit ? open : closed))
|
const colors = digits.map((digit) => (digit ? open : closed))
|
||||||
const chunked = colors.map(fromHexColorString)
|
const chunked = colors.map(fromHexColorString)
|
||||||
|
|
||||||
const summed = [0, 1, 2]
|
const summed = [0, 1, 2]
|
||||||
.map(key =>
|
.map((key) =>
|
||||||
chunked
|
chunked
|
||||||
.flat()
|
.flat()
|
||||||
.filter((v, index) => index % 3 === key)
|
.filter((v, index) => index % 3 === key)
|
||||||
.reduce((acc, curr) => acc + curr, 0)
|
.reduce((acc, curr) => acc + curr, 0)
|
||||||
)
|
)
|
||||||
.map(value => Math.floor(value / digits.length))
|
.map((value) => Math.floor(value / digits.length))
|
||||||
|
|
||||||
color = fromChunks(summed)
|
color = fromChunks(summed)
|
||||||
|
|
||||||
// console.log(color)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return color
|
return color
|
||||||
|
|
|
@ -20,6 +20,7 @@ b * (a - x0) = a - x1
|
||||||
x1 = a - b * (a - x0)
|
x1 = a - b * (a - x0)
|
||||||
*/
|
*/
|
||||||
export const handleScroll = (e: WheelEvent, camera: Camera) => {
|
export const handleScroll = (e: WheelEvent, camera: Camera) => {
|
||||||
|
console.log('got here')
|
||||||
const sign = -e.deltaY / Math.abs(e.deltaY)
|
const sign = -e.deltaY / Math.abs(e.deltaY)
|
||||||
const zoom = scrollStep ** sign
|
const zoom = scrollStep ** sign
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue