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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Color Separation</title>
	<link type="text/css" rel="stylesheet" href="sp0-GIT.css">	 
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>	 	
</head>

<body>
	<h1> COLOR BREAKDOWN</h1>

	<div class="wrap">
		<div class="screenprint">
			
			<!-- INK COLOR BUTTONS -->
			<div class="inkGroup">
				<button class="inkText ink i1" id="p1"> underbase </button>
				<button class="inkText ink i2" id="p2"> purple </button>
				<button class="inkText ink i3" id="p3"> pink </button>
				<button class="inkText ink i4" id="p4"> orange </button>
				<button class="inkText ink i5" id="p5"> white </button>
				<button class="ink reset" id="pReset"> reset </button>			
			</div>

			<!-- PRINTED BREAKDOWN -->
			<div class="printGroup">
				<div class="pBefore">			
					<div class="print order_p1"></div>
					<div class="print order_p2"></div>
					<div class="print order_p3"></div>
					<div class="print order_p4"></div>
					<div class="print order_p5"></div>
					<div class="print pAll"></div>						
				</div>

				<div class="pAfter">
					<div class="print"></div>
				</div>

			</div>
		</div>
	</div>	

	<h1> HALFTONE CLOSEUP </h1>

	<div class="wrap">
		<div class="screenprint">
			<br>

			<div class="inkGroup">
					<button class="inkText ink i1" id="b1"> ub </button>
					<button class="inkText ink i2" id="b2"> purple </button>
					<button class="inkText ink i3" id="b3"> pink </button>
					<button class="inkText ink i4" id="b4"> orange </button>
					<button class="inkText ink i5" id="b5"> white </button>
					<button class="ink reset" id="bReset"> reset </button>	
			</div>

			<div class="bitmapGroup">
				<div class="bBefore">				
					<div class="bitmap order_b1"></div>
					<div class="bitmap order_b2"></div>
					<div class="bitmap order_b3"></div>
					<div class="bitmap order_b4"></div>
					<div class="bitmap order_b5"></div>		
					<div class="bitmap bAll"></div>							
				</div>
				<div class="bAfter">
					<div class="bitmap"></div>
				</div>

			</div>
		</div>
	</div>		


<script src="sp0-GIT.js"></script>  

</body>

</html>
            
          
!
            
              body {
    background: #e2dcd7;
    text-align: center;
}
h1 {
    font-family: "Futura", sans-serif;
    margin-bottom: 25px;
    color: #70665f;
    margin-top: 40px;
}
.wrap {
    margin: 0px auto;
    margin-bottom: 50px;
    padding: 16px;
    text-align: center;
    vertical-align: middle;
    background: black;
    -webkit-box-shadow: 0px 40px 60px -20px rgba(0, 0, 0, 0.3);
            box-shadow: 0px 40px 60px -20px rgba(0, 0, 0, 0.3);
}

.screenprint .inkGroup, 
.screenprint .printGroup, 
.screenprint .bitmapGroup {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
}

/* INKS */
button {
    border-style: none;
    border-radius: 6px;
    width: 10%;
    height: 40px;
    margin-bottom: 5px;
}
button:focus {
    outline: none;
}
button.ink:hover {
/*    transform: translateY(-2px);*/
    opacity: 0.6;
}
button.ink.active {
    opacity: 0.6;
    transform: translateY(2px);   
}
.i1 {
    background: rgba(255, 255, 255, 0.7);
}
.i2 {
    background: rgba(147, 121, 208, 1);
}
.i3 {
    background: rgba(232, 30, 117, 1);
}
.i4 {
    background: rgba(255, 111, 32, 1);
}
.i5 {
    background: rgba(255, 255, 255, 1);
}

/*MEDIA QUERIES*/
@media (min-width: 800px){
    .inkText {
        color: black;
        font-weight: bold;
        font-size: 0.75rem;
    }
    .reset {
        background: rgba(255, 255, 255, 0.2);
        color: white;
        font-size: 12px;
    }   
    .bitmapGroup {
        border: 2px solid #474747;
        height: 500px;
    }    
}
@media (max-width: 799px){
    .inkText {
        font-size: 0rem;
    }
    .reset {
        background: rgba(255, 255, 255, 0.2);
/*        font-size: 0px;*/
        color: white;
        font-weight: lighter;
        font-size: 0.3rem;       
    }
    .bitmapGroup {
        border: 2px solid #474747;
        height: 280px;
    }    
}


/* PRINTS*/
.p1 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/p1.png);
    opacity: 0.7;
}
.p2 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/p2.png);
    opacity: 1;
}
.p3 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/p3.png);
    opacity: 1;
}
.p4 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/p4.png);
    opacity: 1;
}
.p5 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/p5.png);
    opacity: 1;
}
.pAll {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/pAll.png);
    opacity: 1;
}
.p1, .p2, .p3, .p4, .p5, .pAll {
    background-repeat: no-repeat;
    background-position: 15%;
    /*ADJUSTS THE PLACEMENT*/
}
.pBefore,
.pAfter {
    position: relative;
    height: 400px;
    width: 50%;
    margin: 5px;
    padding: 5px;
}
.print {
    left: 0%;
    top: 0%;
    position: absolute;
    height: 100%;
    width: 100%;
    background-size: 500px;
}
.printGroup {
    border: 2px solid #474747;
}

/*BITMAP*/
.b1 {   
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/bit1.png); 
    opacity: 0.7;
}
.b2 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/bit2.png);
    opacity: 1; 
}
.b3 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/bit3.png); 
    opacity: 1;
}
.b4 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/bit4.png); 
    opacity: 1;
}
.b5 {
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/bit5.png); 
    opacity: 1;
}
.bAll {   
    background: url(http://www.oxleberry.com/interactive/screenprints/hrb/images/bitAll.png); 
    opacity: 1;
}
.b0, .b1, .b2, .b3, .b4, .b5, .bAll {
    background-size: 265%;
    background-repeat: no-repeat;
    background-position: 60% 29%;
    /*ADJUSTS THE PLACEMENT*/
}
.bBefore, .bAfter {
    position: relative;
    width: 50%;
    margin: 5px;
    padding: 5px; 
}
.bBefore{
    z-index: 8;
}
.bitmap {
    left: 0%;
    top: 0%;
    position: absolute;
    height: 100%;
    width: 100%;
}

/* ANIMATION */
.slideRT {
            animation: slideRT 1.5s ease-in-out 1 forwards;
}
.slideLT {
            animation: slideLT 1.5s ease-in-out 1 forwards;
}
@keyframes slideRT {
    0% {
        transform: translateX(0px);
    }
    100% {
        transform: translateX(102%);
    }
}
@keyframes slideLT {
    0% {
        transform: translateX(102%);
    }
    100% {
        transform: translateX(0px);
    }
}

            
          
!
            
              

$(document).ready(function() {
    
    // INK BUTTON
    $("button.inkText").on("click", function() {
        var x = $(this).attr("id");
        repeatCheck(x);
    });
 
    // RESET BUTTON
    $("button.reset").on("click", reset);

});

// Determines the screencount based of the number of ink buttons 
function buttonCount() {

    var buttonsTotal = document.getElementsByTagName("button").length;
    // total buttons / 2 sections (print & bitmap) - 1 resetbutton
    screenCount = (buttonsTotal / 2) - 1
    // add one because the screen count starts at 1 not 0;
    screenCount += 1;
    return screenCount;
}
var screenCount = buttonCount();


// Check to see if the ink color has already been used, then activates accordingly
var doneArray = [];
function repeatCheck(sepColor) {
 
    var num = sepColor.charAt(1); 
    if (doneArray.length == 0){
        doneArray.push(num);  
        // console.log("FIRST");  
        printOrder(num); 
        $("button.ink.i" + num).addClass("active");
    }
    else if (doneArray.includes(num)){
        // console.log("REPEAT");
    } 
    else  {
        doneArray.push(num);
        // console.log("array = " + doneArray);
        printOrder(num);
        $("button.ink.i" + num).addClass("active");
    }
}

// to determine which ORDER placement the selected ink color should be
function nextOrder() {

    for (var i = 1; i < screenCount; i++) {
        if (!$(".order_p" + i).hasClass("slideRT")) {
            return(i);
        } 
    }
}

// ATTACHES IMAGES to the next order in line and slides both the 
// print and bitmap images over to the right
function printOrder(inkNum) {

    var orderNum = nextOrder();
    // console.log("order " + orderNum);
    // console.log("ink num " + inkNum); 
    $(".order_p" + orderNum).addClass("p" + inkNum);
    $(".order_b" + orderNum).addClass("b" + inkNum);

    // TOGGLING LOGIC
    if ($(".order_p" + orderNum).hasClass("slideLT")) {
        $(".order_p" + orderNum).toggleClass("slideRT");
        $(".order_b" + orderNum).toggleClass("slideRT");
        $(".order_p" + orderNum).toggleClass("slideLT");        
        $(".order_b" + orderNum).toggleClass("slideLT");
    } 
    else {
        $(".order_p" + orderNum).toggleClass("slideRT");
        $(".order_b" + orderNum).toggleClass("slideRT");
    }
}

// RESET IMAGES
function reset() {

    $(".print").each(function(){
        if ($(this).hasClass("slideRT")) {
            $(this).toggleClass("slideRT");
            $(this).toggleClass("slideLT");
        }
    });
    $(".bitmap").each(function(){
        if ($(this).hasClass("slideRT")) {
            $(this).toggleClass("slideRT");
            $(this).toggleClass("slideLT");
        }
    });
    delayClearOrder();
}

function delayClearOrder(){ 

    setTimeout(function () { 
        clearOrder(); 
    }, 1510);
}

function clearOrder() {      

    $(".print").each(function(){
        for (var i = 1; i < screenCount; i++) {
            $(this).removeClass("p" + i);         
        }
    });
    $(".bitmap").each(function(){
        for (var i = 1; i < screenCount; i++) {
            $(this).removeClass("b" + i);           
        }
    });    
    if ($("button.ink").hasClass("active")) {
        $("button.ink").removeClass("active");
    };
    doneArray = [];
    
}


            
          
!
999px
Loading ..................

Console