diff --git a/favicon.svg b/favicon.svg new file mode 100644 index 0000000..b0bd285 --- /dev/null +++ b/favicon.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index e4b78ea..6cd5d9f 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,15 @@ - - - - - Vite + React + TS - - -
- - + + + + + + + Calculator + + +
+ + diff --git a/manifest.webmanifest b/manifest.webmanifest new file mode 100644 index 0000000..eb29978 --- /dev/null +++ b/manifest.webmanifest @@ -0,0 +1,15 @@ +{ + "name": "Calculator", + "short_name": "Calculator", + "display": "standalone", + "orientation": "portrait", + "background_color": "#fff", + "scope": "/", + "start_url": "/", + "icons": [ + { + "src": "/favicon.svg", + "sizes": "any" + } + ] +} diff --git a/src/mathPlugin.ts b/src/mathPlugin.ts index 36b3d6a..9b8e20a 100644 --- a/src/mathPlugin.ts +++ b/src/mathPlugin.ts @@ -47,20 +47,16 @@ const createDecorations = (view: EditorView) => { const size = result.size() - switch (size.length) { - case 1: - decoration = Decoration.widget({ - widget: new MathResult(result.toString()), - side: 1, - }) - break - - case 2: - decoration = Decoration.widget({ - widget: new Matrix(result), - side: 1, - }) - break + if (size.length === 2) { + decoration = Decoration.widget({ + widget: new Matrix(result), + side: 1, + }) + } else { + decoration = Decoration.widget({ + widget: new MathResult(result.toString()), + side: 1, + }) } }