1.1.2 • Published 2 years ago

awesome-copyright v1.1.2

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
2 years ago

awesome-copyright

NPM version Build npm-typescriptLicense]github-license-url

Awesome copyright notice for Kuse and VanillaJS with auto-renewal of the year.

What is it for?

There is only one practical application - to create copyright notices with automatic replacement of the copyright renewal year. This is an npm test package created for one purpose - to learn how to create npm packages.

Installation:

npm install awesome-copyright

or

yarn add awesome-copyright

Usage :

In React

Add Copyright to your component:

import React from 'react'
import ReactDOM from 'react-dom/client'

import * as Copyright from "awesome-copyright";

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
  <React.StrictMode>
    <div>
      <footer>

        <Copyright.React // Use React component
          year={2022}
          yearOnly={false}
          creator="Igor Teplostanski"
          message="By"
          styles="copyright"
          creatorStyle="copyright__creator"
        />

      </footer>
    </div>
  </React.StrictMode>
)

In Vanilla JS

Add Copyright to your component:

import * as Copyright from "awesome-copyright";

Copyright.Vanilla({ // Use Vanilla js
  element: document.querySelector<HTMLDivElement>('#copyright')!,
  yearOnly: false,
  yearStyle: 'test',
});
ParamsTypeExampleDefault stateDescription
yearstring/number2023/"2023"current yearYear of copyright start
yearOnlybooleantrue/falsefalseShow only the Year the copyright started. It is disabled by default and if the current year differs from the year of the beginning, it shows the years in the format '2000-2023'
creatorstring"John Doe"""Name of the copyright holder.
copystring"®""©"Copyright symbol
messagestring"Create by"""The text before the creator 's name
stylessrting"copyright""" ( Only for React component )Styles the root block of the component. Accepts a string with the CSS class name/names
yearStylestring"year"""Styles the year block of the component. Accepts a string with the CSS class name/names
messageStylestring"message"""Styles the message block of the component. Accepts a string with the CSS class name/names name
copyStylestring"copy-symbol"""Styles the copy symobl block of the component. Accepts a string with the CSS class name/names
creatorStylestring"name"""Styles the creator block of the component. Accepts a string with the CSS class name/names
elementstring"#copyright"Required parameter for VanillaHTML element id