Designer card with horizontal & vertical titles, image, and mouse-over text, a standards-based DOM Component
npm install rwt-kanji

##### Open Source DOM Component
by Read Write Tools | Abstract |
|---|
| The rwt-kanji DOM component displays a designer card which has a horizontal title, a vertically transformed subtitle, text that is formatted as a blockquote, and an image with a mouse-over explanation. |
The rwt-kanji DOM component is intended for use on web pages
where the reader's attention is only lightly engaged.
Sometimes a reader is in scan
mode, rather than comprehension mode.
They are sniffing for the scent of things. When that's the case, this component
can be used to present a complex idea as a simple visualization.
When a user's interest is piqued, more information can be revealed to the reader
by hovering the mouse over the card's prominently displayed image. The extra
information fades in, revealing itself on top of the image.
This component takes its name from its original use case: describing the
inspiration behind the logos used in the desktop apps of Read Write Tools.
#### In the wild
To see an example of this component in use, visit the READ WRITE TOOLS
home page. It uses several instances of this component. To understand what's
going on under the hood, use the browser's inspector to view the HTML source
code and network activity, and follow along as you read this documentation.
#### Prerequisites
The rwt-kanji DOM component works in any browser that supports
modern W3C standards. Templates are written using BLUE
PHRASE notation, which can be compiled into HTML using the free Read Write View
desktop app. It has no other prerequisites. Distribution and installation are
done with either NPM or via Github.
#### Download
OPTION 1: Familiar with Node.js and the OPTION 2: No prior experience using NPM? Important note: This DOM component uses Node.js and NPM and
Download using NPM
package.json file?
Great. Install the component with this command:
npm install rwt-kanji
Just follow these general steps:
package.json file in the root of your web project using the command:
npm init
npm install rwt-kanji
package.json as a convenient distribution and installation mechanism. The DOM component itself does not need them.
If you prefer using Github directly, simply follow these steps:
Download using Github
node_modules directory in the root of your web project.
git clone https://github.com/readwritetools/rwt-kanji.git
After installation, you need to add two things to your HTML page to make use of
it.
* Add a script tag to load the component's rwt-kanji.js file:
``html`
* Add the component tag somewhere on the page, supplying five pieces of slotted
text:
1. span slot=main-title The main title will be display horizontally across the topspan slot=side-title
of the card in a sans-serif font. Maximum length is approximately 25 characters.
2. The side title will be rotated and displayed verticallyspan slot=slogan
along the left-hand edge of the card in a sans-serif font. Maximum length is
approximately 25 characters.
3. A sentence that will be placed in the top half of the card. Itspan slot=image-text
will be captioned with quotation marks. Use
to break the sentence into
multiple lines if desired.
4. A sentence that will be hidden from the user until theimg slot=image src=URL
mouse is hovered over the image.
5. An image that should be square, ideally about 200 by 200
pixels.
Here's an example:
`html`
READ WRITE VIEW
PLAIN TEXT
Plain text reader.
Hypertext Markup writer.
The Japanese kanji 見 (mi) is used in words meaning seeing, looking at, and viewing. RWVIEW has adopted 見 as its logo.

#### Designer card size
The designer card is square by default. Its size may be overridden using CSS by
defining new values for --width and --height.
Adjust the --font-basis to shrink or grow the entire card.
`css`
rwt-kanji {
--font-basis: 1.0;
--width: calc(22rem * var(--font-basis));
--height: calc(22rem * var(--font-basis));
--sidebar-width: calc(2rem * var(--font-basis));
--title-height: calc(2rem * var(--font-basis));
}
#### Dialog color scheme
The default color palette for the dialog uses a dark mode theme. You can use CSS
to override the variables' defaults:
`css``
rwt-kanji {
--color: var(--white);
--accent-color1: var(--pure-white);
--background: var(--black);
--accent-background1: var(--pure-black);
--accent-background2: var(--nav-black);
--accent-background3: var(--medium-black);
--accent-background4: var(--gray);
--accent-background5: rgba(0,0,0,0.4);
}
The component issues life-cycle events.
component-loadedwaitOnLoading() method which returns a promise that resolves when the component-loaded event is received. Call this asynchronously with await.---
| Documentation | READ WRITE HUB | |
| Source code | github | |
| Component catalog | DOM COMPONENTS | |
| Package installation | npm | |
| Publication venue | READ WRITE STACK |
The rwt-kanji DOM component is licensed under the MIT License.

Copyright © 2020 Read Write Tools. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT License