kalker/web
2023-01-24 20:01:10 +01:00
..
public Renamed to kalker 2021-06-02 22:32:30 +02:00
src web: Add 'base' command to REPL 2023-01-24 19:48:40 +01:00
.gitignore Renamed to kalker 2021-06-02 22:32:30 +02:00
package.json v2.0.3 (v2.0.2 broke) 2023-01-24 20:01:10 +01:00
preview.png Renamed to kalker 2021-06-02 22:32:30 +02:00
README.md Renamed to kalker 2021-06-02 22:32:30 +02:00
tsconfig.json Renamed to kalker 2021-06-02 22:32:30 +02:00
webpack.config.ts Renamed to kalker 2021-06-02 22:32:30 +02:00

Kalker Web Component

npm license

A web component built with Svelte that uses the kalk library (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>kalker</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..." 
    autofocus="true"
    identifiercolor="cornflowerblue"
    operatorcolor="darkorange"
    promptcolor="mediumseagreen"
    errorcolor="tomato"
    hintcolor="#9c9c9c"
    linkcolor="cornflowerblue"
    backgroundcolor="#424242" />