electron-cnc-client use HTML5 and CSS3 to render UI. However, both HTML and CSS are intend to make static UI,
to bring you the ability to write dynamic UI, we provide some extension tags.
We call the HTML with extension tags Layout HTML
.
Because we have extension tags, you can't preview Layout HTML in other editors or IDEs. The only approach is let electron-cnc-client render it.
For security reasons, you can't link other files like css. To use CSS, add css files in ClientConfiguration.json
You use these tags just like normal HTML tags, and they will render to normal DOM.
With this element , you specify its child element move while mouse moves. Formula to calculate element move (in pixel): see
This feature is implement by adding an
div
element with styleposition: absolute
, check your child element to make sure thisdiv
element won't affect your layout
Specify move speed of element. speed-x
field specify the speed on x-axis, and speed-y
field specify on y-axis. Values of these fields are rate that used to multiply by mouse offset on screen center. Default value: 1
, means move as faster as pointer's speed
A fixed offset (in pixel) of the element position.
Specify which css property is affected by mouse movement. Default value: left
Specify which css property is affected by mouse movement. Default value: top
Specify max move range on each side (in pixel). Missing fields fallback to Infinity
, which means unlimited.
Specify wrapper element's z-index
. Default value: 0
You may need a button or anchor to navigate user to other pages or external website. So we provide you a <functional-button>
tag instead of <a>
or <button>
.
Using our extended <functional-button>
, you could access these functionalities: navigate external or internal links, close app.
Specify the functionality you want.
value | functionality | description |
---|---|---|
external-link | Open link in explorer or browser |
Using explorer or browser depends on you link protocol. You should also specify link |
client-link | Navigate to other client page | You should also specify link |
close-app | Close client | |
open-modal | Open modal |
Open a modal defined by modal-page |
close-modal | Close current opened modal |
The link to navigate.
The modal to open.
A mask image, used to define clickable area. The black pixel on this image is identified as NON-clickable.
Now, the image is always fill to fit the entire element. We don't provide fitting options like
object-fit
.
Because Chromium detecting hover activity by calculating the rect element area, traditional :hover
pseudo-class don't satisfy our requirement.
So you could provide a optional hover-class
indicate that these class is used on hover.
Display difference text depends on client's internal variables.
Variable's name
name | value | description |
---|---|---|
username | username | |
theme | Theme name | |
themePath | Path to theme folder | Absolute path |
A portal element used to host a modal. It accepts a modal-id
to identify different modals. After defined a modal,
use functional-button
with func-type="open-modal" modal="<your-modal-name>"
to open your modal,
and use func-type="close-modal"
to close a modal.
Modal is semantically belongs to page, and it shared the same style sheets with page. When navigated to another page, modals are also destroyed with old page. Though you can use modal to host another page, but a separated page is a better way.
A string used to identify modal.