npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

coptic-cross-drop-down-menu

v2.1.0

Published

A drop-down menu for use in Coptic Church applications and websites.

Downloads

235

Readme

Coptic cross drop down menu component

Description

Create a drop-down menu for your church with this package. The package includes a few coptic-themed menu icons that can be used. The coptic cross icons that are used in this component are all 24px x 24px svg images. A different image can be supplied. And if needed, the image can be made larger by modifying the custom css property --icon-width;

Included Icons

alt text alt text alt text alt text

Included Stylesheet

styles.css

[!NOTE] Make a local copy of the icon image and stylesheet and include them in the root path of your project. This will allow you to either import them or link to them as needed.

You can make customizations by defining any of the following custom properties:

  --menu-background-color: rgb(150, 18, 18);
  --menu-font-color: white;
  --border-color: rgb(199, 181, 181);
  --icon-width: 30px;
  --aspect-ratio: 1;
  --img-left-indent: 3px;
  --img-left-padding: 2px;
  --img-left-margin: var(--img-left-padding);
  --icon-hover-border-style: dotted;
  --list-hover-border-style: dashed;
  --menu-font-size: 1rem;
  --menu-font-family: cursive;
  --menu-font-weight: 600;

Usage

Link the styles.css:

<link rel="stylesheet" href="./styles.css" />

If you're using a local copy of the script.js file, you can add it to your html file like below (it should be above other script files that import from it):

<script type="module" src="script.js"></script>

alternatively, use a static import in your script file

import { createCCMenu } from "./script.js";

Then create an object with the following key-value pairs.

const customImgObj = {
    src: <required local img-path or img-url>
    alt: <required-alt-message-string>
    id: <optional-id-string>,
    classList: <optional-classes-array--of-string>
}

See the code snippets below to learn how to use the module.

/**
 * The createCCMenu module expects the following arguments.
 * @param {*} docObj - the document object is required
 * @param {*} menuItemsArray - optional: an array of all the li elements of type Element that need to be included in the menu
 * @param {*} menuItemsStr - optional: a string containing the html fragment of the li elements to be added to the menu
 * @param {*} parentSelector - the parent selector of the menu is needed if it is not the default body element
 * @param {*} customImg - an object containing the path to a custom image if needed (required keys: src, alt) (optional keys: id, classList)
 * @returns the div element that was created for the menu.
 */

examples of calling this with default parameters and a string of li elements:

import { createCCMenu } from "./script.js"; //if you copied the script locally. Or use reference to the package "coptic-cross-drop-down-menu" instead.

function getListStr() {
  return `<li>first menu item</li>
        <li>second menu item</li>
        <li>third menu item</li>
        <li>fourth menu item</li>
        <li>fifth menu item</li>
        <li>sixth menu item</li>
        <li>seventh menu item</li>`;
}

function getImgObj() {
  return { src: "./church-menu.svg", alt:"church menu icon" };
}
createCCMenu(document, undefined, getListStr(), undefined, getImgObj());

another example:

function getListArray() {
  const arr = [];

  for (let i = 0; i < 7; i++) {
    const liEl = document.createElement("li");
    liEl.innerText = "menu item";

    arr.push(liEl);
  }
  return arr;
}

function getImgObj() {
  return { src: "./church-menu.svg", alt:"church menu icon" };
}
createCCMenu(document, getListArray(), undefined, "#my-parent-element", getImgObj());

A webpack example:

import "./styles.css";
import { createCCMenu } from "coptic-cross-drop-down-menu";
import churchMenuIcon from "./assets/church-menu.svg";

function getListArray() {
  const arr = [];

  for (let i = 0; i < 7; i++) {
    const liEl = document.createElement("li");
    liEl.innerText = "menu item";

    arr.push(liEl);
  }
  return arr;
}

function getImgObj() {
  return { src: `${churchMenuIcon}`, alt: "church menu icon" };
}
createCCMenu(document, getListArray(), undefined, undefined, getImgObj());