/** @type {import('next').NextConfig} */
const nextConfig = {
images:{
remotePatterns:[
{
protocol: 'https',
hostname: "images.pexels.com"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {useState} from 'react'; | |
| import {allCocktails} from '../constants'; | |
| const Menu = () => { | |
| const [currentIndex, setCurrentIndex] = useState(0); | |
| const totalCocktails = allCocktails.length; | |
| const goToSlide = (index: number) => { | |
| const newIndex = (index + totalCocktails) % totalCocktails; | |
| setCurrentIndex(newIndex); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @/components/H1 | |
| import { cn } from "@/lib/utils"; | |
| type HIProps = { | |
| children: React. ReactNode; | |
| className?: string; | |
| } | |
| export default function H1({ className, children }: HIProps) { | |
| return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function FadeUp({ | |
| children, | |
| delay = 0, | |
| duration = 0.5, | |
| }) { | |
| return ( | |
| <motion.div | |
| variants={{ hidden: { opacity: 0, y: 15 }, visible: { opacity: 1, y: 0 } }} | |
| initial="hidden" | |
| whileInView="visible" |
import mongoose from 'mongoose';
if (!process.env.MONGODB_URI) {
throw new Error('Invalid environment variable: "MONGODB_URI"');
}
const uri = process.env.MONGODB_URI;
export const connectDB = () => {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*============================================= | |
| = Active class on Scroll = | |
| =============================================*/ | |
| const sections = document.querySelectorAll('section'); | |
| const navLinks = document.querySelectorAll('nav ul li a'); | |
| window.addEventListener('scroll', function () { | |
| let currentPos = window.scrollY; | |
| sections.forEach(section => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
Glassmorphism login Form Tutorial in html css
A Pen by Foolish Developer on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const candies = (children, candy) => children > 0 && candy > 0 ? Math.floor(candy / children) * children : console.log('For Christmas, number of children and candies must be greater than 0 to spread joy and happiness'); | |
| const result = candies(3, 10); | |
| console.log('result: ', result) |
NewerOlder