-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathagical-link-generator.html
95 lines (81 loc) · 3.07 KB
/
agical-link-generator.html
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
<!DOCTYPE html>
<html>
<head>
<title>URL Generator</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
input[type="text"],
input[type="number"],
textarea {
width: 600px;
padding: 5px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-bottom: 10px;
}
input[type="datetime-local"] {
width: 312px; /* Adjusted to fit the border size */
}
button {
padding: 8px 16px;
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
p {
margin-top: 20px;
font-weight: bold;
}
</style>
<script>
function generateURL() {
var subject = encodeURIComponent(document.getElementById('subject').value);
var description = encodeURIComponent(document.getElementById('description').value);
var location = encodeURIComponent(document.getElementById('location').value);
var date = document.getElementById('dtstart').value;
var tstart = "11:00:00";
var tend = "12:00:00";
var dtstart = new Date(`${date}T${tstart}`).toISOString();
var dtend = new Date(`${date}T${tend}`).toISOString();
var reminder = "10";
var url = 'https://ics.agical.io/?subject=' + subject +
'&description=' + description +
'&location=' + location +
'&dtstart=' + encodeURIComponent(dtstart) +
'&dtend=' + encodeURIComponent(dtend) +
'&reminder=' + reminder;
document.getElementById('generated-url').textContent = url;
document.getElementById('generated-url').href = url;
}
</script>
</head>
<body>
<label for="subject">Subject:</label>
<input type="text" id="subject" value="Cross Government Software Community Lean Coffee" placeholder="Cross Government Software Community Lean Coffee"><br>
<label for="description">Description:</label>
<textarea id="description" rows="4" cols="30">Meeting of the Cross Government Community, featuring talks and Lean Coffee discussion.
Join on zoom https://us02web.zoom.us/j/MEETINGID
Meeting ID MEETINGID
Passcode PASSCODE</textarea><br>
<label for="location">Location:</label>
<input type="text" id="location" placeholder="https://us02web.zoom.us/j/MEETINGID"><br>
<label for="dtstart">Date</label>
<input type="date" id="dtstart"><br>
<button onclick="generateURL()">Generate URL</button><br>
<p>Generated URL: <a id="generated-url" href="" target="_blank"></a></p>
</body>
</html>