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
img { | |
--s: 300px; /* image size */ | |
--b: 6px; /* border thickness */ | |
--c: #ae3ec9; /* border color */ | |
--cb: #e9ecef; /* background color */ | |
--f: 1; /* initial scale */ | |
width: var(--s); | |
aspect-ratio: 1; | |
padding-top: calc(var(--s) / 5); |
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 { onExpandableTextareaInput } from "./auto-expanding-textarea"; | |
import "./index.css"; | |
document.addEventListener("input", onExpandableTextareaInput); | |
export default function SomePage() { | |
const handleChange = () => { | |
console.log("The value was changed!")} | |
return ( | |
<form> |
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
'use client'; | |
import { useState, useEffect } from 'react'; | |
// const SCREEN_MOBILE = 320; | |
const LARGE_SCREEN_MOBILE = 480; | |
const SCREEN_TABLET = 768; | |
const SCREEN_DESKTOP = 1280; | |
const LARGE_SCREEN_DESKTOP = 1440; |
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 LIMIT = 30; | |
const endStringWithThreeDots = (str) => { | |
if (str.length <= LIMIT) { | |
return str; | |
} else { | |
const updatedString = str.slice(0, LIMIT - 3) + "..."; | |
return updatedString; | |
} | |
}; |
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 checkDuplicate = (array, newObject) => { | |
const isDuplicate = array.some((obj) => obj.key === newObject.key); | |
return isDuplicate; | |
}; |