Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
.slider-thumb {
@apply appearance-none w-full h-2 rounded-lg bg-gray-200 cursor-pointer;
}

.slider-thumb::-webkit-slider-thumb {
@apply w-5 h-5 bg-gray-800 hover:bg-gray-600 rounded-full cursor-pointer border-none;
}

.slider-thumb::-moz-range-thumb {
@apply w-5 h-5 bg-gray-800 hover:bg-gray-600 rounded-full cursor-pointer border-none;
}

/* Larger thumb size for mobile devices */
@media (max-width: 768px) {
.slider-thumb::-webkit-slider-thumb {
@apply w-7 h-7;
}

.slider-thumb::-moz-range-thumb {
@apply w-7 h-7;
}
}
}
36 changes: 28 additions & 8 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function Home() {
const [filePostfix, setFilePostfix] = useState<
SocialPlatform | 'user-upload'
>();
const [borderThickness, setBorderThickness] = useState(15);

useEffect(() => {
const isInstagramBrowser = /Instagram/i.test(navigator.userAgent);
Expand Down Expand Up @@ -104,6 +105,7 @@ export default function Home() {

const startOver = async () => {
setUserImageUrl(undefined);
setBorderThickness(15);
};

return (
Expand Down Expand Up @@ -166,10 +168,10 @@ export default function Home() {
height={100}
style={{
position: 'absolute',
width: '85%',
height: '85%',
left: '7.5%',
top: '7.5%',
width: `${100 - borderThickness}%`,
height: `${100 - borderThickness}%`,
left: `${borderThickness / 2}%`,
top: `${borderThickness / 2}%`,
}}
className="object-cover rounded-full cursor-wait"
/>
Expand All @@ -182,17 +184,35 @@ export default function Home() {
height={100}
style={{
position: 'absolute',
width: '85%',
height: '85%',
left: '7.5%',
top: '7.5%',
width: `${100 - borderThickness}%`,
height: `${100 - borderThickness}%`,
left: `${borderThickness / 2}%`,
top: `${borderThickness / 2}%`,
}}
className="object-cover rounded-full cursor-pointer"
/>
)}
</div>
</div>
</div>
<div className="my-4">
<label
htmlFor="borderRange"
className="block text-xs font-normal text-gray-500 mb-2"
>
Border Thickness: <span>{borderThickness}%</span>
</label>
<input
id="borderRange"
type="range"
min="5"
max="25"
step="1"
value={borderThickness}
onChange={(e) => setBorderThickness(parseInt(e.target.value))}
className="slider-thumb"
/>
</div>
<div>
{userImageUrl ? (
<>
Expand Down