cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              h1 Cree.js
span © CaspianSeagull

span latin only
textarea#encStr

span.test

.paper

            
          
!
            
              *
	position relative
	box-sizing border-box
	
	&:focus
		outline none
	
h1, h1 + span, h1 + span + span
	margin 0
	font-family sans-serif
	color #333
	
h1 + span, h1 + span + span
	display block
	font-size 14px
	margin-bottom 2em
	
h1 + span + span
	margin-bottom 0
		
input,
textarea
	margin-bottom 24px
	padding 4px
	text-transform uppercase
	color #000
	border 2px solid #000
	width 100%
	min-width 100%
	max-width 100%
	height 100px
	
	&[type="button"]
		width 32px
		left -6px
		padding 4px 10px
		cursor pointer
		background #000
		color #fff

.paper
	padding 1px
	line-height 1
	font-size 0
	text-align justify
	cursor none
	font-size 0px
	line-height 1
	
letH = 32px
strokeW = 2px

.letter-num
	width 22px
	height 2px
	background #000
	position absolute
	top 0px
	left 0px
	transform-origin 0% 50%
	transition all .3s ease
	
	&.let-1
		width 32px
		height 2px
		transform rotate(90deg)
		left 14px
		top 16px
		
	
	&.let-2
		left -1px
		top 0px
		border-radius 10px 0 0 10px
		transform rotate(135deg)
		
	&.let-3
		left 0px
		transform rotate(-135deg)
		
	&.let-4
		left -1px
		top 0px
		transform rotate(-45deg)
		
	&.let-5
		left -1px
		top 0px
		transform rotate(45deg)
		
	&.let-6
		left auto
		right -1px
		top 0px
		transform rotate(-45deg)
		transform-origin 100% 50%
			
	&.let-7
		left auto
		right -1px
		top 0px
		transform rotate(45deg)
		transform-origin 100% 50%
.expanded .letter
	margin 0px 8px
	
.letter
	display inline-block
	width letH
	height letH
	/* background rgba(0,0,0,.1) */
	border 2px solid #000
	border-top 0px
	margin -1px -1px
	transition all .2s ease
	z-index 100
	
	&.q1
		transform rotate(0deg)
		
		.let-1
			transform rotate(90deg)
	&.q2
		transform rotate(90deg)	
		
		.let-1
			top 15px
			transform rotate(0deg)
	&.q3
		transform rotate(180deg)
		
		.let-1
			left 14px
			width 30px
			transform rotate(-90deg)
	&.q4
		transform rotate(270deg)
		
		.let-1
			top 16px
			transform rotate(180deg)
			
			
.letter:hover
	z-index 600
	border-color red
	
	.letter-num
		background red
            
          
!
            
              // Elements
var encBtn = $("#encBtn"),
	encStr = $("#encStr"),
	tester = $(".test"),
	paper  = $(".paper");


// Alpabet
var engAlph =
['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',' ','.'];


// CREE lib is in attachements
var cree = new CREE({

	 alphabet: engAlph,
	groupSize: 7,
 	    paper: '.paper'

});


// Encode func
function encode() {
	var stringToEnc = encStr.val();
	cree.encode( stringToEnc );
}


// Input events
encStr.on('keypress', function( ) {                      encode();  });
encStr.on('keyup'   , function(e) {  if (e.keyCode == 8) encode();  });
encStr.on('keydown' , function(e) {	 if (e.keyCode == 8) encode();  });


// Expand letters
paper.on('click', function() {
	$(this).toggleClass("expanded");
})
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console