-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.html
83 lines (77 loc) · 2.94 KB
/
store.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Learning Journal</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
line-height: 1.6;
color: #333;
}
h1, h2, h3 {
color: #007bff; /* Bootstrap primary color */
}
article {
margin-bottom: 40px;
}
/* Add more custom styles as needed */
</style>
</head>
<body>
<div class="container mt-4">
<h1 class="text-center mb-4">Learning Journal</h1>
<!-- Your existing learning journal content here -->
<!-- Notes Section -->
<h2 class="text-center mb-3">My Notes</h2>
<div class="row">
<div class="col-md-8 offset-md-2">
<div class="form-group">
<textarea id="noteInput" class="form-control" rows="3" placeholder="Enter your note"></textarea>
</div>
<button onclick="addNote()" class="btn btn-primary">Add Note</button>
</div>
</div>
<div id="noteList" class="mt-4">
<!-- Notes will be added here -->
</div>
</div>
<script>
// Load existing notes from localStorage on page load
window.onload = function() {
const savedNotes = JSON.parse(localStorage.getItem('notes'));
if (savedNotes) {
const noteList = document.getElementById('noteList');
savedNotes.forEach(function(note) {
const noteItem = document.createElement('div');
noteItem.classList.add('alert', 'alert-info');
noteItem.textContent = note;
noteList.appendChild(noteItem);
});
}
};
// Function to add a note
function addNote() {
const noteInput = document.getElementById('noteInput');
const newNote = noteInput.value.trim();
if (newNote !== '') {
const noteList = document.getElementById('noteList');
const noteItem = document.createElement('div');
noteItem.classList.add('alert', 'alert-info');
noteItem.textContent = newNote;
noteList.appendChild(noteItem);
// Save notes to localStorage
let savedNotes = JSON.parse(localStorage.getItem('notes')) || [];
savedNotes.push(newNote);
localStorage.setItem('notes', JSON.stringify(savedNotes));
noteInput.value = '';
}
}
</script>
</body>
</html>