Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Make sure your code is compiled (run `bash bin/compile.sh` to start compilation

> **Tip:** You may use `npm start` to combine those two commands.

To explore examples, visit http://localhost:8081/public/examples/.

## Code minification

To minify files run `bash bin/minify.sh` script.
Expand Down
3 changes: 3 additions & 0 deletions src/examples/purity-todo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Purity Todo

When releasing a new version, update the version in the `manifest.json` file and the `purity-todo.sw.ts` file.
22 changes: 19 additions & 3 deletions src/examples/purity-todo/components/app-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@ export const ACTION_BUTTON = "action-button"

export const appStyle = (): string => render`
<style id="app-style">
:root {
--background-color: #f0f0f0;
--text-color: #555;
--shadow-color: #555;
}

@media (prefers-color-scheme: dark) {
:root {
--background-color: #484848;
--text-color: #f0f0f0;
--shadow-color: #000;
}
}

*,
*::before,
*::after {
font-family: sans-serif;
font-size: 20px;
color: #555555;
color: var(--text-color);
}

input[type='file'] {
Expand All @@ -19,9 +33,11 @@ export const appStyle = (): string => render`
body {
position: relative;
height: 100vh;
background-color: var(--background-color);
color: var(--text-color);
}

ol,
ol,
ul {
list-style-type: none;
padding: 0;
Expand Down Expand Up @@ -56,7 +72,7 @@ export const appStyle = (): string => render`
}

.${ACTION_BUTTON}.chosen {
color: white;
color: var(--background-color);
}

</style>
Expand Down
6 changes: 3 additions & 3 deletions src/examples/purity-todo/components/modal-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export const modalStyle = (): string => render`
width: 90vh;

overflow-y: auto;
background-color: white;
background-color: var(--background-color);
}

.modal {
border: 1px solid wheat;
box-shadow: 0px 4px 16px 0px;
border: 1px solid var(--shadow-color);
box-shadow: 0px 4px 16px 0px var(--shadow-color);
}

.modal .modal-header {
Expand Down
3 changes: 3 additions & 0 deletions src/examples/purity-todo/components/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const settingsStyle = () => render`
border-bottom: 1px solid lightgrey;
${lineContainerCSS}
}
ul.settings li:last-child {
border-bottom: none;
}

ul.settings li p {
${lineTextCSS}
Expand Down
6 changes: 4 additions & 2 deletions src/examples/purity-todo/components/task-list-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export const taskListStyle = (): string => render`
min-height: 3rem;
box-shadow: ${
[
isTopScrolled(state) && "inset 0px 16px 8px -16px",
isBottomScrolled(state) && "inset 0px -16px 8px -16px",
isTopScrolled(state) &&
"inset 0px 16px 8px -16px var(--shadow-color)",
isBottomScrolled(state) &&
"inset 0px -16px 8px -16px var(--shadow-color)",
]
.filter(isTruthy)
.join(",") || "none"
Expand Down
2 changes: 1 addition & 1 deletion src/examples/purity-todo/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Purity Todo 2.17",
"name": "Purity Todo 2.18",
"short_name": "ToDo",
"description": "Todo list written with purity.js",
"icons": [
Expand Down
2 changes: 1 addition & 1 deletion src/examples/purity-todo/purity-todo.sw.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const appScope = (self as any).registration.scope

Check warning on line 1 in src/examples/purity-todo/purity-todo.sw.ts

View workflow job for this annotation

GitHub Actions / code-style

Unexpected any. Specify a different type

const cacheName = `${appScope}@2.17`
const cacheName = `${appScope}@2.18`
const contentToCache = [
"./",
"./index.html",
Expand All @@ -14,7 +14,7 @@
"manifest.json",
]

self.addEventListener("install", (e: any) => {

Check warning on line 17 in src/examples/purity-todo/purity-todo.sw.ts

View workflow job for this annotation

GitHub Actions / code-style

Unexpected any. Specify a different type
console.log(`[purity-todo.sw.js] Install`)
e.waitUntil(
(async () => {
Expand All @@ -25,7 +25,7 @@
)
})

self.addEventListener("activate", (e: any) => {

Check warning on line 28 in src/examples/purity-todo/purity-todo.sw.ts

View workflow job for this annotation

GitHub Actions / code-style

Unexpected any. Specify a different type
console.log(`[purity-todo.sw.js] Activate`)
caches.keys().then(console.log)
e.waitUntil(
Expand All @@ -44,7 +44,7 @@
)
})

self.addEventListener("fetch", (e: any) => {

Check warning on line 47 in src/examples/purity-todo/purity-todo.sw.ts

View workflow job for this annotation

GitHub Actions / code-style

Unexpected any. Specify a different type
e.respondWith(
(async () => {
const r = await caches.match(e.request)
Expand Down
Loading