-
Notifications
You must be signed in to change notification settings - Fork 1
/
journal.html
174 lines (151 loc) · 5.68 KB
/
journal.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="en">
<head>
/* Ensures that the characters work regardless of what symbols or language is used and it loads appropriately sized on all devices */
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Journal Journal </title>
<!-- Include Quill.js -->
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<style>
/* Background image styling */
body, html {
height: 100%;
margin: 0;
background-image: url('assets/journal_background.jpg');
background-size: cover;
background-repeat: repeat;
}
/* Styling for the overlay text */
#overlay-text {
text-align: center;
font-size: 40px;
color: white;
margin-top: 20px;
}
/* Create a container for the editor and notes */
#content-container {
display: flex;
justify-content: space-between; /* Arranges editor and notes side by side */
border: none;
padding: 20px
}
/* Styling for the editor container */
#editor-container {
background-color: rgba(255, 255, 255, 0.8);
padding: 42px;
border: none;
max-width: 550px; /* Set the maximum width */
width: 100%; /* Ensure it takes full width within the maximum */
height: 250px;
outline: none;
}
/* Styling for the Quill editor content div */
.ql-editor {
word-wrap: break-word ; /* Allow text to wrap to the next line */
border: 0px solid rgba(255, 255, 255, 0.8);
}
/* Styling for the toolbar */
.ql-toolbar {
background-color: rgba(255, 255, 255, 0.8);
border: none;
margin-top: 0;
}
/* Styling for the save button */
#save-button {
margin-top: 20px;
padding: 15px 15px;
background-color: white;
color: black; /* Button text color */
border: none;
cursor: pointer;
display: block; /* Make it a block-level element for centering */
margin-left: auto;
font-size: 16px;
}
/* Styling for the notes container */
#notes-container {
flex: 1; /* Take up available space */
background-color: rgba(255, 255, 255, 0.8);
padding: 20px;
margin-left: 10px;
border: none;
max-width: 550px; /* Set the maximum width */
width: 100%; /* Ensure it takes full width within the maximum */
}
/* Styling for individual notes */
.note {
margin-bottom: 10px; /* Add space between individual notes */
border-bottom: 1px solid #ccc; /* Add a border line between notes */
padding-bottom: 10px;
word-wrap: break-word ;
}
/* Positioning for back link to take you to home page */
.back-link {
position: absolute;
top: 2px;
right: 10px;
font-size: 17px;
}
/* Styling for back link to take you to home page */
.back-link a {
color: white; /* Change the text color to white */
text-decoration: none; /* Remove underline from the link */
}
</style>
</head>
<body>
<!-- Overlay text -->
<div id="overlay-text">🚀⭐ launch your thoughts to the moon ⭐🚀 </div>
<!-- Create a container for the editor and notes -->
<div id="content-container">
<!-- Create the Quill editor -->
<div id="editor-container">
<div id="editor"></div>
<!-- Save button -->
<button id="save-button" class = "rounded-button">Launch Note</button>
</div>
<!-- Create the notes container -->
<div id="notes-container">
<h2>Notes:</h2>
<div id="saved-notes"></div>
</div>
</div>
<!-- Back link to take you to home page -->
<div class="back-link">
<p><a href="https://guptajanavi.github.io/cosmos-cares/">Back to the International Space Station</a></p>
</div>
<!-- Include Quill.js script -->
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
<script>
var Font = Quill.import('formats/font'); // Import the Font format
var quill = new Quill('#editor', {
theme: 'snow', // 'snow' is a simple theme with basic formatting options
modules: {
toolbar: [
[{ 'font': [] }],
[{ 'size': ['small', false, 'large', 'huge'] }],
['bold', 'italic'],
[{ 'color': [] }],
[{ 'list': 'bullet' }],
],
},
formats: ['font', 'size', 'bold', 'italic', 'color', 'list'],
});
// Save button click event
document.getElementById('save-button').addEventListener('click', function () {
var content = quill.root.innerHTML; // Get the content from the Quill editor
saveNote(content);
quill.root.innerHTML = ''; // Clear the editor content
});
// Function to save a note
function saveNote(content) {
var notesContainer = document.getElementById('saved-notes');
var noteElement = document.createElement('div');
noteElement.className = 'note';
noteElement.innerHTML = content;
notesContainer.appendChild(noteElement);
}
</script>
</body>
</html>