mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-20 23:09: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 () => {
|
const setupCamera = async () => {
|
||||||
try {
|
try {
|
||||||
const stream = await navigator.mediaDevices.getUserMedia({video: {
|
const stream = await navigator.mediaDevices.getUserMedia({
|
||||||
width: { min: 800, ideal: 1280 },
|
video: {
|
||||||
frameRate: { ideal: 60 }
|
width: { min: 800, ideal: 1280 },
|
||||||
}, audio: false});
|
frameRate: { ideal: 60 },
|
||||||
|
},
|
||||||
|
audio: false,
|
||||||
|
});
|
||||||
const videoTrack = stream.getVideoTracks()[0];
|
const videoTrack = stream.getVideoTracks()[0];
|
||||||
const {width, height} = videoTrack.getSettings();
|
const { width, height } = videoTrack.getSettings();
|
||||||
|
|
||||||
video.width = width;
|
video.width = width;
|
||||||
video.height = height;
|
video.height = height;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ const defaults = {
|
|||||||
],
|
],
|
||||||
raindropLength: 1, // Adjusts the frequency of raindrops (and their length) in a column
|
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
|
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,
|
useHalfFloat: false,
|
||||||
renderer: "webgpu", // The preferred web graphics API
|
renderer: "webgpu", // The preferred web graphics API
|
||||||
useHoloplay: false,
|
useHoloplay: false,
|
||||||
@@ -179,7 +179,7 @@ const versions = {
|
|||||||
fallSpeed: 0.35,
|
fallSpeed: 0.35,
|
||||||
cycleStyle: "cycleRandomly",
|
cycleStyle: "cycleRandomly",
|
||||||
cycleSpeed: 0.8,
|
cycleSpeed: 0.8,
|
||||||
glyphEdgeCrop: .1,
|
glyphEdgeCrop: 0.1,
|
||||||
paletteEntries: [
|
paletteEntries: [
|
||||||
{ hsl: [0.39, 0.9, 0.0], at: 0.0 },
|
{ hsl: [0.39, 0.9, 0.0], at: 0.0 },
|
||||||
{ hsl: [0.39, 1.0, 0.6], at: 0.5 },
|
{ 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 + 1] = 1 - e.clientY / e.srcElement.clientHeight;
|
||||||
clicks[index * 3 + 2] = (Date.now() - start) / 1000;
|
clicks[index * 3 + 2] = (Date.now() - start) / 1000;
|
||||||
index = (index + 1) % numClicks;
|
index = (index + 1) % numClicks;
|
||||||
}
|
};
|
||||||
|
|
||||||
export default ({ regl, config }, inputs) => {
|
export default ({ regl, config }, inputs) => {
|
||||||
|
|
||||||
const cameraTex = regl.texture(cameraCanvas);
|
const cameraTex = regl.texture(cameraCanvas);
|
||||||
|
|
||||||
const output = makePassFBO(regl, config.useHalfFloat);
|
const output = makePassFBO(regl, config.useHalfFloat);
|
||||||
@@ -29,7 +28,7 @@ export default ({ regl, config }, inputs) => {
|
|||||||
cameraTex,
|
cameraTex,
|
||||||
clicks: () => clicks,
|
clicks: () => clicks,
|
||||||
aspectRatio: () => aspectRatio,
|
aspectRatio: () => aspectRatio,
|
||||||
cameraAspectRatio: () => cameraAspectRatio
|
cameraAspectRatio: () => cameraAspectRatio,
|
||||||
},
|
},
|
||||||
framebuffer: output,
|
framebuffer: output,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user