mirror of
https://github.com/arkorty/DownLink.git
synced 2026-03-17 16:51:45 +00:00
Feature: lots of styling improvements!
This commit is contained in:
Binary file not shown.
@@ -12,6 +12,7 @@
|
|||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-router-dom": "^6.26.0",
|
"react-router-dom": "^6.26.0",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
|
"react-type-animation": "^3.2.0",
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Confetti from "react-confetti";
|
|||||||
|
|
||||||
const DownloadForm = () => {
|
const DownloadForm = () => {
|
||||||
const [url, setUrl] = useState("");
|
const [url, setUrl] = useState("");
|
||||||
const [quality, setQuality] = useState("480p");
|
const [quality, setQuality] = useState("360p");
|
||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
const [progress, setProgress] = useState(0);
|
const [progress, setProgress] = useState(0);
|
||||||
const [isProcessing, setIsProcessing] = useState(false);
|
const [isProcessing, setIsProcessing] = useState(false);
|
||||||
@@ -96,43 +96,52 @@ const DownloadForm = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="p-4 relative">
|
<div className="p-4 relative">
|
||||||
<form onSubmit={handleDownload} className="space-y-4">
|
<form onSubmit={handleDownload} className="space-y-4">
|
||||||
<div>
|
<div className="flex gap-2">
|
||||||
<label
|
<div className="flex-grow">
|
||||||
htmlFor="url"
|
<label
|
||||||
className="block text-sm font-medium text-gray-700"
|
htmlFor="url"
|
||||||
>
|
className="block text-sm font-medium text-gray-700 text-left"
|
||||||
Video URL
|
>
|
||||||
</label>
|
Video URL
|
||||||
<input
|
</label>
|
||||||
type="text"
|
<input
|
||||||
id="url"
|
type="text"
|
||||||
value={url}
|
id="url"
|
||||||
onChange={(e) => setUrl(e.target.value)}
|
value={url}
|
||||||
className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
onChange={(e) => setUrl(e.target.value)}
|
||||||
placeholder="Enter video URL"
|
className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
||||||
/>
|
placeholder="Enter video URL"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="flex-shrink-0 w-18">
|
||||||
|
<label
|
||||||
|
htmlFor="quality"
|
||||||
|
className="block text-sm font-medium text-gray-700 text-left"
|
||||||
|
>
|
||||||
|
Quality
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="quality"
|
||||||
|
value={quality}
|
||||||
|
onChange={(e) => setQuality(e.target.value)}
|
||||||
|
className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
||||||
|
>
|
||||||
|
<option value="360p">Normal</option>
|
||||||
|
<option value="480p">High</option>
|
||||||
|
<option value="720p">Highest</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label
|
<div
|
||||||
htmlFor="quality"
|
className={`w-full bg-white rounded-lg mt-4 h-6 relative overflow-hidden ${
|
||||||
className="block text-sm font-medium text-gray-700"
|
progress > 0 || (isProcessing && progress === 0)
|
||||||
>
|
? "border border-gray-300"
|
||||||
Quality
|
: ""
|
||||||
</label>
|
}`}
|
||||||
<select
|
>
|
||||||
id="quality"
|
|
||||||
value={quality}
|
|
||||||
onChange={(e) => setQuality(e.target.value)}
|
|
||||||
className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
|
||||||
>
|
|
||||||
<option value="360p">360p</option>
|
|
||||||
<option value="480p">480p</option>
|
|
||||||
<option value="720p">720p</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div className="w-full bg-white rounded-full mt-4 h-4 relative overflow-hidden">
|
|
||||||
<div
|
<div
|
||||||
className={`h-4 ${getBarClass()} rounded-full`}
|
className={`h-full ${getBarClass()} rounded-lg`}
|
||||||
style={{
|
style={{
|
||||||
width: `${progress}%`,
|
width: `${progress}%`,
|
||||||
...getBarStyle(),
|
...getBarStyle(),
|
||||||
@@ -154,12 +163,14 @@ const DownloadForm = () => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
{!isProcessing && !message.startsWith("Downloading") && (
|
{!isProcessing && !message.startsWith("Downloading") && (
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="inline-flex items-center px-8 py-4 border border-transparent text-lg font-bold rounded-lg shadow-lg text-white bg-black hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
className="relative inline-flex items-center px-8 py-4 border border-transparent text-lg font-bold rounded-lg text-white bg-gradient-to-r from-cyan-500 via-green-500 to-blue-500 hover:shadow-lg focus:outline-none animate-gradient"
|
||||||
>
|
>
|
||||||
|
<span className="absolute inset-0 bg-black opacity-0 transition-opacity duration-300 ease-in-out active:opacity-40 rounded-lg"></span>
|
||||||
Download
|
Download
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
@@ -184,6 +195,23 @@ const DownloadForm = () => {
|
|||||||
transform: translateX(100%);
|
transform: translateX(100%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes gradientFlow {
|
||||||
|
0% {
|
||||||
|
background-position: 0% 0%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position: 100% 100%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: 0% 0%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-gradient {
|
||||||
|
background-size: 300% 300%;
|
||||||
|
animation: gradientFlow 15s ease infinite;
|
||||||
|
}
|
||||||
`}</style>
|
`}</style>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,8 +2,26 @@ import React from "react";
|
|||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
return (
|
return (
|
||||||
<header className="bg-black text-white p-4">
|
<header className="bg-gradient-to-r from-cyan-500 via-green-500 to-blue-500 text-white p-4 animate-gradient">
|
||||||
<h1 className="text-xl font-bold">DownLink</h1>
|
<h1 className="text-xl font-bold">DownLink</h1>
|
||||||
|
<style jsx>{`
|
||||||
|
@keyframes gradientFlow {
|
||||||
|
0% {
|
||||||
|
background-position: 0% 0%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position: 100% 100%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: 0% 0%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-gradient {
|
||||||
|
background-size: 300% 300%;
|
||||||
|
animation: gradientFlow 15s ease infinite;
|
||||||
|
}
|
||||||
|
`}</style>
|
||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +1,30 @@
|
|||||||
|
"use client";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import DownloadForm from "./DownloadForm";
|
import DownloadForm from "./DownloadForm";
|
||||||
|
import { TypeAnimation } from "react-type-animation";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
return (
|
return (
|
||||||
<div className="max-w-4xl mx-auto">
|
<div className="relative z-10 pt-20">
|
||||||
<h2 className="text-2xl font-bold text-center mt-8">
|
<div className="max-w-4xl mx-auto text-center">
|
||||||
Download YouTube Videos
|
<h1 className="text-white mb-4 text-4xl sm:text-5xl lg:text-6xl font-extrabold">
|
||||||
</h2>
|
<TypeAnimation
|
||||||
<DownloadForm />
|
sequence={[
|
||||||
|
"Easy To Use!",
|
||||||
|
1200,
|
||||||
|
"HD Quality!",
|
||||||
|
1200,
|
||||||
|
"Download YouTube Videos!",
|
||||||
|
1200,
|
||||||
|
]}
|
||||||
|
wrapper="span"
|
||||||
|
speed={30}
|
||||||
|
repeat={Infinity}
|
||||||
|
className="text-transparent bg-clip-text bg-gradient-to-r from-cyan-500 to-blue-500"
|
||||||
|
/>
|
||||||
|
</h1>
|
||||||
|
<DownloadForm />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user