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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <body onload="bubbles('bubbles1',10,0);bubbles('bubbles2',7,-.5);bubbles('bubbles3',17,-1);">
<div id="background">
  <!--glass tumbler-->
<div id='glass-tumbler'>

<div id='rim' class='PA oval'></div>
<div id='glass-top-edge' class='PA edge'></div>
<div id='pims-surface' class='PA oval'></div>
<div id='glass-body' class='PA'></div>
<div id='bubbles1' class='bubbles PA'></div>
<div id='bubbles2' class='bubbles PA'></div>
<div id='bubbles3' class='bubbles PA'></div>
<div id='base1' class='base PA oval'></div>
<div id='baseEdge' class='edge PA'></div>
<div id='base2' class='base PA oval'></div>
</div>
  <!-- strawberry -->
<div id='strawberry-Box' >
	<div id='strawberry' class='PA'>
		<svg   viewbox='0 0 100 100'>
		<defs>
		    <filter id="f1" x="0" y="0" width="400%" height="400%">
		      <feOffset result="offOut" in="SourceAlpha" dx="1" dy="1" />
		      <feGaussianBlur result="blurOut" in="offOut" stdDeviation="1" />
		      <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
		    </filter>
		  </defs>
		<symbol id='seed'><text x='4' y='12' font-size='15' stroke='black' fill='green' transform='rotate(-45 10 10)'>0</text><text x='6' y='9' font-size='8' stroke='olive' fill='green' transform='rotate(-45 10 10)'>0</text></symbol>
		<g id='seeds'>
		   
		   <use xlink:href="#seed" x="32" y="6" />
		   <use xlink:href="#seed" x="52" y="6" />
		   <use xlink:href="#seed" x="72" y="6" />
		   <use xlink:href="#seed" x="12" y="28" />
		   <use xlink:href="#seed" x="32" y="28" />
		   <use xlink:href="#seed" x="52" y="28" />
		   <use xlink:href="#seed" x="72" y="28" />
		   <use xlink:href="#seed" x="12" y="48" />
		   <use xlink:href="#seed" x="32" y="48" />
		   <use xlink:href="#seed" x="52" y="48" />
		   <use xlink:href="#seed" x="72" y="48" />
		   <use xlink:href="#seed" x="32" y="48" />
		   <use xlink:href="#seed" x="12" y="68" />
		   <use xlink:href="#seed" x="32" y="68" />
		   <use xlink:href="#seed" x="52" y="68" />
		   <use xlink:href="#seed" x="72" y="68" />
		 </g> 
		  
		 <text x='-5' y='58' font-size='83' stroke='limegreen' fill='darkgreen' stroke-width='1.5' filter=' url(#f1)'>*</text>
		</svg>
	</div>
 <!-- cucumber -->
</div>
<div id="cucumber" class='PA'>
		<div id='cucumberSlice' >
			<div  class='section'></div>
			<div  class='section'></div>
			<div  class='section'></div>
			<div  class='section'></div>
			<div  class='section'></div>
			<div  class='section'></div>
		</div>
</div>
  <!-- ice cube-->
<div id='cube-box'>
  <div id='ice-cube' class='PA'>
	  <div class='face1 ice'></div>
	  <div class='face2 ice'></div>
	  <div class='face3 ice'></div>
	  <div class='face4 ice'></div>
	  <div class='face5 ice'></div>
	  <div class='face6 ice'></div>
  </div>
</div>
</div>
              
            
!

CSS

              
                body{margin:0;padding:0;}
#background{
	height:100vh;width:100vw;
	background-image:linear-gradient(black,grey);
	display:grid;
	grid-template-columns:1fr 1fr 1fr;
	grid-template-rows:15% 1fr 5%;
}
.PA{position:absolute;width:100%;}
/* cucumber*/
#cucumber{background:radial-gradient(white , rgb(200,255,100),green);width:15vmin;height:15vmin;top:-20%;left:45%;dispay:grid;border-radius:50%;border:dashed green .8vmin;grid-area:2 /2 /span 1/span 1;animation-name:cucumber-drop;
    animation-iteration-count:1;
    animation-timing-function:ease-in-out;
    animation-duration: 20s;
    animation-delay:3s;
    animation-fill-mode:forwards;
   
    }
#cucumberSlice{width:100%;height:100%;display:grid;grid-template-columns:repeat(4, 1fr);grid-template-rows:repeat(4, 1fr);}  
.section{border:solid white .5vmin;width:100%;height:60%;grid-row:3;grid-column:3;background:rgba(200,200,200,.3);}

/* strawberry */
#strawberry-Box{grid-area:2 /2 /span 1/span 1;}
#strawberry{transform:rotate(45deg) ;width:15vmin;height:15vmin;background:red;border-radius:30%;box-shadow:inset -1.5vmin -1.5vmin 5vmin black;top:60%;left:50%;animation-name:strawberry-rock;
    animation-direction: alternate;
    animation-iteration-count:infinite;
    animation-duration:6s;
 
  }

/*glass tumbler*/
#glass-tumbler{width:100%;height:100%;grid-area:2 /2 /span 1/span 1;position:relative;}
#bubble-maker{width:100%; height:90%;}

.oval{height:7%;border-radius:50%;}
#rim{border-style: double;top:0%;border-color:#ccc;border-width: .3px;}
#glass-top-edge{top:3%;height:10%;border-style:none solid none none;border-color:#ccc;border-width: .1px;}
#pims-surface{top:10%;border-color:orange;border-width: .9px;background-image:linear-gradient(transparent ,rgba(200,100,0,.3) );}
#glass-body{width:100%;height:65%;top:10%;border-style:none solid solid none;border-radius:0% 0% 10% 10%;background-image:linear-gradient(transparent , rgba(200,100,0,.15),rgba(200,100,0,.15),rgba(200,100,0,.15),rgba(200,100,0,.15), transparent );border-color:#ccc;border-width: .3px;}
 .bubbles{top:15%;left:0%;width:100%;height:70%;}
 
#base1{top:71%;border-color:#ccc;border-width: .3px;}
#baseEdge{width:85%;left:7.5%;top:75%;height:3.5%;border-style:none solid none solid;border-color:#ccc;border-width: 1.5px;}
#base2{top:75%;border-color:#ccc;border-width: .3px;}
.base{width:85%;left:7.5%;background-image:linear-gradient(transparent,rgba(240,240,240,.7));}

/* ice cube */
#cube-box{grid-area:2 /2 /span 1/span 1;width:100%;height:100%;}
.ice{border-radius:20%;}
#ice-cube{width:15vmin;height:15vmin;top:45%;left:38%;}
#ice-cube div{font-size:50px;
opacity:.2;
background:rgb(255,200,100);
  position:absolute;
  width:15vmin;
  height:15vmin;
  border:1px solid #ccc;
  
  box-shadow:inset 0 0 20px rgba(255,255,255); 
  }
#ice-cube .face1{transform:translateZ(7.5vmin);}
#ice-cube .face2{transform:rotateY(90deg)translateZ(7.5vmin);}
#ice-cube .face3{transform:rotateY(90deg)rotateX(90deg)translateZ(7.5vmin);}
#ice-cube .face4{transform:rotateY(180deg)rotateZ(90deg)translateZ(7.5vmin);}
#ice-cube .face5{-webkit-transform:rotateY(-90deg)rotateZ(90deg)translateZ(7.5vmin);}
#ice-cube .face6{transform:rotateX(-90deg)translateZ(7.5vmin);}

@keyframes cucumber-drop{
0%{top:-50%;}
  
  5%{top:34%;}
7.5%{top:30%;}
 10%{top:33%;}
15%{top:30%;}
20%{top:32%;}
25%{top:30%;}
30%{top:31%;}
35%{top:30%;}
40%{top:31%;}
45%{top:30%;}
50%{top:31%;}
55%{top:30%;}
60%{top:31%;} 
65%{top:30%;}
  80%{top:31%;}
  100%{top:30%;}
}


	@keyframes spincube{
0%{transform:rotateY(-60deg)rotateZ(30deg);}
33%{transform:rotateY(45deg)rotateZ(-15deg);}
66%{transform:rotateY(-20deg)rotateZ(20deg);}

100%{transform:rotateY(37deg)rotateZ(-53deg);} 
}
#ice-cube{transform:rotateY(-60deg)rotateZ(30deg);-webkit-animation-name:spincube;
  animation-timing-function:ease-in-out;
  animation-direction: alternate;
  animation-iteration-count:infinite;
  animation-duration:26s;
  transform-style:preserve-3d;
  transform-origin:10vw 10vw 0;
}

@keyframes strawberry-rock{
0%{transform:rotate(45deg);top:54%;}
30%{transform:rotate(55deg);top:56%;}
70%{transform:rotate(50deg);}
100%{transform:rotate(55deg);top:54%;}
}
              
            
!

JS

              
                function bubbles(svgL,radius,st){
var R;
var X; 
var Y;
var bubbles=document.getElementById(svgL);
var bubbleDraw="<svg  id='bubble-maker' viewbox='0 0 1000 2000'>";
for(var b=3;b<33;b++){X=0;Y=1000;  Rx=Math.floor(Math.random() * 100);
    Ry=-(Math.floor(Math.random() * 75));
bubbleDraw +="<circle cx='" + (X+(Rx*b)) + "' cy='" + (Y+(Ry*b)) + "' r='" + radius + "' stroke='white' fill='none'>";
  bubbleDraw +="<animateTransform attributeName='transform' type='translate' from='0 2300' to='0 -800' begin='" + st + "s' dur='3s' repeatCount='indefinite'></circle>";}
bubbleDraw +="</svg>";
bubbles.innerHTML=bubbleDraw;
	}
var arms=document.getElementsByClassName('section');
for (var i = 0; i < arms.length; i++) {
	arms[i].style.transformOrigin=i*0 +"%" + i*0 +"%";
	arms[i].style.transform="rotate(" + 60*i + "deg) skewX(" + 30 + "deg)";
	
	}
              
            
!
999px

Console