Socket
Book a DemoInstallSign in
Socket

@ewc-lib/ewc-banner

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewc-lib/ewc-banner

![Screenshot](./screenshot.png)

npmnpm
Version
1.0.6-alpha
Version published
Maintainers
0
Created
Source

Screenshot

Screenshot

API

There are the following attributes:

  • maintitle - sets the headline text
  • subtitle - sets the subtitle text
  • showlogo - true=shown (default), anything else hides the logo
  • gradientStyle - one of: "default" (default), "alt1" and "ECL411"
  • assetBaseURL - location to the icons which this element needs. If omitted, "./assets" is assumed. User of this element has to make sure the assets exist in the specified location (please see also webpack.config.js below).

Note: The default height is 128px and can be modified with the style property.

Note2: maintitle, subtitle and showlogo attributes can be changed at runtime

Usage with WebPack

package.json

"dependencies": {
  "@ewc-lib/ewc-banner": "^1.0.0"
}

webpack.config.js

const CopyPlugin = require("copy-webpack-plugin")

...

module: {
  rules: [
    {
      test: /\.css$/i,
      use: [
        'style-loader',
        'css-loader'
      ]
    }
  ]
},
plugins: [
  new CopyPlugin({
    patterns: [
      { from: "./node_modules/@ewc-lib/ewc-banner/assets/ewc-banner-logo.svg", to: "./assets" },
      { from: "./node_modules/@ewc-lib/ewc-banner/assets/ewc-banner-ribbon.svg", to: "./assets" },
    ],
  }),
],

index.html

<!DOCTYPE html>
<html>

  <head>
    <style>
      body{
          font-family: 'Arial', sans-serif;
          margin: 0;
        }
    </style>
  </head>

  <body>
      <script src="bundle.js"></script>
      <ewc-banner mainTitle="Demonstration of a title in a banner" subTitle="Demonstration of a subtitle"></ewc-banner>
  </body>

</html>

index.js

import "@ewc-lib/ewc-css/ewc.css"
import "@ewc-lib/ewc-banner"

FAQs

Package last updated on 11 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts