Skip to content

Instantly share code, notes, and snippets.

@neeraj-tangariya
neeraj-tangariya / slider-next-prev.md
Last active February 15, 2023 09:24
slider next and previous button incrementation and decrementation
let up = true;
let down = true;
let screenCounter = 0;
let incrementBy = 1;
let defaultTftMode = "light";
const lengthOfScreen = 4;

// direction would be up or down
function changeScreen(direction = null) {
@neeraj-tangariya
neeraj-tangariya / SampleHandler.jsx
Created May 8, 2023 14:05
grid block and touch event handler in react native
import React, { Component } from 'react';
import { View, Text, StyleSheet, findNodeHandle, PanResponder, Alert, Dimensions } from 'react-native';
const data = [
['A', 'B', 'C', 'D', 'E'],
['F', 'G', 'H', 'I', 'J'],
['K', 'L', 'M', 'N', 'O'],
['P', 'Q', 'R', 'S', 'T'],
['U', 'V', 'W', 'X', 'Y'],
];
@neeraj-tangariya
neeraj-tangariya / file.md
Last active August 23, 2023 04:40
Run Rive animation in react native example

App.tsx

import React, {useEffect, useRef} from 'react';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import Rive from 'rive-react-native';

function App(): JSX.Element {
  const animRef = useRef<any>(null);

  const playAnimation = () => {
@neeraj-tangariya
neeraj-tangariya / outline.js
Created April 5, 2024 09:40
babylonjs mesh outline layer animation. paste this on babylonjs playground
var createScene = function () {
// This creates a basic Babylon Scene object (non-mesh)
var scene = new BABYLON.Scene(engine);
// This creates and positions a free camera (non-mesh)
var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
// This targets the camera to scene origin
@neeraj-tangariya
neeraj-tangariya / babylonjs-3d-text.js
Created May 31, 2024 05:38
create 3d text in babylonjs
var yellowText;
var purpleText;
var redText;
var blackText;
function create3DTextTitle(scene, camera, name = null) {
yellowText = scene.getMeshByName("Text_Yellow");
purpleText = scene.getMeshByName("Text_Blue"); // Adjusted name from "Text_Blue"
redText = scene.getMeshByName("Text_Red");
blackText = scene.getMeshByName("Text_Black");