-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.html
92 lines (72 loc) · 2.62 KB
/
settings.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
<!DOCTYPE html>
<html lang="en">
<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>Settings</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="settings.css">
<script src="timeme.min.js"></script>
<!-- <script src="Content.js"></script> -->
<script type="text/javascript">
TimeMe.initialize({
currentPageName: "my-home-page", // current page
idleTimeoutInSeconds: 5,
});
window.onload = function () {
setInterval(function () {
let timeSpentOnPage = TimeMe.getTimeOnCurrentPageInSeconds();
document.getElementById('timeInSeconds').textContent = timeSpentOnPage.toFixed(2);
if (TimeMe.isUserCurrentlyOnPage && TimeMe.isUserCurrentlyIdle === false) {
document.getElementById('activityStatus').textContent = "You are actively using this page."
} else {
document.getElementById('activityStatus').textContent = "You have left the page."
}
}, 2);
}
</script>
</head>
<body>
<div class="header-class">
<h1 id="h1">Web Watcher</h1>
</div>
<h2 id="h2-settings">Settings:</h2>
<!-- <h3 id="h3-settings"><li>Enter websites to be blocked:</li></h3>
<input id="userinput" placeholder="Enter site name"> <button id="btn1" onclick="get()"> Submit </button>
<h3 id="message"> </h3>
<div id="blocked-sites">Current Blocked Sites:
<span style="color: #ff0100;">Youtube</span>
|
<span style="color: #0e8ef2;">Facebook</span>
|
<a href="#"><span style="color: #e50914;">Netflix</span></a>
</span>
</div> -->
<div id="container">
<div id="nameDiv"class="input">Sitename:<input id="site-name" type="text" placeholder="Eg: www,youtube.com">
<button id="entry">Add Website</button>
</div>
</div>
<table id="display">
<tr>
<th>Websites blocked:</th>
</tr>
</table>
<div class="time-message">
<div id="nameDiv2"class="input">Screentime:</div>
<div>
<span id="timeInSeconds">0</span> <span style="font-size: large;">seconds</span>
</div>
<div id="activityStatus">You are actively using this page.</div></div>
</div>
</body>
<script src="settings.js"></script>
<script src="Content.js">
// function get(){
// let userinput=document.querySelector("#userinput");
// let message=document.querySelector("#message");
// message.innerHTML="The webpage added is "+ userinput.value;
// }
</script>
</html>