Skip to content

Instantly share code, notes, and snippets.

@DanyRivera
DanyRivera / CryptoLogin.jsx
Created April 27, 2026 05:34
Crypto Login
import { useState, useEffect, useRef } from "react";
const COINS = [
{ symbol: "BTC", color: "#F7931A", x: 18, y: 22 },
{ symbol: "ETH", color: "#627EEA", x: 78, y: 15 },
{ symbol: "SOL", color: "#9945FF", x: 85, y: 72 },
{ symbol: "USDC", color: "#2775CA", x: 10, y: 68 },
];
function FloatingCoin({ symbol, color, x, y, delay }) {
@DanyRivera
DanyRivera / MusicLogin.jsx
Created April 26, 2026 16:53
Music Login
import { useState, useEffect, useRef, useCallback } from 'react'
// ─── Wave Visualizer ──────────────────────────────────────────────────────────
const NUM_BARS = 70
function WaveVisualizer() {
const canvasRef = useRef(null)
const rafRef = useRef(null)
const tRef = useRef(0)
const phasesRef = useRef(null)
import {
DEFINIR_OPERACION,
RESETEAR_CALCULADORA,
RESETEAR_OPERACION,
MOSTRAR_RESULTADO
} from "../types";
export default (state, action) => {
switch (action.type) {
import { useReducer } from 'react';
import OperacionContext from './OperacionContext';
import OperacionReducer from './OperacionReducer';
import {
DEFINIR_OPERACION,
RESETEAR_CALCULADORA,
RESETEAR_OPERACION,
MOSTRAR_RESULTADO
} from '../types';
import { createContext } from "react";
export const OperacionContext = createContext();
export default OperacionContext;
export const DEFINIR_OPERACION = 'DEFINIR_OPERACION';
export const MOSTRAR_OPERACION = 'MOSTRAR_OPERACION';
export const MOSTRAR_RESULTADO = 'MOSTRAR_RESULTADO';
export const RESETEAR_OPERACION = 'RESETEAR_OPERACION';
export const RESETEAR_CALCULADORA = 'RESETEAR_CALCULADORA';
import { useReducer } from "react";
import NameReducer from './nameReducer';
import NameContext from "./nameContext";
import {
TYPE_NAME,
} from "../types";
const NameState = props => {
import {
TYPE_NAME
} from "../types";
export default (state, action) => {
switch (action.type) {
case TYPE_NAME:
return {
import { createContext } from "react";
const nameContext = createContext();
export default nameContext;
import useSelect from "../hooks/useSelect";
const [servicio, SelectServicio] = useSelect('Selecciona el Servicio', servicios, values.servicio || hospedaje.servicio);
const [noches, SelectNoches] = useSelect('Selecciona las Noches', nochesHospedaje, values.noches || hospedaje.noches);
const [zona, SelectZona] = useSelect('Selecciona la Zona', zonas, values.zona || hospedaje.zona);