Skip to content

Commit

Permalink
06-01-24 05:02 [Auto Paste Clipboard Link]
Browse files Browse the repository at this point in the history
  • Loading branch information
RyannKim327 committed May 31, 2024
1 parent e109c2b commit 923c36b
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 59 deletions.
113 changes: 57 additions & 56 deletions index.css
Original file line number Diff line number Diff line change
@@ -1,78 +1,79 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
outline: none;
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
outline: none;
}

html{
min-width: 25em;
min-height: 10em;
html {
min-width: 30em;
min-height: 25em;
}

main {
display: flex;
flex-direction: column;
align-items: center;
display: flex;
flex-direction: column;
align-items: center;
}

main > div {
display: flex;
flex-direction: column;
width: 75%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
margin: 1em;
box-shadow: 3px 3px 5px #333333;
align-items: center;
padding: .5em;
border-radius: .5em;
display: flex;
flex-direction: column;
width: 75%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
margin: 1em;
box-shadow: 3px 3px 5px #333333;
align-items: center;
padding: 0.5em;
border-radius: 0.5em;
}

main > div > input {
border: 0;
background-color: transparent;
border-radius: .5em;
/* box-shadow: 3px 3px 5px #333333; */
border: 1px black solid;
font-family: 'Times New Roman', Times, serif;
padding: .15em .5em;
width: 90%;
margin: .5em;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
border: 0;
background-color: transparent;
border-radius: 0.5em;
/* box-shadow: 3px 3px 5px #333333; */
border: 1px black solid;
font-family: "Times New Roman", Times, serif;
padding: 0.15em 0.5em;
width: 90%;
margin: 0.5em;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}

main > div > #links {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

main > div > h3, main > div > h5{
text-align: center;
main > div > h3,
main > div > h5 {
text-align: center;
}

main > div > #links {
max-height: 50vh;
overflow-y: scroll;
width: 100%;
margin: 1em;
padding: 0 .75em;
max-height: 50vh;
overflow-y: scroll;
width: 100%;
margin: 1em;
padding: 0 0.75em;
}

main > div > #links > a{
width: 100%;
text-align: center;
color: black;
text-decoration: none;
background-color: wheat;
border-radius: .5em;
box-shadow: 3px 3px 5px #333333;
margin: .25em;
padding: .1em 1em;
}
main > div > #links > a {
width: 100%;
text-align: center;
color: black;
text-decoration: none;
background-color: wheat;
border-radius: 0.5em;
box-shadow: 3px 3px 5px #333333;
margin: 0.25em;
padding: 0.1em 1em;
}
13 changes: 12 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
const url = "https://avd.vercel.app/convert"
let converting = true

window.onfocus = async () => {
navigator.permissions.query({name: "clipboard-read"})
const url = await navigator.clipboard.readText().then(c => {
if(c.includes("youtube.com") || c.includes("facebook.com")){
document.getElementById("title").textContent = "Auto fetch data using clipboard onload"
requestDownload(c)
document.getElementById("url").value = c
}
})
}

document.getElementById("url").onchange = () => {
const urlData = document.getElementById("url").value
if(urlData.includes("youtube.com") || urlData.includes("facebook.com")){
Expand Down Expand Up @@ -49,4 +60,4 @@ function requestDownload(videoURL){
converting = false
})
}
}
}
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Audio Video Downloader",
"version": "0.0.1",
"version": "0.0.2",
"author": "RyannKim327",
"permissions": [
"activeTab",
Expand Down Expand Up @@ -37,4 +37,4 @@
"128": "logo.png"
},
"manifest_version": 3
}
}

0 comments on commit 923c36b

Please sign in to comment.