@ewc-lib/ewc-banner
v1.0.1
Published
![Screenshot](./screenshot.png)
Downloads
12
Readme
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"