forked from codewithsadee/vcard-personal-portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautofy.html
More file actions
151 lines (132 loc) · 4.33 KB
/
autofy.html
File metadata and controls
151 lines (132 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<!-- This site is for getting an api token for spotify.
Just so you as the reader are not too confused about this page -->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Raiden Erdmann</title>
<!--
- favicon
-->
<link rel="apple-touch-icon" sizes="180x180" href="./assets/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./assets/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./assets/images/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="192x192" href="./assets/images/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="./assets/images/android-chrome-512x512.png">
<link rel="shortcut icon" href="./assets/images/favicon.ico" type="image/x-icon">
<!--
- custom css link
-->
<link rel="stylesheet" href="./assets/css/style.css">
<!--
- google font link
-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
<style>
body {
color: white;
font-family: 'Poppins', sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
padding: 20px;
box-sizing: border-box;
}
h1 {
font-size: 2.5rem;
margin-bottom: 30px;
text-align: center;
}
.code-container {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 15px;
padding: 25px;
max-width: 800px;
width: 100%;
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
border: 1px solid rgba(255, 255, 255, 0.18);
}
.code-box {
background: rgba(0, 0, 0, 0.3);
border-radius: 8px;
padding: 15px;
word-break: break-all;
font-family: 'Courier New', monospace;
font-size: 0.9rem;
line-height: 1.6;
margin-bottom: 15px;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.copy-button {
background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
color: white;
border: none;
border-radius: 25px;
padding: 12px 30px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(29, 185, 84, 0.4);
font-family: 'Poppins', sans-serif;
}
.copy-button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(29, 185, 84, 0.6);
}
.copy-button:active {
transform: translateY(0);
}
.copy-button.copied {
background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}
.error-message {
color: #ff6b6b;
font-size: 1.2rem;
}
</style>
</head>
<body>
<h1>Copy this URL:</h1>
<div class="code-container">
<div class="code-box" id="code"></div>
<button class="copy-button" id="copyBtn" onclick="copyToClipboard()">Copy to Clipboard</button>
</div>
<script>
// Get the full URL
const fullUrl = window.location.href;
const codeElement = document.getElementById('code');
const copyBtn = document.getElementById('copyBtn');
// Get the URL parameters
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code') || urlParams.get('id');
// Display the full URL or error message
if (code) {
codeElement.textContent = fullUrl;
} else {
codeElement.innerHTML = '<span class="error-message">No code found in URL</span>';
copyBtn.style.display = 'none';
}
// Copy to clipboard function
function copyToClipboard() {
navigator.clipboard.writeText(fullUrl).then(function() {
copyBtn.textContent = 'Copied!';
copyBtn.classList.add('copied');
setTimeout(function() {
copyBtn.textContent = 'Copy to Clipboard';
copyBtn.classList.remove('copied');
}, 2000);
}).catch(function(err) {
console.error('Failed to copy: ', err);
});
}
</script>
</body>