kalker/kalk_web
2021-01-05 01:25:30 +01:00
..
public Fixed kalk_web error handling 2021-01-04 20:47:33 +01:00
src kalk_web placeholder 2021-01-05 01:25:30 +01:00
.gitignore Moved from Rollup to Webpack in kalk_web 2021-01-02 17:20:00 +01:00
package-lock.json kalk_web made sizing more dynamic, added spacing to lines 2021-01-04 19:29:07 +01:00
package.json kalk_web placeholder 2021-01-05 01:25:30 +01:00
preview.png Updated README files to include the new libraries and how to use kalk-component 2021-01-04 20:56:12 +01:00
README.md kalk_web placeholder 2021-01-05 01:25:30 +01:00
tsconfig.json Moved from Rollup to Webpack in kalk_web 2021-01-02 17:20:00 +01:00
webpack.config.ts kalk_web history 2021-01-04 17:07:46 +01:00

Kalk Web Component

npm license

A web component built with Svelte that uses kalk (WebAssembly).

preview

Installation & Setup

npm install --save @paddim8/kalk-component

Module

import { KalkCalculator, ConsoleLine } from "@paddim8/kalk-component"

If your bundler doesn't include all the files in the output folder, you may need to eg. modify your build script to copy them over manually. I am not aware of a better way.

Or only with HTML

<script type="text/javascript" src="some/path/bundle.js"></script>

Usage

<div class="kalk"> <!-- Apply css rules for position/size/font/etc. to this -->
    <kalk-calculator>
        <console-line>kalk</console-line>
        <console-line>
            <span class="hint">Type 'help' for instructions.</span>
        </console-line>
</kalk-calculator>
</div>

Customizing

The colours in the component can be changed by using these attributes.

<kalk-calculator
    hintText="Type something..." 
    identifierColor="cornflowerblue"
    operatorColor="darkorange"
    promptColor="mediumseagreen"
    errorColor="tomato"
    hintColor="#9c9c9c"
    linkColor="cornflowerblue"
    backgroundColor="#424242" />