-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
66 lines (48 loc) · 1.74 KB
/
index.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
<!doctype html>
<html>
<head>
<title>Clock Widget</title>
<style>
body {
display: block;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-family: Veranda, sans-serif;
font-style: italic;
font-size: 25px;
text-align: center;
}
.date {
font-size: 18px;
}
</style>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body id="pickColors">
<label for="bgColorPicker">Background Color: </label>
<input type="color" id="bgColorPicker" value="#000000">
<br>
<label for="txtColorPicker">Text Color: </label>
<input type="color" id="txtColorPicker" value="#ffffff">
<br><br><br>
<div class="d-grid gap-2 col-6 mx-auto">
<button class="btn btn-secondary" type="button" onclick="changeColors()">Preview Selection</button>
<a id="insertColors" href="widget.html"><button class="btn btn-secondary" type="button">Create Widget</button></a>
</div>
</body>
<!--Change background and text colors-->
<script>
function changeColors() {
var backColor = document.getElementById("bgColorPicker").value.substring(1);
var textColor = document.getElementById("txtColorPicker").value.substring(1);
var newURL = "widget.html?backColor=" + backColor + "&textColor=" + textColor;
document.getElementById("pickColors").style.backgroundColor = "#" + backColor;
document.getElementById("pickColors").style.color = "#" + textColor;
document.getElementById("insertColors").href = newURL;
}
</script>
</html>