add github link

main
btahir89 12 months ago
parent 5f6cc132d8
commit 60c097dae4

@ -3,6 +3,7 @@
import React, { useState, useRef, useEffect, useMemo } from 'react' import React, { useState, useRef, useEffect, useMemo } from 'react'
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
import { X, Save, Settings } from 'lucide-react' import { X, Save, Settings } from 'lucide-react'
import { GitHubIcon } from '@/components/GitHubIcon'
import { soundEffects, DEFAULT_CHANNELS } from '@/lib/lofi_data' import { soundEffects, DEFAULT_CHANNELS } from '@/lib/lofi_data'
import ChannelButtons from '@/components/ChannelButtons' import ChannelButtons from '@/components/ChannelButtons'
import PlaybackControls from '@/components/PlaybackControls' import PlaybackControls from '@/components/PlaybackControls'
@ -509,42 +510,20 @@ const EnhancedLofiPlayer = () => {
} }
} }
const handleEffectVolumeChange = (effectId: string, volume: number) => {
const newVolumes = { ...effectVolumes, [effectId]: volume }
setEffectVolumes(newVolumes)
const audio = audioRefs.current[effectId]?.audio
if (audio) {
audio.volume = volume * effectsVolume
}
}
const handleAddCustomEffect = (effect: CustomSoundEffect) => {
setCustomEffects((prev) => [...prev, effect])
}
const handleRemoveCustomEffect = (effectId: string) => {
setCustomEffects((prev) => prev.filter((effect) => effect.id !== effectId))
// Stop and remove the audio if it's playing
const audio = audioRefs.current[effectId]?.audio
if (audio) {
audio.pause()
delete audioRefs.current[effectId]
}
setActiveEffects((prev) => {
const next = new Set(prev)
next.delete(effectId)
return next
})
}
return ( return (
<div <div
className={styles['theme-container']} className={styles['theme-container']}
data-theme={mounted ? currentTheme : 'dark'} data-theme={mounted ? currentTheme : 'dark'}
> >
<a
href="https://github.com/btahir/next-beats"
target="_blank"
rel="noopener noreferrer"
className="fixed right-4 top-4 hidden text-[var(--lofi-text-primary)] transition-opacity hover:opacity-70 lg:block"
aria-label="View source on GitHub"
>
<GitHubIcon />
</a>
<div className="flex min-h-screen w-full items-start justify-center bg-[var(--lofi-background)] p-4 transition-colors duration-500 sm:items-center sm:p-8"> <div className="flex min-h-screen w-full items-start justify-center bg-[var(--lofi-background)] p-4 transition-colors duration-500 sm:items-center sm:p-8">
<div className="w-full max-w-4xl space-y-8 py-4"> <div className="w-full max-w-4xl space-y-8 py-4">
{/* Retro TV */} {/* Retro TV */}

@ -0,0 +1,19 @@
export function GitHubIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="lucide lucide-github"
>
<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" />
<path d="M9 18c-4.51 2-5-2-7-2" />
</svg>
)
}
Loading…
Cancel
Save