Skip to content

Commit 6701b05

Browse files
committed
typing
1 parent 157d318 commit 6701b05

8 files changed

Lines changed: 30 additions & 25 deletions

File tree

_includes/clocks.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,34 @@
66
<div class="mono has-text-centered">
77

88

9-
<p class="time" id="current-time"></p>
10-
{% include clock.html type="hour" id="hourClock" %}
9+
<p class="time" id="current-time"></p>
10+
{% include clock.html type="hour" id="hourClock" %}
1111

12-
<p class="time" id="current-date"></p>
13-
{% include clock.html type="month" id="monthClock" %}
12+
<p class="time" id="current-date"></p>
13+
{% include clock.html type="month" id="monthClock" %}
1414

15-
<p class="time" id="current-year"></p>
16-
{% include clock.html type="year" id="yearClock" %}
15+
<p class="time" id="current-year"></p>
16+
{% include clock.html type="year" id="yearClock" %}
1717

18-
{% include clock.html type="decade" id="decadeClock" title="Decades" %}
18+
{% include clock.html type="decade" id="decadeClock" title="Decades" %}
1919

20-
{% include clock.html type="century" id="centuryClock" title="Centuries" %}
20+
{% include clock.html type="century" id="centuryClock" title="Centuries" %}
2121

22-
{% include clock.html type="millennia" id="millenniaClock" title="Millennia" %}
22+
{% include clock.html type="millennia" id="millenniaClock" title="Millennia" %}
2323

2424

2525
</div>
2626

2727

2828
<script>
29-
show_date_and_time();
29+
show_date();
30+
show_time();
3031
document.getElementById('current-year').innerHTML = new Date().getFullYear();
3132

3233
</script>
3334

3435
<style>
35-
.time{
36+
.time {
3637
margin: 0;
3738
}
3839
</style>

_includes/typing.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div id="sentence" class="idea"></div>
1+
<div id="sentence" class="idea" onclick="reset()"></div>
22
<div id="typingStats">
3-
<p id="typingAccuracy">accuracy: 0</p>
4-
<p id="medianWpm">median wpm: 0</p>
3+
<p id="typingAccuracy">accuracy: 0</p>
4+
<p id="medianWpm">median wpm: 0</p>
55
</div>
66

77
<style>
@@ -17,22 +17,23 @@
1717
margin-top: 6rem;
1818
visibility: hidden;
1919
}
20+
2021
#typingStats p {
2122
margin: 0;
2223
}
2324

2425
.caret {
2526
text-decoration: underline;
2627
text-decoration-thickness: 3px;
27-
28+
2829
}
2930

3031
.correct {
3132
color: #909090;
3233
}
3334

3435
.incorrect {
35-
background-color: rgba(241, 2, 2, 0.769);
36+
background-color: rgba(241, 2, 2, 0.769);
3637
white-space: pre-wrap;
3738
}
3839

@@ -43,5 +44,4 @@
4344

4445

4546
<script src="/assets/js/idea.js"></script>
46-
<script src="/assets/js/typing.js"></script>
47-
47+
<script src="/assets/js/typing.js"></script>

assets/data/ideas/lit.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[
22
"There must be some kind of way outta here, \n Said the joker to the thief",
33
"Though this be madness, yet there is method in't",
4-
"古池や 蛙飛び込む 水の音",
5-
"On the day they were to kill him, \n Santiago Nasar arose at five-thirty in the morning \n to wait for the boat carrying the bishop",
64
"But yesterday the word of Caesar might \n Have stood against the world; \n now lies he there",
75
"If you can keep your head when all about you \n Are losing theirs and blaming it on you",
86
"Things fall apart; the centre cannot hold; \n The best lack all conviction, \n while the worst, \n Are full of passionate intensity",

assets/js/datetime.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ function get_the_last_day_of_this_year() {
2424
}
2525
function get_sunrise_and_sunset() {
2626
}
27-
function show_date_and_time() {
27+
function show_date() {
2828
const today = moment();
2929
document.getElementById('current-date').innerHTML = today.format('ddd MMM DD');
30+
}
31+
function show_time() {
3032
function updateClock() {
3133
const now = new Date();
3234
document.getElementById('current-time').textContent =

assets/js/datetime.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ function get_sunrise_and_sunset(): void {
3636

3737
}
3838

39-
function show_date_and_time(): void {
39+
function show_date(): void {
4040

4141
const today = moment();
4242
document.getElementById('current-date')!.innerHTML = today.format('ddd MMM DD');
43+
44+
}
45+
46+
function show_time(): void{
4347
function updateClock(): void {
4448
const now = new Date();
4549
document.getElementById('current-time')!.textContent =

assets/js/idea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const setIdeaIdx = (filename, idx) => {
2828
};
2929
const getNextIdea = async (filename) => {
3030
if (!filename) {
31-
const typingFiles = ['lyrics', 'lit', 'films'];
31+
const typingFiles = ['lyrics', 'lit', 'films', 'phil'];
3232
filename = typingFiles[Math.floor(Math.random() * typingFiles.length)];
3333
}
3434
await readIdeas(filename);

assets/js/idea.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const setIdeaIdx = (filename: string, idx: number): void => {
3030

3131
const getNextIdea = async (filename?: string): Promise<string> => {
3232
if (!filename) {
33-
const typingFiles = ['lyrics', 'lit', 'films'];
33+
const typingFiles = ['lyrics', 'lit', 'films', 'phil'];
3434
filename = typingFiles[Math.floor(Math.random() * typingFiles.length)];
3535
}
3636
await readIdeas(filename);

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ layout: nav
1414
<script src="/assets/js/datetime.js"></script>
1515

1616
<script>
17-
show_date_and_time();
17+
show_time();
1818
</script>
1919

2020
<style>

0 commit comments

Comments
 (0)