0.0.7 • Published 2 years ago

@universityofmaryland/hero v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

<umd-hero> element

Installation

$ yarn add @universityofmaryland/hero

Basic Usage

Import the hero in your js if you bundle using a transpile with babel or typescript.

import '@universityofmaryland/hero';

HTML usage

<umd-hero source="/video.mp4" image="/placeholder.png" media-title="hero video">
  <div slot="text">
    <h1>Headline Example</h1>
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
      veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
      commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
      velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
      cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
      est laborum.
    </p>
    <a href="#" class="call-to-action">Learn More</a>
  </div>
</umd-hero>

Attribute options

  1. image (REQUIRED) - Background image of placeholder image for the video - can be relative or absoulte path
  2. media-title (REQUIRED) - accessibility text - string to communicate to users with assist technologies the message of the asset
  3. source - video reference - can be relative or absoulte path
  4. slide-in-time - animation time in milliseconds (defaults to 3000)
  5. direction - placement of the text (defaults to right)
  6. layout - options: overlay & split (defaults to overlay)

Advanced Usage

Split Layout - with video to the left

<umd-hero
  source="/video.mp4"
  image="/placeholder.png"
  media-title="hero video"
  layout="split"
  direction="left"
>
</umd-hero>

Styling

You can (and should) overwrite basic styling to fit your needs

umd-hero::part(section) {
  padding: 40px;
}

@media (min-width: 1024px) {
  umd-hero::part(section) {
    width: 40%;
    padding: 80px;
  }
}

[slot='text'] h1 {
  margin-bottom: 20px;
}

[slot='text'] p {
  margin-bottom: 20px;
}

[slot='text'] .call-to-action {
  display: inline-block;
  text-transform: uppercase;
  font-weight: 700;
  padding: 10px 20px;
  color: #fff;
  background-color: #e21833;
  transition: background 0.5s;
  text-decoration: none;
}

License

Distributed under the MIT license. See LICENSE for details.

ajvansi-regexansi-stylesacorn-jsxansi-colorsacornarray-unionargparsebalanced-matchastral-regexchalkarray-includescallsitescall-bindbracesbrace-expansioncolor-convertarray.prototype.flatcontains-pathdir-globcross-spawnconcat-mapdefine-propertiescolor-namedebugenquirererror-exdeep-isemoji-regexdoctrineescape-string-regexpes-to-primitiveeslint-config-prettieres-abstracteslint-import-resolver-nodeeslint-plugin-eslint-commentseslint-rule-documentationeslint-module-utilseslint-scopeeslint-plugin-importeslint-utilsespreeestraverseesprimaeslint-plugin-prettieresrecurseesutilsfast-diffeslint-visitor-keysesqueryfast-levenshteinfast-deep-equalfile-entry-cachefill-rangefastqfast-globfast-json-stable-stringifyfind-upfunction-bindflat-cachefs.realpathfunctional-red-black-treeglobglob-parentget-intrinsicglobalsflattedglobbyhasgraceful-fsignorehas-bigintshas-flaghosted-git-infoimurmurhashimport-freshinheritsinflightis-biginthas-symbolsis-arrayishis-extglobis-boolean-objectis-date-objectis-callableis-globis-fullwidth-code-pointis-core-moduleis-negative-zeroisarrayis-stringis-number-objectis-regexis-numberis-symboljs-tokensjson-schema-traversejson5json-stable-stringify-without-jsonifyload-json-filelevnisexelodash.clonedeeplodash.truncatejs-yamllru-cachemerge2lodash.flattenmicromatchmsminimistminimatchnormalize-package-datanatural-compareobject-keyslodashobject.valuesobject.assignoncelocate-pathparent-modulep-locatep-limitpath-parsepath-is-absoluteparse-jsonobject-inspectpath-keyoptionatorpath-existspicomatchprelude-lspifyprettierprettier-linter-helperspkg-dirpath-typeread-pkgread-pkg-upqueue-microtaskregexppprogressrequire-from-stringpunycoderesolverun-parallelreusifyresolve-fromrimrafshebang-regexshebang-commandslice-ansispdx-correctspdx-expression-parseslashspdx-exceptionsspdx-license-idsstring-widthstring.prototype.trimendsprintf-jsstring.prototype.trimstartsemverstrip-bomp-trystrip-json-commentstablesvg-element-attributestext-tablestrip-ansitype-checkto-regex-rangetype-festtsliburi-jssupports-colortsconfig-pathsv8-compile-cachewhich-boxed-primitivewhichvalidate-npm-package-licenseunbox-primitiveyallistwrappyword-wraptsutils
0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago