ForgeKomponenty
sk

Komponenty

j-Typed

jComponent 20 · jcomponent@20 component Príklad načítaný s jComponent 20

Konfigurácia:

Konfigurácia je rovnaká ako Zľavy.jsJediný rozdiel je v tom, že všetky kľúče sú nižšie. to je udržať konzistenciu s inými komponentmi. id

  • NEW: selector {String} môže obsahovať nektovaný prvok na renderovanie textu
  • NEW: text {String} vo forme Text 1|Text 2|Text 3|Text N inak je text nahraný podľa path
  • typespeed {Number} v milisekundách (predvolená hodnota: 0)
  • startdelay {Number} v milisekundách (predvolená hodnota: 0)
  • backspeed {Number} v milisekundách (predvolená hodnota: 0)
  • smartbackspace {Boolean} to by len spätné slová po "Toto je" (predvolené: true)
  • shuffle {Boolean} šufľuje pruhy (predvolené: true)
  • backdelay {String} pred backspacing (predvolené: 700)
  • fadeout {Boolean} sa rozpadá namiesto zadného priestoru (predvolené: false)
  • fadeoutclass {String} css trieda pre fade animácie (predvolené: typed-fade-out)
  • fadeoutdelay {Number} sa odráža v milisekundách (default: 500)
  • loop {Boolean} vrstva (predvolené: false)
  • loopcount {String/Number} množstvo loops (predvolené: Infinity)
  • Prehľad kurzorov showcursor {Boolean} (predvolené: true)
  • cursorchar {String} kurzor charakter (predvolené: |)
  • autoinsertcss {Boolean} vloží CSS pre kurzor a fadeOut do HTML <head> (predvolené: true)
  • contenttype {String} obsahType html alebo null pre text (predvolené: html)

Globálne udalosti:

Opäť, rovnako ako Zľavy.jsPridaný parameter component

  • ON('typed.onComplete', function(typed, component) {})
  • ON('typed.preStringTyped', function(pos, typed, component) {})
  • ON('typed.onStringTyped', function(pos, typed, component) {})
  • ON('typed.onLastStringBackspaced', function(typed, component) {})
  • ON('typed.onTypingPaused', function(pos, typed, component) {})
  • ON('typed.onTypingResumed', function(pos, typed, component) {})
  • ON('typed.onReset', function(typed, component) {})
  • ON('typed.onStop', function(pos, typed, component) {})
  • ON('typed.onStart', function(pos, typed, component) {})
  • ON('typed.onDestroy', function(typed, component) {})

Použite ho so <ui-component name="typed">. Keď komponent ešte nie je načítaný, jComponent ho stiahne pri prvom použití z adresy v DEF.fallback (predvolene CDN Componentator). Autor: Denis Granec. Zdroj: úložisko komponentov Componentator, licencia MIT.

example.html
<div style="height:100px">
	<ui-component name="typed" path="messages" config="loop:true" style="white-space:pre"></ui-component>
</div>
<div style="height:50px">
	<ui-component name="typed" path="messages2" config="loop:true;typespeed:100;backspeed:50"></ui-component>
</div>

<script>
	var messages = 'npm install total.js^1000\n`+ <b>total.js@3.1.0</b>` ^1000\n`added <b>1 package</b> from 23 contributors and audited 1 package in <b>1.348s</b>` ^1000\n`found 0 vulnerabilities`';
	var messages2 = ['Hello world!', '<b>Total.js</b> is awesome!', 'jComponent is <b>awesome</b>!', 'Lorem ipsum', 'Lorem dolor'];

	var count = 0;
	ON('typed.onComplete', function(typed, component) {
		if (typed.el.id === 'myconsole') {
			count++;

			if (count === 5)
				typed.loop = false;
		}
	});
</script>