mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
Running prettier
This commit is contained in:
13
js/camera.js
13
js/camera.js
@@ -14,12 +14,15 @@ const drawToCanvas = () => {
|
||||
|
||||
const setupCamera = async () => {
|
||||
try {
|
||||
const stream = await navigator.mediaDevices.getUserMedia({video: {
|
||||
width: { min: 800, ideal: 1280 },
|
||||
frameRate: { ideal: 60 }
|
||||
}, audio: false});
|
||||
const stream = await navigator.mediaDevices.getUserMedia({
|
||||
video: {
|
||||
width: { min: 800, ideal: 1280 },
|
||||
frameRate: { ideal: 60 },
|
||||
},
|
||||
audio: false,
|
||||
});
|
||||
const videoTrack = stream.getVideoTracks()[0];
|
||||
const {width, height} = videoTrack.getSettings();
|
||||
const { width, height } = videoTrack.getSettings();
|
||||
|
||||
video.width = width;
|
||||
video.height = height;
|
||||
|
||||
@@ -92,7 +92,7 @@ const defaults = {
|
||||
],
|
||||
raindropLength: 1, // Adjusts the frequency of raindrops (and their length) in a column
|
||||
slant: 0, // The angle at which rain falls; the orientation of the glyph grid
|
||||
resolution: .75, // An overall scale multiplier
|
||||
resolution: 0.75, // An overall scale multiplier
|
||||
useHalfFloat: false,
|
||||
renderer: "webgpu", // The preferred web graphics API
|
||||
useHoloplay: false,
|
||||
@@ -179,7 +179,7 @@ const versions = {
|
||||
fallSpeed: 0.35,
|
||||
cycleStyle: "cycleRandomly",
|
||||
cycleSpeed: 0.8,
|
||||
glyphEdgeCrop: .1,
|
||||
glyphEdgeCrop: 0.1,
|
||||
paletteEntries: [
|
||||
{ hsl: [0.39, 0.9, 0.0], at: 0.0 },
|
||||
{ hsl: [0.39, 1.0, 0.6], at: 0.5 },
|
||||
|
||||
@@ -12,10 +12,9 @@ window.onclick = (e) => {
|
||||
clicks[index * 3 + 1] = 1 - e.clientY / e.srcElement.clientHeight;
|
||||
clicks[index * 3 + 2] = (Date.now() - start) / 1000;
|
||||
index = (index + 1) % numClicks;
|
||||
}
|
||||
};
|
||||
|
||||
export default ({ regl, config }, inputs) => {
|
||||
|
||||
const cameraTex = regl.texture(cameraCanvas);
|
||||
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
@@ -29,7 +28,7 @@ export default ({ regl, config }, inputs) => {
|
||||
cameraTex,
|
||||
clicks: () => clicks,
|
||||
aspectRatio: () => aspectRatio,
|
||||
cameraAspectRatio: () => cameraAspectRatio
|
||||
cameraAspectRatio: () => cameraAspectRatio,
|
||||
},
|
||||
framebuffer: output,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user