Skip to content

Commit b15da13

Browse files
committed
housekeeping, style update
1 parent 061fa61 commit b15da13

8 files changed

Lines changed: 162 additions & 52 deletions

File tree

.gitattributes

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Apply override to all files in the directory
2+
*.md linguist-detectable
3+
4+
# Auto detect text files and perform LF normalization
5+
* text=auto eol=lf
6+
7+
# The above will handle all files NOT found below
8+
# Documents
9+
*.doc diff=astextplain
10+
*.DOC diff=astextplain
11+
*.docx diff=astextplain
12+
*.DOCX diff=astextplain
13+
*.dot diff=astextplain
14+
*.DOT diff=astextplain
15+
*.pdf diff=astextplain
16+
*.PDF diff=astextplain
17+
*.rtf diff=astextplain
18+
*.RTF diff=astextplain
19+
*.md text diff=markdown
20+
*.mdx text diff=markdown
21+
*.tex text diff=tex
22+
*.adoc text
23+
*.csv text
24+
*.txt text
25+
*.sql text
26+
*.epub diff=astextplain
27+
28+
# Graphics
29+
*.png binary
30+
*.jpg binary
31+
*.jpeg binary
32+
*.gif binary
33+
*.tif binary
34+
*.tiff binary
35+
*.ico binary
36+
# SVG treated as text by default.
37+
*.svg binary
38+
# If you want to treat it as binary,
39+
# use the following line instead.
40+
# *.svg text
41+
*.eps binary
42+
43+
# Scripts
44+
*.bash text eol=lf
45+
*.sh text eol=lf
46+
# These are explicitly windows files and should use crlf
47+
*.bat text eol=crlf
48+
*.cmd text eol=crlf
49+
*.ps1 text eol=crlf
50+
51+
# Serialisation
52+
*.json text
53+
*.toml text
54+
*.xml text
55+
*.yaml text
56+
*.yml text
57+
58+
# Archives
59+
*.7z binary
60+
*.gz binary
61+
*.tar binary
62+
*.tgz binary
63+
*.zip binary
64+
65+
# Text files where line endings should be preserved
66+
*.patch -text
67+
68+
# Lua Source files
69+
*.lua text
70+
71+
# Luadoc output
72+
*.html text diff=html
73+
*.css text diff=css
74+
75+
# Exclude files from exporting
76+
.gitattributes export-ignore
77+
.gitignore export-ignore
78+
.gitkeep export-ignore

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Miguel Pimentel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@
66
<img src="https://img.shields.io/amo/dw/newtab-notes@semanticdata" />
77
<img src="https://img.shields.io/amo/users/newtab-notes@semanticdata" />
88
<!-- <img src="https://img.shields.io/github/license/semanticdata/firefox-new-tab-notes" /> -->
9-
<br>
10-
Firefox extension that transforms the New Tab into a minimalist, auto-saving text editor.
119
</p>
1210

11+
## Overview
12+
13+
Firefox extension that transforms the New Tab into a minimalist, auto-saving text editor.
14+
15+
## Features
16+
17+
- Integrates Firefox Sync. Access your notes across browser instances.
18+
- Dark/Light themes and toggle.
19+
- Autosaves your content after every keystroke.
20+
- Uses [Bulma](https://bulma.io/) for styling.
21+
- Uses [Fira Code](https://github.com/tonsky/FiraCode) as default font.
22+
1323
## Screenshots
1424

1525
![screenshot light theme](screenshot.png)

manifest.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"strict_min_version": "100.0"
88
}
99
},
10-
"version": "0.5.0",
10+
"version": "1.0.0",
1111
"author": "semanticdata",
1212
"icons": {
1313
"48": "src/icon48.png"
@@ -23,12 +23,5 @@
2323
"browser_style": true,
2424
"default_title": "New Tab Notes",
2525
"default_popup": "src/newtab.html"
26-
},
27-
"commands": {
28-
"_execute_browser_action": {
29-
"suggested_key": {
30-
"default": "Ctrl+Y"
31-
}
32-
}
3326
}
3427
}

src/newtab.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<!DOCTYPE html>
2-
<html data-theme="light">
2+
3+
<html lang="en" data-theme="light">
34

45
<head>
56
<meta charset="UTF-8" />
67
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
78
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
8-
<title>📝 New Tab Notes</title>
9+
<title>New Tab Notes</title>
910
<link rel="icon" type="image/png" sizes="48x48" href="icon48.png">
1011
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
1112
<link rel="stylesheet" href="styles.css">
@@ -20,25 +21,24 @@
2021
</head>
2122

2223
<body>
23-
2424
<nav class="navbar container">
2525
<div class="navbar-brand">
26-
<h1 class="title">📝 New Tab Notes</h1>
26+
<h1 class="nav-title">📝 New Tab Notes</h1>
2727
</div>
2828

2929
<div class="navbar-end">
30-
<button class="toggle" type="button" data-theme-toggle aria-label="Change to light theme">Change to light theme
30+
<button type="button" data-theme-toggle aria-label="Change to light theme">Change to light theme
3131
</button>
3232
</div>
3333
</nav>
3434

3535
<main class="container">
36-
<textarea class="textarea" id="notes" placeholder="Write something..."></textarea>
36+
<textarea class="textarea" id="notes" rows="" placeholder="Write something..."></textarea>
3737
</main>
3838

3939
<footer class="footer container">
4040
<p>Made with <a class="heart" href="https://github.com/semanticdata/firefox-new-tab-notes"></a> by <a
41-
href="https://github.com/semanticdata">SemanticData</a>.
41+
href="https://github.com/semanticdata">semanticdata</a>.
4242
</p>
4343
</footer>
4444

src/styles.css

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,30 @@
1212
--accent-color: #e0b0ff;
1313
}
1414

15+
html {
16+
background: inherit;
17+
}
18+
1519
body {
16-
box-sizing: border-box;
17-
padding: 1rem;
18-
height: 100vh;
1920
background: var(--bkg-color);
2021
color: var(--text-color);
22+
box-sizing: border-box;
23+
min-height: 100vh;
24+
padding: 1rem;
25+
max-width: 750px;
26+
margin: 0 auto;
2127
}
2228

2329
main {
24-
padding-top: 1rem;
30+
padding: 1rem;
31+
height: 80vh;
32+
}
33+
34+
button {
35+
background: inherit;
36+
border: none;
37+
cursor: pointer;
38+
font-size: 24px;
2539
}
2640

2741
a {
@@ -31,36 +45,30 @@ a {
3145
a:hover {
3246
color: var(--text-color);
3347
text-decoration: underline;
34-
filter: brightness(80%);
3548
}
3649

37-
/* #notes {
38-
display: flex;
39-
align-items: center;
40-
flex-direction: column;
41-
} */
42-
4350
.textarea {
4451
font-family: "Fira Mono", monospace;
45-
border-radius: 10px;
46-
line-height: 1.75rem;
47-
height: calc(100vh - 1rem);
4852
background: var(--alt-color);
4953
color: var(--text-color);
50-
padding: 1rem 2rem;
54+
min-height: 100%;
55+
padding: 1rem;
5156
}
5257

5358
.textarea::placeholder {
54-
filter: opacity(0.5);
5559
color: var(--text-color);
5660
}
5761

5862
.navbar {
5963
background: inherit;
64+
display: flex;
65+
justify-content: space-between;
6066
}
6167

62-
.title {
63-
color: inherit;
68+
.nav-title {
69+
font-size: 24px;
70+
font-weight: 600;
71+
line-height: 1.75;
6472
}
6573

6674
.footer {
@@ -69,16 +77,10 @@ a:hover {
6977
padding-top: 1rem;
7078
padding-bottom: 1rem;
7179
text-align: right;
72-
}
73-
74-
.toggle {
75-
background: var(--bkg-color);
76-
border: 0;
77-
cursor: pointer;
78-
font-size: 24px;
80+
font-size: 12px;
7981
}
8082

8183
.heart:hover {
8284
text-decoration: none;
8385
color: red;
84-
}
86+
}

src/tabnotes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ function getBrowser() {
3333

3434
function saveToDB() {
3535
data = {
36-
tab_note: document.querySelector("#notes").value
36+
tab_note: document.querySelector("#notes").value,
3737
};
3838
if (browser_type === "Chrome") {
39-
chrome.storage.sync.set(data, function () { });
39+
chrome.storage.sync.set(data, function () {});
4040
} else {
4141
browser_obj.storage.sync.set(data);
4242
}
@@ -50,7 +50,7 @@ function tabOpen(tab) {
5050
}
5151
});
5252
} else {
53-
browser_obj.storage.sync.get(["tab_note"]).then(result => {
53+
browser_obj.storage.sync.get(["tab_note"]).then((result) => {
5454
if (typeof result.tab_note !== "undefined") {
5555
document.querySelector("#notes").value = result.tab_note;
5656
}

src/toggle.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/* * Function to calculate current theme setting.
2-
* Look for a local storage value.
3-
* Fall back to system setting.
4-
* Fall back to light mode. */
5-
function calculateSettingAsThemeString({ localStorageTheme, systemSettingDark }) {
2+
* Look for a local storage value.
3+
* Fall back to system setting.
4+
* Fall back to light mode. */
5+
function calculateSettingAsThemeString({
6+
localStorageTheme,
7+
systemSettingDark,
8+
}) {
69
if (localStorageTheme !== null) {
710
return localStorageTheme;
811
}
@@ -36,7 +39,10 @@ const localStorageTheme = localStorage.getItem("theme");
3639
const systemSettingDark = window.matchMedia("(prefers-color-scheme: dark)");
3740

3841
/* 2. Work out the current site settings */
39-
let currentThemeSetting = calculateSettingAsThemeString({ localStorageTheme, systemSettingDark });
42+
let currentThemeSetting = calculateSettingAsThemeString({
43+
localStorageTheme,
44+
systemSettingDark,
45+
});
4046

4147
/* 3. Update the theme setting and button text accoridng to current settings */
4248
updateButton({ buttonEl: button, isDark: currentThemeSetting === "dark" });
@@ -51,4 +57,4 @@ button.addEventListener("click", (event) => {
5157
updateThemeOnHtmlEl({ theme: newTheme });
5258

5359
currentThemeSetting = newTheme;
54-
});
60+
});

0 commit comments

Comments
 (0)