Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id = 'test'></div>
<div id = 'nullObject'></div>
              
            
!

CSS

              
                #test { 
           height: 500px;
		   		 width: 500px;
				   position:absolute; 
				    
		    }
			
			.textlineholder {
						width: 100%;
						display:inline-block;
						position: relative;
			 }
			 
			 .letter {
			      height: 1rem;
					  width: 0.5rem;
					  display:inline;
					  position: relative;
					  opacity: 1;
			  }
              
            
!

JS

              
                /* this script takes text out of a jason object, breaks it into individual letters, 
   and set each individual letter in its own <div> . the ideas is to be able to 
   animate each letter individualy using stagger. 
 */ 



var test = document.getElementById('test');
var linecontainer = document.createElement('div');
                
            linecontainer.id = 'line1';
            test.appendChild(linecontainer);
            linecontainer.className = 'textlineholder';
	 
    var letterArray = [' ','a','b','c','d','e','f','g','h','i', 'j', 'k', 'l', 'm', 'n', 'o','p','q','r','s',
                             't','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9',':','-','@','.'];

        //console.log(letterArray.length);

    var MyKeyCode   = ['0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','16','17','18','19','20',
                       '21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40']
    
    //var myMessage = 'Get in touch with me, by phone: 514-550-0899, by email: ohavben@gmail.com';
   // var messageIndexline1 = ['6', '4','19','37','8','13','37','19','14','20','2','8'];
    var messageIndexline2 = []
    
    var imagination = ['9','13','1', '7', '9','14','1','20','9','15','14']; //11
    var contactme =   [' ', '3','15','14','20','1','3','20','0','13','5' ]; //11

    var creativity =  ['0' ,'3' ,'18','5' ,'1' ,'20','9' ,'22','9' ,'20','25','0' ]; //12
    var phoneNumber = ['33','29','32','39','33','33','27','39','27','36','37','37']; //12

    var myEmail =       ['15','8','1','22','2','5' ,'13','40','7' ,'13','1' ,'9','12','41','3' ,'15','13']; //17
    var buildnewstuff = ['0' ,'0','2','21','9','12','4' ,'0' ,'14','5' ,'23','0','19','2' ,'19','19','0' ]; //17
    
    // imagination >> contact me
    // creativity >> phone
    // buildnewstuff >> email

	var myTextDiv = [];
  var letters = [];
  var myIndex;

  for (var i=0; i < imagination.length; i++){
    
    myIndex = imagination[i];
   // console.log(myIndex);
    
    myLetter = letterArray[myIndex];
    myTextDiv.push(myLetter);
    //console.log(myTextDiv);
    //console.log(myLetter)
    
    var textdiv = document.createElement('div');
                  textdiv.id = 'textdiv'+i;
                  linecontainer.appendChild(textdiv);
                  textdiv.innerHTML = myLetter;
                  textdiv.className = 'letter'; 
    
    
  }

// logic for changing index number
// get the index numbers to switch from to 
// for berevity we assume the to and from message have the same number of characters 
// and we know the array length in advance
var textFrom;
var textTo;
var textDifference
var textDirection;

for (var v = 0 ; v < 10 ; v++) {
  
  // find the from 
  // find the two
  // calculate the difference
  // need  to bind the difference between the domain of the array
  
  textFrom = imagination[v];
  textTo = contactme[v];
  textDifference = textTo-textFrom;
  //console.log(textDifference);
  if ( textDifference > 0) { textDirection = '++'; }
  if ( textDifference < 0 ) {
              textDirection = '--';
              textDifference = Math.abs(textDifference);
              //console.log(' v is ' + v + 'and dif is ' + textDifference);
            }
  if ( textDifference > 0) { textDirection = '++'; }
  
   console.log(' v is ' + v + 'and dif is ' + textDifference + 'and direction is ' + textDirection);  
                        
}
   // for ( d = textFrom ; ){}
  


//test.innerHTML = myTextDiv;


	/*					
	for ( var i=0 ; i < imagination.length ; i++) {
            var linecontainer = document.createElement('div'),
                letters = myArray.text1[i].txt.split("");

            linecontainer.id = 'line'+i;
            test.appendChild(linecontainer);
            linecontainer.className = 'textlineholder';
			  
            for ( var k=0 ; k < letters.length ; k++){
                    var textdiv = document.createElement('div');
                        textdiv.id = 'textdiv'+i+k;
                        linecontainer.appendChild(textdiv);
                        textdiv.innerHTML = letters[k];
                        textdiv.className = 'letter';        
              }
	
	}		
			 var elements = document.getElementsByClassName('letter');
    	 TweenMax.staggerFromTo(elements, 1, { 
                                            rotation:180, 
                                            scale:10,
                                            opacity:0
                                           },
                                           {
                                            rotation:0, 
                                            scale:1, 
                                            opacity:1
                                            }, 0.25);  	


/* var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('xlink','http://www.w3.org/1999/xlink');
svg.setAttribute('width','187');
svg.setAttribute('height','234');

var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
rect.setAttribute('width','187');
rect.setAttribute('height','234');
rect.setAttribute('fill','#fff');
rect.setAttribute('stroke','#000');
rect.setAttribute('stroke-width','2');
rect.setAttribute('rx','7');

var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
text.setAttribute('x', '10');
text.setAttribute('y', '20');
text.setAttribute('fill', '#000');
text.textContent = '2';

svg.appendChild(rect);
svg.appendChild(text); 

var wp = document.getElementById('wrapper'); 
wp.appendChild(svg); 

https://www.dashingd3js.com/svg-text-element

*/
              
            
!
999px

Console