123

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              .background_pattern_one
.background_pattern_two
h1 Ouran Host Club Memories
p.sub_text 桜蘭高校ホスト部
ul.container
  li#1.hideable.first_slide(style="display:block;")
  li#2.hideable.second_slide
  li#3.hideable.third_slide
  li#4.hideable.fourth_slide
  li#5.hideable.fifth_slide
  li#6.hideable.sixth_slide
  li#7.hideable.seventh_slide
  li#8.hideable.eight_slide
  li#9.hideable.ninth_slide
  li#10.hideable.tenth_slide
  li#11.hideable.eleventh_slide
  li#12.hideable.twelfth_slide
  li#13.hideable.thirteenth_slide
  li#14.hideable.fourteenth_slide
  li#15.hideable.fifteenth_slide
  li#16.hideable.sixteenth_slide
  li#17.hideable.seventeenth_slide
  li#18.hideable.eighteenth_slide
  label.slide_filter Change Slider Filter
    select#filterOptions
      option(value="color", selected="selected") Full Color
      option(value="semi_grayscale") Semi Grayscale
      option(value="grayscale") Grayscale
      option(value="sepia") Sepia
  .a_div
    p.counter_text Slide <span id="slideNumber"></span> of <span id="slideTotal"></span>
    form
      input(type="button", id="firstButton", value="First", onclick="goToEdge(false)")
      input(type="button", value="Back", onclick="toggleSlide(false)")
      input(id="pauseButton", onclick="toggleInterval()", type="button", value="Pause")
      input(type="button", value="Forward", onclick="toggleSlide(true)")
      input(type="button", id="lastButton", value="Last", onclick="goToEdge(true)")
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Merriweather:300,400,700);

body {
  background: pink url(https://dl.dropboxusercontent.com/s/oh93ieykkyfnadp/background_pattern.png?dl=0?raw=1) repeat;
}

h1 {
  color: pink;
  font: bold 2em/1.5em Merriweather, sans-serif;
  margin-bottom: 0;
  text-align: center;
  text-shadow: 0 1px black, 0 -1px white;
  position: relative;
  z-index: 5;
}

div,
p,
input,
li {
  font-family: Merriweather;
}

.sub_text {
  color: pink;
  display: block;
  text-align: center;
  font-size: 1.5em;
  font-weight: bold;
  margin: 0;
  position: relative;
  text-shadow: 0 1px black;
  z-index: 5;
}

.a_div {
  position: absolute;
  left: 0;
  bottom: -35px;
  text-align: center;
  width: 100%;
}

p {
  color: black;
  font-family: sans-serif;
  margin: 0;
}

p,
form {
  display: inline-block;
}

.container {
  background-color: pink;
  border-radius: 5px;
  box-shadow: 0 8px 6px -6px rgba(0, 0, 0, .5);
  height: 380px;
  list-style-type: none;
  margin: 20px auto 0 auto;
  padding: 25px 35px 25px 30px;
  position: relative;
  width: 640px;
  z-index: 5;
  -webkit-transition: box-shadow .2s ease;
  -moz-transition: box-shadow .2s ease;
  -o-transition: box-shadow .2s ease;
  transition: box-shadow .2s ease;
}

.container:hover {
  box-shadow: 0 6px 4px -6px rgba(0,0,0,.6);
}

li {
  background-color: crimson;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 5px solid white;
  border-radius: 2px;
  display: none;
  height: 100%;
  width: 100%;
}

.first_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/ez34q3lsyd1g90q/0cd79b82d31f49899eda4f62fd5a57d4.jpg?dl=0raw=1);
  background-position: top center;
}

.second_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/bopfentccah3kt4/18.png?dl=0raw=1);
}

.third_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/bbt65ba3qni1yre/coolpic.gif?dl=0raw=1);
}

.fourth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/rdh11imn0jyi0qc/maxresdefault.jpg?dl=0?raw=1);
}

.fifth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/ihpipf20cypardl/Ouran%20High%20School%20Host%20Club%20-%2003%20-%20Large%2021.jpg?dl=0?raw=1);
}

.sixth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/xgbayu2xnsno42c/ouran-pictures-1.jpg?dl=0?raw=1);
}

.seventh_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/w8qa9suu8tlst8l/Ouran-Wallpaper-ouran-high-school-host-club-20880690-1600-1200.jpg?dl=0?raw=1);
}

.eight_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/zoknrbmfjow5b5l/ouran_host_1.jpg?dl=0?raw=1);
}

.ninth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/iv80tjpzs5pb5bf/ouran_host_2.jpg?dl=0?raw=1);
}

.tenth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/o94qh9847biufdo/ouran_host_3.jpg?dl=0?raw=1);
}

.eleventh_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/6e70c7z21ljbxd9/ouran_high_school_host_club_fujioka_haruhi_suou_tamaki_hitachiin_kaoru_hitachiin_hikaru_ootori_kyoya_haninozuka_mitsukuni_morinozuka_takashi_guys_32836_2560x1080.jpg?dl=0?raw=1);
}

.twelfth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/78b6cioklh31i7z/ouran_high.jpg?dl=0?raw=1);
}

.thirteenth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/3ej4hbzty86spnp/Ouran.High.School.Host.Club.full.1747.jpg?dl=0?raw=1);
}

.fourteenth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/qar5bebiutqemd9/Ouran.High.School.Host.Club.full.240341.jpg?dl=0?raw=1);
}

.fifteenth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/uibi5vq0aa2tk95/Ouran.High.School.Host.Club.full.528358.jpg?dl=0?raw=1);
}

.sixteenth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/l7dezn3l0boe5i8/Screen-Shot-2013-06-20-at-9.32.29-PM.png?dl=0?raw=1);
}

.seventeenth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/gd5knqjbj1ahbp4/the_concert______host_club_x_reader_____part_one_by_oo0ryuuheartsyou0oo-d55w24k.jpg?dl=0?raw=1);
}

.eighteenth_slide {
  background-image: url(https://dl.dropboxusercontent.com/s/q19abofyfsloggm/tumblr_inline_mp2zwmuD4i1qz4rgp.jpg?dl=0?raw=1);
}
}

.container .hideable {
  display: none;
}

.counter_text {
  color: crimson;
  letter-spacing: .3em;
  text-transform: lowercase;
  text-shadow: 1px 1px white, -1px -1px white, 1px -1px white, -1px 1px white, 0 1px white, 1px 0 white, -1px 0 white, 0 -1px white, 0 4px 1px rgba(0,0,0,.5);
}

form input {
  background: transparent url(https://dl.dropboxusercontent.com/s/xs12ju2kqoh3i8b/pink-heart-md.png?dl=0?raw=1) no-repeat center center / 28px auto;
  border: none;
  color: white;
  cursor: pointer;
  height: 28px;
  text-shadow: 1px 1px crimson, -1px -1px crimson, 1px -1px crimson, -1px 1px crimson, 0 1px crimson, 1px 0 crimson, -1px 0 crimson, 0 -1px crimson;
  -webkit-transition: all .05s ease-in-out;
  -moz-transition: all .05s ease-in-out;
  -ms-transition: all .05s ease-in-out;
  -o-transition: all .05s ease-in-out;
  transition: all .05s ease-in-out;
}

form input:active {
  background-size: 24px auto;
  color: crimson;
  text-shadow: 1px 1px white, -1px -1px white, 1px -1px white, -1px 1px white, 0 1px white, 1px 0 white, -1px 0 white, 0 -1px white;
}

.background_pattern_one,
.background_pattern_two {
  height: 500px;
  overflow: hidden;
  position: absolute;
  right: -10%;
  left: -10%;
}

.background_pattern_one {
  transform: rotate(-6deg);
  transform-origin: top right;
  top: 152px;
  z-index: 2;
  -webkit-transform: rotate(4deg);
  -moz-transform: rotate(4deg);
  -ms-transform: rotate(4deg);
  -o-transform: rotate(4deg);
  transform: rotate(4deg);
}

.background_pattern_two {
  transform: rotate(6deg);
  transform-origin: bottom left;
  top: 320px;
  z-index: 1;
  transform: rotate(-15deg);
}

.background_pattern_one::after {
  background-color: #3D4957;
  content: " ";
  height: 407px;
  position: absolute;
  top: -262px;
  right: -5%;
  width: 148%;
  -webkit-transform: rotate(10deg);
  -moz-transform: rotate(10deg);
  -ms-transform: rotate(10deg);
  -o-transform: rotate(10deg);
  transform: rotate(10deg);
}

.background_pattern_two::after {
    background-color: #3D4957;
    content: " ";
    height: 484px;
    position: absolute;
    top: -447px;
    left: -5%;
    width: 150%;
    -webkit-transform: rotate(-13deg);
    -moz-transform: rotate(-13deg);
    -ms-transform: rotate(-13deg);
    -o-transform: rotate(-13deg);
    transform: rotate(-13deg);
}

.color {
  -webkit-filter: grayscale(0%);
  -moz-filter: grayscale(0%);
  -ms-filter: grayscale(0%);
  -o-filter: grayscale(0%);
  filter: grayscale(0%);
}

.semi_grayscale {
  -webkit-filter: grayscale(50%);
  -moz-filter: grayscale(50%);
  -ms-filter: grayscale(50%);
  -o-filter: grayscale(50%);
  filter: grayscale(50%);
}

.grayscale {
  -webkit-filter: grayscale(100%);
  -moz-filter: grayscale(100%);
  -ms-filter: grayscale(100%);
  -o-filter: grayscale(100%);
  filter: grayscale(100%);
}

.sepia {
  -webkit-filter: sepia(100%);
  -moz-filter: sepia(100%);
  -ms-filter: sepia(100%);
  -o-filter: sepia(100%);
  filter: sepia(100%);
}

.slide_filter {
  background-color: rgba(255,255,255,.4);
  border-radius: 3px;
  font: 700 1em/1em sans-serif;
  opacity: .5;
  padding: 5px;
  position: absolute;
  top: 35px;
  right: 40px;
  text-align :center;
  -webkit-transition: opacity .2s ease-in;
  -moz-transition: opacity .2s ease-in;
  -ms-transition: opacity .2s ease-in;
  -o-transition: opacity .2s ease-in;
  transition: opacity .2s ease-in;
}

.slide_filter:hover {
  opacity: 1;
}

.slide_filter select {
  background-color: white;
  border: none;
  color: crimson;
  display: block;
  font: 300 1em/1em sans-serif;
  margin:3px auto 0 auto;
}

#dot0 img,
#dot1 img,
#dot2 img,
#dot3 img,
#dot4 img,
#dot5 img,
#dot6 img,
#dot7 img,
#dot8 img,
#dot9 img,
#dot10 img,
#dot11 img,
#dot12 img,
#dot13 img,
#dot14 img,
#dot15 img,
#dot16 img,
#dot17 img,
#dot18 img,
#dot19 img,
#dot20 img,
#dot21 img {
  height: 30px !important;
}
            
          
!
            
              "use strict";

/* jQuery
------------------------------------ */
var selectFilter = $("#filterOptions");
var slides = $(".container li");
jQuery(document).ready(function($) {
  selectFilter.change(function() {
    if(selectFilter.val() == "grayscale") {
      slides.toggleClass("grayscale");
    } else if (selectFilter.val() == "semi_grayscale") {
      slides.toggleClass("semi_grayscale");
    } else if (selectFilter.val() == "sepia") {
      slides.toggleClass("sepia");
    } else if (selectFilter.val() == "color") {
      slides.toggleClass("color");
    }
  })
})

/* JS Slider
------------------------------------ */
// Thank you for the great tutorial by Geoffrey Liu!!!
// https://github.com/g-liu/slideshow/blob/master/index.html
var interval = 3500;
var switching = setInterval("toggleSlide(true)", interval);
window.paused = false;
// set slider interval
function toggleInterval() {
    var button = document.getElementById("pauseButton");
    // if value false
    if(!window.paused) {
        clearInterval(switching);
        button.value = "Resume";
    } else {
        // else toggleSlide() true to continue
        switching = setInterval("toggleSlide(true)", interval);
        button.value = "Pause";
    }
    window.paused = !(window.paused);
}
// takes a boolean value *see buttons
function toggleSlide(direction) {
    var elements = document.getElementsByClassName("hideable");
    // find position of current slide
    var visibleID = getVisible(elements);
    // pass that position to array and hide
    elements[visibleID].style.display = "none";
    // get values to pass to next and previous buttons
    if(!direction) {
        var makeVisible = prev(visibleID, elements.length);
    } else {
        var makeVisible = next(visibleID, elements.length);
    }
    elements[makeVisible].style.display = "block";
    // write slide number as value of current slides position
    var sn = document.getElementById("slideNumber");
    sn.innerHTML = (makeVisible + 1);
    // set total number of slides according to total length of all .hideable classes
    var st = document.getElementById("slideTotal");
    st.innerHTML = document.getElementsByClassName("hideable").length
}
// used to get position of current slider
function getVisible(elements) {
    var visibleID = -1;
    for(var i = 0; i < elements.length; i++) {
        if(elements[i].style.display == "block") {
            visibleID = i;
        }
    }
    return visibleID;
}
// go to previous slider
function prev(num, arrayLength) {
    if(num == 0) return arrayLength-1;
    else return num-1;
}
// go to next slider
function next(num, arrayLength) {
    if(num == arrayLength-1) return 0;
    else return num+1;
}
// takes boolean value go to previous or last slide
function goToEdge(where) {
    var elements = document.getElementsByClassName("hideable");
    var visibleID = getVisible(elements);
    var firstButton = document.getElementById("firstButton");
    var lastButton = document.getElementById("lastButton");
    var sn = document.getElementById("slideNumber");
    elements[visibleID].style.display = "none";
    if(!where) {
        // display the first element in array or the first slide and change the slide number
        elements[0].style.display = "block";
        sn.innerHTML = 1;
    } else {
        // go to last element in array and and change slide number
        elements[elements.length-1].style.display = "block";
        sn.innerHTML = elements.length;
    }
}

/* Falling Flowers
------------------------------------ */
/*   Free Script provided by HIOXINDIA            */
/*   visit us at http://www.hscripts.com     */
/*   This is a copyright product of hioxindia.com */

var image="https://dl.dropboxusercontent.com/s/sg0p591k4wln36q/Red_Rose_Transparent_PNG_Clipart.png?dl=0?raw=1";  //Image path should be given here
var no = 15; // No of images should fall
var time = 0; // Configure whether image should disappear after x seconds (0=never):
var speed = 70; // Fix how fast the image should fall
var i, dwidth = 1980, dheight =1080; 
var nht = dheight;
var toppos = 0;

if(document.all){
	var ie4up = 1;
}else{
	var ie4up = 0;
}

if(document.getElementById && !document.all){
	var ns6up = 1;
}else{
	var ns6up = 0;
}

function getScrollXY() {
  var scrOfX = 10, scrOfY = 10;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY =window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
   scrOfY = document.documentElement.scrollTop;
   scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

var timer;

function ranrot()
{

var a = getScrollXY()
if(timer)
{
	clearTimeout(timer);
}
toppos = a[1];
dheight = nht+a[1];
//alert(dheight);

timer = setTimeout('ranrot()',2000);
}
 	
ranrot();
 	
function iecompattest()
{
	if(document.compatMode && document.compatMode!="BackCompat")
	{
		return document.documentElement;
	}else{
		return document.body;
	}
	
}
if (ns6up) {
	dwidth = window.innerWidth;
	dheight = window.innerHeight;
} 
else if (ie4up) {
	dwidth = iecompattest().clientWidth;
	dheight = iecompattest().clientHeight;
}

nht = dheight;

var cv = new Array();
var px = new Array();       //position variables
var py = new Array();      //position variables
var am = new Array();     //amplitude variables
var sx = new Array();    //step variables
var sy = new Array();   //step variables

for (i = 0; i < no; ++ i) {  
	cv[i] = 0;
	px[i] = Math.random()*(dwidth-100);  // set position variables
	py[i] = Math.random()*dheight;     // set position variables
	am[i] = Math.random()*20;         // set amplitude variables
	sx[i] = 0.02 + Math.random()/10;  // set step variables
	sy[i] = 0.7 + Math.random();    // set step variables
	document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px;LEFT: 15px;\"><img src='"+image+"' border=\"0\"><\/div>");
}

function animation() {  // animation function
	for (i = 0; i < no; ++ i) {  // iterate for every dot
		py[i] += sy[i];
      		if (py[i] > dheight-50) {
        		px[i] = Math.random()*(dwidth-am[i]-100);
        		py[i] = toppos;
        		sx[i] = 0.02 + Math.random()/10;
        		sy[i] = 0.7 + Math.random();
      		}
      		cv[i] += sx[i];
      		document.getElementById("dot"+i).style.top=py[i]+"px";
      		document.getElementById("dot"+i).style.left=px[i] + am[i]*Math.sin(cv[i])+"px";  
    	}
    	atime=setTimeout("animation()", speed);

}

function hideimage(){
	if (window.atime) clearTimeout(atime)
		for (i=0; i<no; i++) 
			document.getElementById("dot"+i).style.visibility="hidden"
}
if (ie4up||ns6up){
animation();
if (time>0)
	setTimeout("hideimage()", time*1000)
}
animation();

/*   Free Script provided by HIOXINDIA            */
/*   visit us at http://www.hscripts.com     */
/*   This is a copyright product of hioxindia.com */

            
          
!
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.

Console