Thursday, 27 September 2018
Wednesday, 26 September 2018
Best css animation effects you must see | css spinner animation
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>18. circular trails</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<style>
body,
html {
margin: 0;
padding: 0;
}
canvas {
display: block;
}
</style>
</head>
<body>
<script src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.0/p5.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.2/dat.gui.min.js'></script>
<script>
var gui = new dat.GUI();
var opacity = false;
var angle = 0;
var speed = 0.01;
var relativeSpeed = 1.6;
var innerCircles = 7;
var outerCircles = 5;
var radi = 220;
gui.add(window, 'opacity');
var rsC = gui.add(window, 'relativeSpeed', 0, 2.4, 0.4);
rsC.onChange(function () {
background(0);
});
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
// strokeWeight(2)
background(0);
}
function draw() {
var l0 = radi;
var l1 = 60;
background(0, opacity ? 255 : 10);
translate(width / 2, height / 2);
rotate(angle);
for (var i = 0; i < innerCircles; i++) {
fill(color('hsb(' + round(angle * 30 * i) % 360 + ',100%,100%)'));
push();
rotate(i * TWO_PI / innerCircles);
translate(0, l0);
ellipse(0, 0, 7);
rotate(angle * relativeSpeed);
for (var j = 0; j < outerCircles; j++) {
push();
fill(color('hsb(' + round(angle * 30 * (j + i)) % 360 + ',100%,100%)'));
rotate(j * TWO_PI / outerCircles);
translate(0, l1);
ellipse(0, 0, 7);
pop();
}
pop();
}
angle += speed;
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(0);
}
function mousePressed() {
background(0);
innerCircles = random(6, 10);
outerCircles = random(5, 10);
radi = map(innerCircles, 6, 10, 200, 280);
}
</script>
</body>
</html>
Tuesday, 25 September 2018
Sunday, 23 September 2018
CSS isometric navigation menu | Responsive top navigation menu css | coo...
Source code
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>isometric menu</title>
<style>
@import url("https://fonts.googleapis.com/css?family=Open+Sans:700");
body {
margin: 0;
height: 100vh;
width: 100vw;
background: #000000;
overflow: hidden;
}
* {
box-sizing: border-box;
}
#page {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#center {
position: absolute;
z-index: 5;
background-color: #ffff64;
transition: 0.25s;
animation: float 1s infinite;
}
#center .icon {
padding: 40px 0px;
position: relative;
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
/* transform: skew(-50deg); */
}
.bar {
height: 15px;
width: 50%;
background: #000000;
}
.btn {
width: 200px;
height: 200px;
}
nav {
position: relative;
transform: rotateX(60deg) rotateY(0deg) rotateZ(-45deg);
width: 200px;
height: 200px;
}
.btn.item {
position: absolute;
top: 0;
z-index: 1;
transition: all 0.25s ease-out;
left: 0px;
top: 0px;
opacity: 1;
}
.btn.item:not(.opened) {
background: rgba(255, 255, 255, 0.5);
}
#center:hover {
cursor: pointer;
background: #ff1464 !important;
}
#center:hover .bar {
background: #ffffff;
}
.btn.item span:hover {
cursor: pointer;
background: #ff1464 !important;
color: #ffffff !important;
}
.btn.item span {
opacity: 0;
}
.btn.item.opened span {
opacity: 1;
background: #ffff64;
color: #000000;
padding: 0 15px;
}
.btn.item.opened {
font-family: "open sans";
font-size: 5rem;
display: flex;
justify-content: center;
align-items: center;
}
#up,
#bottom {
top: 20px;
left: -20px;
}
#right,
#left {
top: 40px;
left: -40px;
}
#up.opened {
top: -100%;
left: 0;
}
#right.opened {
left: 140%;
top: 0;
}
#bottom.opened {
top: 100%;
left: 0;
}
#left.opened {
left: -140%;
top: 0;
}
#center.close .bar.top {
position: absolute;
top: 40px;
left: 50px;
transform-origin: center left;
transform: rotateZ(45deg);
width: 70%;
}
#center.close .bar.bottom {
position: absolute;
bottom: 40px;
left: 50px;
transform-origin: center left;
transform: rotateZ(-45deg);
width: 70%;
}
#center.close .bar.middle {
width: 0;
}
@keyframes float {
0%,
100% {
top: 0px;
left: 0px;
}
50% {
top: -5px;
left: 5px;
}
}
</style>
</head>
<body>
<div id="page">
<nav>
<div id="center" class="btn">
<div class="icon">
<div class="bar top"></div>
<div class="bar middle"></div>
<div class="bar bottom"></div>
</div>
</div>
<div id="up" class="btn item">
<span>Contacts</span>
</div>
<div id="right" class="btn item">
<span>About</span>
</div>
<div id="bottom" class="btn item">
<span>Widgets</span>
</div>
<div id="left" class="btn item">
<span>Home</span>
</div>
</nav>
</div>
<script>
const navItems = document.querySelectorAll("nav .item");
document.querySelector("#center").addEventListener("click", function() {
for (let i = 0; i < navItems.length; i++) {
navItems[i].classList.toggle("opened");
}
document.querySelector("#center").classList.toggle("close");
});
</script>
</body>
</html>
Wednesday, 19 September 2018
Tuesday, 18 September 2018
Monday, 17 September 2018
Subscribe to:
Posts (Atom)