Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
crossword
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Silas Dohm
crossword
Commits
2e5f3a92
Commit
2e5f3a92
authored
Oct 7, 2022
by
Silas Dohm
Browse files
Options
Downloads
Patches
Plain Diff
renamed mode
parent
4b08af41
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes.js
+2
-2
2 additions, 2 deletions
classes.js
main.js
+8
-8
8 additions, 8 deletions
main.js
with
10 additions
and
10 deletions
classes.js
+
2
−
2
View file @
2e5f3a92
...
...
@@ -91,7 +91,7 @@ class Word {
e
.
draw
(
color
,
"
#bf060b
"
);
});
}
//
highlight
//
red rectangle
ctx
.
strokeStyle
=
"
#bf060b
"
;
if
(
this
.
direction
==
activeDir
)
{
this
.
li
.
style
.
borderColor
=
"
#bf060b
"
;
...
...
This diff is collapsed.
Click to expand it.
main.js
+
8
−
8
View file @
2e5f3a92
...
...
@@ -3,11 +3,11 @@ let canv = document.getElementById("mycanvas");
let
ctx
=
canv
.
getContext
(
"
2d
"
);
let
statusBar
=
document
.
getElementById
(
"
status
"
);
const
mode
=
{
visu
al
:
0
,
norm
al
:
0
,
insert
:
1
,
replace
:
2
};
let
activeMode
=
mode
.
visu
al
;
let
activeMode
=
mode
.
norm
al
;
let
activeDir
=
0
;
//0 = horizontal 1=vertical
let
activeCell
,
lastCell
;
let
size
=
80
;
...
...
@@ -25,7 +25,7 @@ function logKey(e) {
switch
(
activeMode
)
{
case
mode
.
insert
:
if
(
e
.
key
==
"
Escape
"
)
activeMode
=
mode
.
visu
al
;
activeMode
=
mode
.
norm
al
;
else
if
(
e
.
key
==
"
Backspace
"
)
{
activeCell
.
currentChar
=
""
;
if
(
activeDir
&&
activeCell
.
word
[
activeDir
]
==
activeCell
.
neighbour
[
1
].
word
[
activeDir
])
{
...
...
@@ -41,25 +41,25 @@ function logKey(e) {
if
(
activeCell
.
word
[
1
]
==
activeCell
.
neighbour
[
3
].
word
[
1
]
&&
activeCell
!=
activeCell
.
neighbour
[
3
])
activeCell
=
activeCell
.
neighbour
[
3
];
else
activeMode
=
mode
.
visu
al
;
activeMode
=
mode
.
norm
al
;
}
else
{
//across
if
(
activeCell
.
word
[
0
]
==
activeCell
.
neighbour
[
2
].
word
[
0
]
&&
activeCell
!=
activeCell
.
neighbour
[
2
])
activeCell
=
activeCell
.
neighbour
[
2
];
else
activeMode
=
mode
.
visu
al
;
activeMode
=
mode
.
norm
al
;
}
}
break
;
case
mode
.
replace
:
if
(
e
.
key
==
"
Escape
"
)
activeMode
=
mode
.
visu
al
;
activeMode
=
mode
.
norm
al
;
else
if
(
e
.
keyCode
>
64
&&
e
.
keyCode
<
91
)
{
activeCell
.
currentChar
=
e
.
key
;
activeMode
=
mode
.
visu
al
;
activeMode
=
mode
.
norm
al
;
}
break
;
case
mode
.
visu
al
:
case
mode
.
norm
al
:
switch
(
e
.
key
)
{
case
"
ArrowDown
"
:
case
"
j
"
:
//down
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment