Giter Site home page Giter Site logo

charming's Issues

Word split removes spacing

When I use

charming(element, {
  splitRegex: /(\s+)/,
  classPrefix: 'word'
})

to split words, spaces are removed. It looks like they are still in DOM, but aren't shown.

Is there a way to split words and keep spaces ?

Splitting text nodes into words

Hey, thanks for making this! There doesn't seem to be an option, but I thought I would ask. Can you wrap words with spans similar to .lettering('words') in Lettering.js?

codepen issue

Kindly take a look at the codepen demo, for whatever reason it doesn't seem to work!

Split emoji

emoji is splited, can we use "runes" by default for split ?

use inline-block to enable css transforms

I suggest to use inline-block in order to enable the use of css transformations.
when settings the span elements zu inline block via css all the blank spaces disappear.

Split by letters break words

Splitting long phrases letters break-words in wrong manner e.g:

Hello
World

Hello Wo
rld

Any ideas to fix this? wrap each word with a div?

splitRegex doesn't seem to work with japanese based regex

Hello

thank you for this cool library!

I am trying to split a Japanese text 2 characters at a time with the option splitRegx, but it doesn't seem to work...

I think my regex is fine, but I am not Japanese so I may be wrong somewhere...

Any clues?

here is the regex
/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]{2}/
the test

console.log("過去顔ここコカ".match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]{2}/));
// 過去

my HTML code

<div class="prBox prBox2" id="js-prBox2">
          <p class="js-txtNode is-hidden">営業資料を作成する時、ブログの記事を書く時、<br>
          学術論文を執筆する時、判断や選択を迫られる時。</p>
          <p class="js-txtNode is-hidden">論理的な思考にはそれを裏付けるデータが欲しいです。<br>
          新たな発想を得るには見たことのないデータが必要です。</p>
          <p class="prTxtBig js-txtNode is-hidden">「マーケティングデータをアイディア化する」</p>
          <p class="js-txtNode is-hidden">互いにデータを開放することで新たな発見が生まれ、新たな視点で次のリサーチが始まります。<br>そうして集まった過去のアーカイブから簡単に自分のリサーチが作れるような仕組みをつくります。<br>そしてリサーチが誰でも気軽に実施できるツールとなり、</p>
          <p class="prTxtBig js-txtNode is-hidden">たくさんのアイディアが具現化して行きます。</p>
          <p class="js-txtNode is-hidden">データが開放された世界で何が起こるか、一緒に体験してください。</p>
</div>

and How I am instancing charming

  function setCharming() {
    return new Promise(function(resolve, reject) {
      var heroTxt = Array.from(document.querySelectorAll('.js-txtNode'));
      heroTxt.map(function (txt) {
        charming(txt, {
          // splitRegex: /(\u4e00\u9faf{4})/,
          // splitRegex: /^([^\.]+).([^\.]+)$/,
          classRefix: false
        });
        setTimeout(resolve , 100);
      });
    }); 
  }

How to contribute?

Hello, I am excited that someone try to create the vanilla version of Lettering Js, actually I want to contribute to this but I don't know how to do it in this repository.

Letter name/callback for class prefix

For styling individual/particular letters, it would be great if the wrapper elements have
a class for each letter, e.g. letter-W for all capital Ws.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.