-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (59 loc) · 1.89 KB
/
index.html
File metadata and controls
72 lines (59 loc) · 1.89 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Online Desktop</title>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="scripts.js"></script>
</head>
<body onload="startTime()">
<div class="container">
<div class="top">
<div id="date">Hallo</div>
<h1>My Personal Desktop</h1>
<div id="clock"></div>
</div>
<div class="main">
<div class="widget">
<h3>BOB</h3>
<div class="notepad">
<textarea onload="loadNotes" id="note-area" name="message" rows="20" cols="40"></textarea>
</div>
<button id="saveNoteBtn">Save</button>
</div>
<div class="widget">
<h3>Widget 02</h3>
</div>
<div class="widget">
<h3>Widget 03</h3>
</div>
</div>
</div>
</body>
<script>
/* --- FUNCTIONS --- */
/* --- MAIN CODE --- */
try {
var loadNotes = localStorage.getItem("notes");
}
catch(err) {
var loadNotes = "Enter your notes here and click 'Save'";
}
$("#note-area").val(loadNotes);
sp="/"
today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //As January is 0.
var yyyy = today.getFullYear();
if(dd<10) dd='0'+dd;
if(mm<10) mm='0'+mm;
$("#date").html(mm+sp+dd+sp+yyyy);
$("#saveNoteBtn").click(function(){
var currentNotes = $("#note-area").val();
localStorage.setItem("notes", currentNotes);
});
</script>
</html>
<!-- console.log("notes: ", currentNotes); -->