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

ascee

v2.0.0

Published

Ascee: The 3D Model to Ascii Art Visualizer By Using Three.js.

Downloads

1

Readme

Ascee - A Library for Viewing Three.js Models in Ascii Art mode

Ascee is a meticulously crafted JavaScript library designed to provide an immersive experience for viewing Three.js models in captivating Ascii Art mode. This library was created by Daniel Preil and is available under the MIT License."

Installation

To use Ascee, you can install it via npm. Open your terminal and run the following command:

npm install ascee

Usage

Here's an example of how to use Ascee in your JavaScript code:

import { asceeCreateCanvas, asceeCreateModel, asceeCreateLight, asceeCreateRender } from "./node_modules/ascee/index.js"
// Import the functions from the Ascii package.

// Wait for the DOM content to be fully loaded.
window.addEventListener("DOMContentLoaded", () => {
  
  // Grab The Model, Canvas, Image (The model may have either a .gltf or .glb extension.)
  const modelElement = "./models/yourmodel.gltf"
  const canvasElement = document.querySelector(".myCanvas")
  const imageElement = document.querySelector(".myImage")
  const asciiElement = document.querySelector(".myAscii")

  // Create The asceeCanvas With The parameters or use The Defaults
  // Parameters: CanvasElement: String, TransparentBackground: Boolean, Camera Aspect Ratio: Number, Camera Near: Number, Camera Far: Number,  Camera Z Axis: Number
  const asceeCanvas = asceeCreateCanvas(canvasElement, true, 75, canvasElement.clientWidth / canvasElement.clientHeight, 0.1, 1000, 2.5)
  
  // asceeCanvas Object Destructuring (Get The: renderer, scene, camera)
  const asceeRenderer = asceeCanvas.renderer
  const asceeScene = asceeCanvas.scene
  const asceeCamera = asceeCanvas.camera
  
  // pass Those Values Into the asceeCreateModel Function That Takes care the things you have provided to
  // create the asceeModel of yours and display it on the scene
  // Grab The Variable as a return from the Function to use it later in the asceeCreateRender function
  const asceeModel = asceeCreateModel(asceeScene, modelElement, 0, -0.5)
  
  // asceeCreateLight Functions Take Care of creating Light Points, Users Can have Multiple ones in one scene
  // Parameters: asceeScene: THREE.Scene, lightStrength: Number, lightColor: Hexadecimal Number, lightPosition.x: Number, lightPosition.y: Number, lightPosition.z: Number
  asceeCreateLight(asceeScene, 3, 0xffffff, { x: 0, y: 0, z: 1 })
  asceeCreateLight(asceeScene, 3, 0xffffff, { x: 0, y: 1, z: 0 })
  asceeCreateLight(asceeScene, 3, 0xffffff, { x: 1, y: 0, z: 0 })
  
  // asceeCreateRender function to render the Scene, Camera + The Custom Hand Made Animations on the asceeModel
  // Parameters: asceeScene: THREE.Scene, asceeRenderer: THREE.WebGLRenderer, asceeCamera: THREE.PerspectiveCamera, asceeModel: THREE.Group, controls: Boolean, controlsDumpingEnabled: Boolean, modelYShouldRotate: Boolean, modelYRotation: Number, modelXShouldRotate: Boolean, modelXRotation: Number, imageElement: img Tag Element, asciiElement: pre Tag Element
  asceeCreateRender(asceeScene, asceeRenderer, asceeCamera, asceeModel, true, true, true, 0.01, false, 0, imageElement, asciiElement)
})

HTML Structure

Ensure that your HTML document adheres to the following structure (You have the flexibility to rename the class names, but ensure they match those used in the JavaScript code):

<div class="asceeContent">
    <canvas class="myCanvas"></canvas>
    <img class="myImage" src="" alt="myImage">
    <pre class="myAscii"></pre>
</div>

Recommended CSS

You can use the following CSS to style your Ascee content:

/* Highly Recommended CSS */

.asceeContent {
  color: white;
  position: relative;
  top: 0%;
  left: 0%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Change Background Color Of The Model */
  background-color: black;
}

.myCanvas {
  position: absolute;
  top: 0%;
  left: 0%;
  width: 100%;
  height: 100%;
  opacity: 0%;
  z-index: 5;
}

.myImage {
  position: absolute;
  top: 0%;
  left: 0%;
  pointer-events: none;
  user-select: none;
  width: 100%;
  height: 100%;
  z-index: 10;
  /* Converting Model to Grayscale (If You Want to See Your Model in Grayscaled) */
  /* -webkit-filter: grayscale(1);
  filter: gray;
  filter: grayscale(1); */
  /* Turn Off Opacity */
  opacity: 0%;
}

.myAscii {
  z-index: 30;
  user-select: none;
  pointer-events: none;
}

/* Highly Recommended CSS Over */