Skip to content

Commit bbae4e9

Browse files
committed
first commit
0 parents  commit bbae4e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2844
-0
lines changed

0. Template/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<script src="https://kit.fontawesome.com/1935d064dd.js" crossorigin="anonymous"></script>
8+
<link rel="stylesheet" href="styles.css">
9+
</head>
10+
<body>
11+
<p>Hello World!!!</p>
12+
13+
14+
<script src="script.js"></script>
15+
</body>
16+
</html>

0. Template/script.js

Whitespace-only changes.

0. Template/styles.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');
2+
3+
4+
:root {
5+
--white: #fff;
6+
--black: #1c2b2d;
7+
--blue: #31326f;
8+
--light-blue: #005490;
9+
--color-primary: #9d0191;
10+
--color-sec: #db6400;
11+
--color-grey: #eee;
12+
--color-dark-grey: #222831;
13+
}
14+
15+
* {
16+
margin: 0;
17+
padding: 0;
18+
box-sizing: border-box;
19+
}
20+
21+
html {
22+
font-size: 10rem;
23+
}
24+
25+
body {
26+
font-family: 'Open Sans', sans-serif;
27+
}
28+
29+
p {
30+
font-size: 1.6rem;
31+
line-height: 1.5;
32+
}
33+
34+
img {
35+
width: 100%;
36+
}
37+
38+
.container {
39+
max-width: 900px;
40+
margin: 0 auto;
41+
padding: 0 20px;
42+
}
43+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"liveServer.settings.port": 5504
3+
}

1. GoogleDriveApp/index.html

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<script src="https://kit.fontawesome.com/1935d064dd.js" crossorigin="anonymous"></script>
8+
<link rel="stylesheet" href="styles.css">
9+
</head>
10+
<body>
11+
<!-- <header>
12+
<div class="container">
13+
<h1>Google Direct Download/Embed Link Generator</h1>
14+
</div>
15+
</header> -->
16+
<main>
17+
<section class="main-container">
18+
<div class="instructions">
19+
<div class="container">
20+
<h2 class="line">Instructions</h2>
21+
22+
<p>Follow the instructions below to get your Google Drive file link</p>
23+
<hr>
24+
<ol type="1">
25+
<li><p>Open <a href="https://drive.google.com" target="_blank">Google Drive</a></p></li>
26+
<li>Right click on a file.</li>
27+
<li>Select "Get link" and click "Copy link"</li>
28+
<li>Paste the link here and click “Generate Direct Link” button</li>
29+
</ol>
30+
</div>
31+
</div>
32+
33+
<div class="download-link">
34+
<div class="container">
35+
<h1>Google Direct Download Link Generator</h1>
36+
<input type="radio" id="login" name="tab" checked>
37+
<input type="radio" id="register" name="tab">
38+
<input type="radio" id="reset" name="tab">
39+
<nav>
40+
<label for="login" class="login"><i class="fas fa-sign-in-alt"></i>Paste Link</label>
41+
<label for="register" class="register"><i class="fas fa-headphones-alt"></i>Embed Audio</label>
42+
<label for="reset" class="reset"><i class="fas fa-photo-video"></i>Embed Video/Docs</label>
43+
<div class="slide"></div>
44+
</nav>
45+
46+
47+
<section>
48+
<div class="content content-link">
49+
<i class="fas fa-download"></i>
50+
<h2>Google Drive link</h2>
51+
<p>Paste your Google Drive File link below</p>
52+
<form action="">
53+
<label for="glink">
54+
<i class="fab fa-google-drive"></i>
55+
<input type="text" id="glink" class="glink" placeholder="Google Drive Link" autocomplete="off" required>
56+
</label>
57+
58+
<button class="btn" id="btn">Generate Direct Download Link</button>
59+
60+
<div class="embed-code">
61+
<hr class="m-y">
62+
<h3>Direct Download link</h3>
63+
<textarea name="" class="embed" id="download-link" cols="30" rows="10"></textarea>
64+
<span class="copy">Copy</span>
65+
</div>
66+
67+
</form>
68+
</div>
69+
70+
<div class="content content-audio">
71+
<i class="fas fa-headphones-alt"></i>
72+
<h2>Audio Embed Link</h2>
73+
<p>If your link was an Audio file, use the code snippet to embed it on a web page.</p>
74+
<form action="">
75+
<div class="embed-code">
76+
<hr class="m-y">
77+
<h3>Audio Embed link</h3>
78+
<textarea name="" class="embed" id="embed-audio" cols="30" rows="10"></textarea>
79+
<span class="copy-audio">Copy</span>
80+
</div>
81+
</form>
82+
</div>
83+
84+
<div class="content content-video">
85+
<i class="fas fa-photo-video"></i>
86+
<h2>Video/Doc Embed Link</h2>
87+
<p>If your link was an Video or Document, use the code snippet to embed it on a web page.</p>
88+
<form action="">
89+
<div class="embed-code">
90+
<hr class="m-y">
91+
<h3>Video/Document Embed link</h3>
92+
<textarea name="" class="embed" id="embed-video" cols="30" rows="10"></textarea>
93+
<span class="copy-video">Copy</span>
94+
</div>
95+
96+
</form>
97+
</div>
98+
</section>
99+
</div>
100+
</div>
101+
</section>
102+
</main>
103+
104+
105+
<script src="script.js"></script>
106+
</body>
107+
</html>

1. GoogleDriveApp/script.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
const gLink= document.getElementById("glink");
2+
const btn = document.getElementById("btn");
3+
const downloadLink = document.getElementById("download-link");
4+
5+
6+
btn.addEventListener("click", generateLink);
7+
8+
function generateLink(e) {
9+
e.preventDefault();
10+
// console.log(gLink.value);
11+
const gLinkValue = document.getElementById("glink").value;
12+
const confirmLink = glink.value.includes("https://drive.google.com/file/d/");
13+
14+
if (confirmLink == true) {
15+
const getDownloadLink = gLink.value
16+
.replace("https://drive.google.com/file/d/", "https://drive.google.com/uc?export=download&id=")
17+
.replace("/view?usp=sharing", "");
18+
// alert(getDownloadLink);
19+
downloadLink.value = getDownloadLink;
20+
21+
function copyText(target) {
22+
if (target.value == "") {
23+
alert("Please generate a Download Link")
24+
}else {
25+
target.select();
26+
document.execCommand("copy");
27+
alert("Link has been copied to clipboard");
28+
}
29+
}
30+
const copy = document.querySelector(".copy");
31+
copy.addEventListener("click", () => {
32+
return copyText(downloadLink);
33+
})
34+
35+
// EMBED AUDIO
36+
const audio1 = '<audio width="300" height="32" controls="controls" src="';
37+
const audio2 = '" type="audio/mp3"></audio>';
38+
const embedAudio = document.getElementById("embed-audio");
39+
console.log(downloadLink.value);
40+
embedAudio.value = `${audio1}${downloadLink.value}${audio2}`;
41+
// COPY AUDIO EMBED CODE
42+
const copyAudio = document.querySelector(".copy-audio");
43+
copyAudio.addEventListener("click", () => {
44+
return copyText(embedAudio);
45+
})
46+
47+
48+
// Embed Video
49+
const getVideoLink = gLink.value
50+
.replace("/view?usp=sharing", "");
51+
52+
const video1 = '<iframe src="';
53+
const video2 = '/preview" width="560" height="315"></iframe>';
54+
const embedVideo = document.getElementById("embed-video");
55+
embedVideo.value = `${video1}${getVideoLink}${video2}`;
56+
57+
const copyVideo = document.querySelector(".copy-video");
58+
copyVideo.addEventListener("click", () => {
59+
return copyText(embedVideo);
60+
})
61+
62+
} else {
63+
alert("Please Enter a Google Drive File Link")
64+
}
65+
}
66+
67+
const x = 2;
68+
const y = 2;
69+
70+
function add(a, b) {
71+
return a + b;
72+
}
73+
console.log(add(x, y));
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+

0 commit comments

Comments
 (0)