Skip to content

Commit 1339cc7

Browse files
committed
update(text color): make the eizabot text black
1 parent bce3ead commit 1339cc7

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

content/tutorial/01-svelte/07-lifecycle/03-update/app-a/src/lib/App.svelte

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<script>
22
import Eliza from 'elizabot';
3-
import {
4-
beforeUpdate,
5-
afterUpdate
6-
} from 'svelte';
3+
import { beforeUpdate, afterUpdate } from 'svelte';
74
85
let div;
96
@@ -18,9 +15,7 @@
1815
1916
const eliza = new Eliza();
2017
21-
let comments = [
22-
{ author: 'eliza', text: eliza.getInitial() }
23-
];
18+
let comments = [{ author: 'eliza', text: eliza.getInitial() }];
2419
2520
function handleKeydown(event) {
2621
if (event.key === 'Enter') {
@@ -45,9 +40,7 @@
4540
4641
setTimeout(() => {
4742
comments = comments
48-
.filter(
49-
(comment) => !comment.placeholder
50-
)
43+
.filter((comment) => !comment.placeholder)
5144
.concat({
5245
author: 'eliza',
5346
text: reply
@@ -103,6 +96,7 @@
10396
.eliza span {
10497
background-color: #eee;
10598
border-radius: 1em 1em 1em 0;
99+
color: black;
106100
}
107101
108102
.user span {

content/tutorial/01-svelte/07-lifecycle/03-update/app-b/src/lib/App.svelte

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
<script>
22
import Eliza from 'elizabot';
3-
import {
4-
beforeUpdate,
5-
afterUpdate
6-
} from 'svelte';
3+
import { beforeUpdate, afterUpdate } from 'svelte';
74
85
let div;
96
let autoscroll;
107
118
beforeUpdate(() => {
129
autoscroll =
13-
div &&
14-
div.offsetHeight + div.scrollTop >
15-
div.scrollHeight - 20;
10+
div && div.offsetHeight + div.scrollTop > div.scrollHeight - 20;
1611
});
1712
1813
afterUpdate(() => {
19-
if (autoscroll)
20-
div.scrollTo(0, div.scrollHeight);
14+
if (autoscroll) div.scrollTo(0, div.scrollHeight);
2115
});
2216
2317
const eliza = new Eliza();
2418
25-
let comments = [
26-
{ author: 'eliza', text: eliza.getInitial() }
27-
];
19+
let comments = [{ author: 'eliza', text: eliza.getInitial() }];
2820
2921
function handleKeydown(event) {
3022
if (event.key === 'Enter') {
@@ -49,9 +41,7 @@
4941
5042
setTimeout(() => {
5143
comments = comments
52-
.filter(
53-
(comment) => !comment.placeholder
54-
)
44+
.filter((comment) => !comment.placeholder)
5545
.concat({
5646
author: 'eliza',
5747
text: reply
@@ -107,6 +97,7 @@
10797
.eliza span {
10898
background-color: #eee;
10999
border-radius: 1em 1em 1em 0;
100+
color: black;
110101
}
111102
112103
.user span {

0 commit comments

Comments
 (0)