concoction

Объявление

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » concoction » ХТМЛ и журнал » штучки


штучки

Сообщений 91 страница 120 из 171

91

[html]
<style>

body, html, canvas{
  width: 100%; height: 500px; position: relative; margin: 0; padding: 0; background: #111;
}

</style>
<script>
  "use strict";

  // background animation
  (function() {

    var Base, Particle, canvas, colors, context, draw, drawables, i, mouseX, mouseY, mouseVX, mouseVY, rand, update, click, min, max, colors, particles;

    min = 1;
    max = 8;
    particles = 200;
    colors = ["64, 32, 0", "250, 64, 0", "64, 0, 0", "200, 200, 200"];

    rand = function(a, b) {
      return Math.random() * (b - a) + a;
    };

    Particle = (function() {
      function Particle() {
        this.reset();
      }

      Particle.prototype.reset = function() {
        this.color = colors[~~(Math.random()*colors.length)];
        this.radius = rand(min, max);
        this.x = rand(0, canvas.width);
        this.y = rand(-20, canvas.height*0.5);
        this.vx = -5 + Math.random()*10;
        this.vy = 0.7 * this.radius;
        this.valpha = rand(0.02, 0.09);
        this.opacity = 0;
        this.life = 0;
        this.onupdate = undefined;
        this.type = "dust";
      };

      Particle.prototype.update = function() {
        this.x = (this.x + this.vx/3);
        this.y = (this.y + this.vy/3);

        if(this.opacity >=1 && this.valpha > 0) this.valpha *=-1;
        this.opacity += this.valpha/3;
        this.life += this.valpha/3;

        if(this.type === "dust")
          this.opacity = Math.min(1, Math.max(0, this.opacity));
        else
          this.opacity = 1;

        if(this.onupdate) this.onupdate();
        if(this.life < 0 || this.radius <= 0 || this.y > canvas.height){
          this.onupdate = undefined;
          this.reset();
        }
      };

      Particle.prototype.draw = function(c) {
        c.strokeStyle = "rgba(" + this.color + ", " + Math.min(this.opacity, 0.85) + ")";
        c.fillStyle = "rgba(" + this.color + ", " + Math.min(this.opacity, 0.65) + ")";
        c.beginPath();
        c.arc(this.x, this.y, this.radius, 2 * Math.PI, false);
        c.fill();
        c.stroke();
      };

      return Particle;

    })();

    mouseVX = mouseVY = mouseX = mouseY = 0;

    canvas = document.getElementById("bg");
    context = canvas.getContext("2d");
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;

    drawables = (function() {
      var _i, _results;
      _results = [];
      for (i = _i = 1; _i <= particles; i = ++_i) {
        _results.push(new Particle);
      }
      return _results;
    })();

    draw = function() {
      var d, _i, _len;
      canvas.width = window.innerWidth;
      canvas.height = window.innerHeight;
      context.clearRect(0, 0, canvas.width, canvas.height)

      for (_i = 0, _len = drawables.length; _i < _len; _i++) {
        d = drawables[_i];
        d.draw(context);
      }
    };

    update = function() {
      var d, _i, _len, _results;
      _results = [];
      for (_i = 0, _len = drawables.length; _i < _len; _i++) {
        d = drawables[_i];
        _results.push(d.update());
      }
      return _results;
    };

    document.onmousemove = function(e) {
      mouseVX = mouseX;
      mouseVY = mouseY;
      mouseX = ~~e.pageX;
      mouseY = ~~e.pageY;
      mouseVX = ~~((mouseVX - mouseX)/2);
      mouseVY = ~~((mouseVY - mouseY)/2);

    };

    window.addEventListener('resize', draw, false);
    setInterval(draw, 1000 / 30);
    setInterval(update, 1000 / 60);
  }).call(this);
</script>

<canvas id="bg"></canvas>

[/html]

0

92

[html]
<style>
canvas { background: black; height:200px}
</style>
<script>
var PARTICLES_FROM_POINT = 32,
    GRAVITY = .01,
    δ = Math.PI/90,
    c = document.querySelector('canvas'),
    ct = c.getContext('2d'), w, h, cr,
    particles = [];

var rand = function(max, min, is_int) {
var max = ((max - 1) || 0) + 1,
    min = min || 0,
    gen = min + (max - min)*Math.random();

return is_int?Math.round(gen):gen;
};

var rsgn = function(k) {
return (Math.random() < (k || .5))?-1:1;
};

var Particle = function(x, y, c, r) {
this.x = x || 0;
this.y = y || 0;
this.vx = rsgn()*rand(.5,.125);
this.vy = rsgn()*rand(.5,.125);
this.ax = 0;
this.ay = GRAVITY;
this.c = c || 'white';
this.alpha = 1;
this.r = r || rand(3,.5);

this.evolve = function() {
    this.alpha -= .008;
   
    this.vx += this.ax;
    this.vy += this.ay;
   
    this.x += this.vx;
    this.y += this.vy;
   
    if(this.y > .5*w - this.r) {
    this.y = .5*w - this.r;
    this.vx *= .95;
    this.vy *= -.9;
    }
   
    if((Math.abs(this.x) > .5*w + 2*this.r) ||
    (this.y < -.5*h - 2*this.r) ||
    this.alpha <= 0) {
    this.destroy();
    return;
    }
    else { this.draw(); }
};

this.draw = function() {
    ct.fillStyle = this.c;
    ct.globalAlpha = this.alpha;
    ct.beginPath();
    ct.arc(this.x, this.y, this.r, 0, 2*Math.PI);
    ct.closePath();
    ct.fill();
};

this.destroy = function() {
    var idx = particles.indexOf(this);
    particles.splice(idx, 1);
};
};

var size = function() {
w = c.width = window.innerWidth;
h = c.height = window.innerHeight;
cr = .25*Math.min(h, w);
ct.restore();
ct.save();
ct.translate(.5*w, .5*h);
};

var ani = function(φ) {
var _r = cr*(2 + Math.sin(.73*φ))/2,
    x = _r*Math.cos(φ), y = _r*Math.sin(φ),
    hue = ~~(.183*φ/Math.PI*360)%360, light, p,
    n = particles.length;

ct.fillStyle = 'rgba(0,0,0,.08)';
ct.beginPath();
ct.fillRect(-.5*w, -.5*h, w, h)

for(var i = 0; i < n; i++) {
    particles[i].evolve();
   
    if(particles.length != n) {
    n--;
    i--;
    }
}

for(var i = 0; i < PARTICLES_FROM_POINT; i++) {
    light = 40*(1  + Math.random());
    p = new Particle(x + rsgn()*rand(8), y + rsgn()*rand(8), 'hsl(' + hue + ',100%,' + light + '%)');
    p.draw();
    particles.push(p);
}

requestAnimationFrame(ani.bind(this, φ + δ))
};

size();
ani(0);

addEventListener('resize', size, false);
</script>

<canvas height="100"></canvas>
[/html]

0

93

[html]
<style>
@import url(https://fonts.googleapis.com/css?family … Kaffeesatz);
.russian-river {
  position: relative;
  display: inline-block;
}

h17 {
  margin: 0;
  font-size: 128px;
  font-family: 'Yanone Kaffeesatz', sans-serif;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #fcf5ed;
  text-shadow:
    /* grey part - static */
    -1px -1px #34342f,
    1px 1px #34342f,
    2px 2px #34342f,
    3px 3px #34342f,
    4px 4px #34342f,
    5px 5px #34342f,
    6px 6px #34342f,
    7px 7px #34342f,
    /* red part - dynamic */
    0 8px #da5845,
    0 9px #da5845,
    0 10px #da5845,
    0 11px #da5845,
    0 12px #da5845,
    0 13px #da5845,
    0 14px #da5845,
    0 15px #da5845,
    0 16px #da5845,
    0 17px #da5845,
    0 18px #da5845,
    1px 8px #da5845,
    1px 9px #da5845,
    1px 10px #da5845,
    1px 11px #da5845,
    1px 12px #da5845,
    1px 13px #da5845,
    1px 14px #da5845,
    1px 15px #da5845,
    1px 16px #da5845,
    1px 17px #da5845,
    1px 18px #da5845,
    2px 8px #da5845,
    2px 9px #da5845,
    2px 10px #da5845,
    2px 11px #da5845,
    2px 12px #da5845,
    2px 13px #da5845,
    2px 14px #da5845,
    2px 15px #da5845,
    2px 16px #da5845,
    2px 17px #da5845,
    2px 18px #da5845,
    3px 8px #da5845,
    3px 9px #da5845,
    3px 10px #da5845,
    3px 11px #da5845,
    3px 12px #da5845,
    3px 13px #da5845,
    3px 14px #da5845,
    3px 15px #da5845,
    3px 16px #da5845,
    3px 17px #da5845,
    3px 18px #da5845,
    4px 8px #da5845,
    4px 9px #da5845,
    4px 10px #da5845,
    4px 11px #da5845,
    4px 12px #da5845,
    4px 13px #da5845,
    4px 14px #da5845,
    4px 15px #da5845,
    4px 16px #da5845,
    4px 17px #da5845,
    4px 18px #da5845,
    5px 8px #da5845,
    5px 9px #da5845,
    5px 10px #da5845,
    5px 11px #da5845,
    5px 12px #da5845,
    5px 13px #da5845,
    5px 14px #da5845,
    5px 15px #da5845,
    5px 16px #da5845,
    5px 17px #da5845,
    5px 18px #da5845,
    6px 8px #da5845,
    6px 9px #da5845,
    6px 10px #da5845,
    6px 11px #da5845,
    6px 12px #da5845,
    6px 13px #da5845,
    6px 14px #da5845,
    6px 15px #da5845,
    6px 16px #da5845,
    6px 17px #da5845,
    6px 18px #da5845,
    7px 8px #da5845,
    7px 9px #da5845,
    7px 10px #da5845,
    7px 11px #da5845,
    7px 12px #da5845,
    7px 13px #da5845,
    7px 14px #da5845,
    7px 15px #da5845,
    7px 16px #da5845,
    7px 17px #da5845,
    7px 18px #da5845;
}

.first-letter, .last-letter {
  font-size: 160px;
  position: relative;
  top: 23px;
}

[class^="trigger"] {
  position: absolute;
  width: 20%;
  height: 100%;
  z-index:2;
}

.trigger2 {left: 20%;}
.trigger3 {left: 40%;}
.trigger4 {left: 60%;}
.trigger5 {left: 80%;}

.trigger1:hover ~ h17 {
  text-shadow:
    /* grey part - static */
    -1px -1px #34342f,
    1px 1px #34342f,
    2px 2px #34342f,
    3px 3px #34342f,
    4px 4px #34342f,
    5px 5px #34342f,
    6px 6px #34342f,
    7px 7px #34342f,
    /* red part - dynamic */
    8px 8px #da5845,
    8px 9px #da5845,
    9px 10px #da5845,
    9px 11px #da5845,
    10px 12px #da5845,
    10px 13px #da5845,
    11px 14px #da5845,
    11px 15px #da5845,
    12px 16px #da5845,
    12px 17px #da5845,
    13px 18px #da5845;
}

.trigger2:hover ~ h17 {
  text-shadow:
    /* grey part - static */
    -1px -1px #34342f,
    1px 1px #34342f,
    2px 2px #34342f,
    3px 3px #34342f,
    4px 4px #34342f,
    5px 5px #34342f,
    6px 6px #34342f,
    7px 7px #34342f,
    /* red part - dynamic */
    8px 8px #da5845,
    8px 9px #da5845,
    8px 10px #da5845,
    9px 11px #da5845,
    9px 12px #da5845,
    9px 13px #da5845,
    10px 14px #da5845,
    10px 15px #da5845,
    10px 16px #da5845,
    11px 17px #da5845,
    11px 18px #da5845;
}

.trigger4:hover ~ h17 {
  text-shadow:
    /* grey part - static */
    -1px -1px #34342f,
    1px 1px #34342f,
    2px 2px #34342f,
    3px 3px #34342f,
    4px 4px #34342f,
    5px 5px #34342f,
    6px 6px #34342f,
    7px 7px #34342f,
    /* red part - dynamic */
    -1px 1px #da5845,
    -1px 2px #da5845,
    -1px 3px #da5845,
    -2px 4px #da5845,
    -2px 5px #da5845,
    -2px 6px #da5845,
    -3px 7px #da5845,
    -3px 8px #da5845,
    -3px 9px #da5845,
    -4px 10px #da5845,
    -4px 11px #da5845,
    -4px 12px #da5845,
    -5px 13px #da5845,
    -5px 14px #da5845,
    -5px 15px #da5845,
    -6px 16px #da5845,
    -6px 17px #da5845,
    -6px 18px #da5845,
   
    6px 8px #da5845,
    6px 9px #da5845,
    6px 10px #da5845,
    5px 11px #da5845,
    5px 12px #da5845,
    5px 13px #da5845,
    4px 14px #da5845,
    4px 15px #da5845,
    4px 16px #da5845,
    3px 17px #da5845,
    3px 18px #da5845;;
}

.trigger5:hover ~ h17 {
  text-shadow:
    /* grey part - static */
    -1px -1px #34342f,
    1px 1px #34342f,
    2px 2px #34342f,
    3px 3px #34342f,
    4px 4px #34342f,
    5px 5px #34342f,
    6px 6px #34342f,
    7px 7px #34342f,
    /* red part - dynamic */
    -1px 1px #da5845,
    -1px 2px #da5845,
    -2px 3px #da5845,
    -2px 4px #da5845,
    -3px 5px #da5845,
    -3px 6px #da5845,
    -4px 7px #da5845,
    -4px 8px #da5845,
    -5px 9px #da5845,
    -5px 10px #da5845,
    -6px 11px #da5845,
    -6px 12px #da5845,
    -7px 13px #da5845,
    -7px 14px #da5845,
    -8px 15px #da5845,
    -8px 16px #da5845,
    -9px 17px #da5845,
    -9px 18px #da5845,
   
    6px 8px #da5845,
    6px 9px #da5845,
    5px 10px #da5845,
    5px 11px #da5845,
    4px 12px #da5845,
    4px 13px #da5845,
    3px 14px #da5845,
    3px 15px #da5845,
    2px 16px #da5845,
    2px 17px #da5845,
    1px 18px #da5845;
}

</style>
<div class="russian-river">
  <div class="trigger1"></div>
  <div class="trigger2"></div>
  <div class="trigger3"></div>
  <div class="trigger4"></div>
  <div class="trigger5"></div>
  <h17><span class="first-letter">R</span>ussian Rive<span class="last-letter">r</span></h17>
</div>
[/html]

0

94

[html]
<style>

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@800&display=swap');

html {

    box-sizing: border-box ;
    --duration: .45s ;
    --cubic: cubic-bezier(0.4, 0, 0.2, 1) ;
    --color-1: #d5dadd ;
    --color-2: #51d5c2 ;

}

.menu {

    margin: 0 ;
    width: 42em ;
    display: flex ;
    height: 10.4em ;
    user-select: none ;
    position: relative ;
    align-items: center ;
    padding: 0 1.9em 2.5em ;
    justify-content: center ;
    background-color: #fefefe ;
    border-radius: 1em 1em 4.5em 4.5em ;
    -webkit-tap-highlight-color: transparent ;

}

@media (max-width: 42.625em) {
 
  .menu {
   
    font-size: .55em ;
   
  }
 
}

.menu::after {

    height: 5% ;
    width: 35% ;
    bottom: 10% ;
    content: " " ;
    position: absolute ;
    border-radius: 1em ;
    background-color: #f2f3f4 ;

}

.menu__item {

    all: unset ;
    flex-grow: 1 ;
    display: flex ;
    cursor: pointer ;
    overflow: hidden ;
    padding-top: 0.5em ;
    position: relative ;
    align-items: center ;
    color: var(--color-1) ;
    justify-content: center ;
    transition: flex-grow var(--duration) var(--cubic) ;
   
}

.menu__icon {
   
    font-size: 1.05em ;
    stroke: currentColor ;
    transition: transform var(--duration) var(--cubic) ;
   
}

.menu__item::before {

    top: 9% ;
    left: 18.4% ;
    width: 1.5em ;
    height: 1.5em ;
    content: " ";
    position: absolute ;
    border-radius: 50% ;
    transform: scale(0) ;
    transform-origin: center ;
    background-color: #fdecef ;
    transition: transform var(--duration) var(--cubic) ;

}

.menu__item::after {

    left: 0;
    bottom: 0 ;
    content: " " ;
    height: 0.25em ;
    position: absolute ;
    border-radius: 2em ;
    transform-origin: left center ;
    background-color: currentColor ;
    width: calc( var(--lineWidth) + 5px ) ;
    transform: translate3d(3em , 0, 0) scaleX(0) ;
    transition: transform calc( var(--duration) + .2s) var(--cubic) ;

}

.menu__text {

    left: 4.15em ;
    font-size: 1.5em ;
    position: absolute ;
    text-transform: capitalize ;
    letter-spacing: .01em ;
    transform: translate3d(0, 109%, 0) ;
    transition: transform calc( var(--duration) / 3.7 ) ;

}

.menu__item.active {
   
    flex-grow: 2.7 ;
    color: var(--color-2) ;
   
}

.menu__item.active .menu__icon {
   
    transform: translate3d(-95% , 0, 0) ;

   
}

.menu__item.active::before {

    transform: scale(1) ;

}

.menu__item.active::after {

    transform: translate3d(6.3em , 0, 0) scaleX(1) ;
    transition: transform var(--duration) var(--cubic) ;

}

.menu__text.active {

    transform: translate3d(0 , 0, 0) ;
    transition: transform calc(var(--duration) / 1.5) ;
}

.icon {

    --duration-icon: 1s ;
   
    fill: none ;
    width: 2.5em ;
    height: 2.5em ;
    display: block ;
    stroke-width: 15 ;
    stroke-miterlimit: 10 ;
   
}

.active #home-anm {

    animation: home var(--duration-icon) ;
}

@keyframes home {

    25% {

        transform: translate3d(0, -.8em , 0) ;

    }

    50% {

        transform: translate3d(0, .5em , 0) ;

    }

}

#strategy-anm {
   
    transform: scaleX(.85) ;
    transform-origin: center ;

}

.active #strategy-anm {
   
    animation: strategy var(--duration-icon) ;

}

@keyframes strategy {
   
    50% {

        transform: scaleX(1) ;
       
    }
   
    100%{
       
        transform: scaleX(.85) ;

    }

}

.active #strategy-cir1 {

    animation: strategy-cir1 var(--duration-icon);
}

.active #strategy-cir2 {

    animation: strategy-cir2 var(--duration-icon) .1s;
}

.active #strategy-cir3 {

    animation: strategy-cir3 var(--duration-icon) .2s;
}

@keyframes strategy-cir1 {
   
    50% {

        transform: translate3d(-.7em,-0.7em,0);
       
    }
   
    100%{
       
        transform: translate3d(0,0,0);

    }

}

@keyframes strategy-cir2 {
   
    35% {

        transform: translate3d(0,-0.7em,0);
       
    }
   
    100%{
       
        transform: translate3d(0,0,0);

    }

}

@keyframes strategy-cir3 {
   
    35% {

        transform: translate3d(.7em,-0.7em,0);
       
    }
   
    100%{
       
        transform: translate3d(0,0,0);

    }

}

.active #period-anm {

    transform-origin: center 100% ;
    animation: period var(--duration-icon) ;

}

.active #period-cir {

    transform-origin: center ;
    animation: period-cir var(--duration-icon) ;

}

.active #period-line {

    stroke-dasharray: 66 ;
    animation: period-line calc( var(--duration-icon) / 2.5 ) reverse ;

}

@keyframes period {

    35% {

        transform: scaleY(.85) ;

    }

    60% , 70% {

        transform: scaleY(1.2) ;

    }

    100% {
       
        transform: scaleY(1) ;

    }

}

@keyframes period-cir {

    0%{

       opacity: 0 ;

    }

    35% {

        opacity: 1 ;
        transform: translate3d(15%, -55%, 0) ;

    }

    60%{

        opacity: 0 ;
        transform: translate3d(-8%, -50%, 0) ;

    }

}

@keyframes period-line {

    100% {

        stroke-dashoffset: 66 ;

    }

}

.active #security-cir {

    transform-box: fill-box ;
    transform-origin: center ;
    animation: security-cir calc( var(--duration-icon) / 1.5 ) ;

}

@keyframes security-cir {

    0% {

        transform: scale(0) ;
       
    }
   
    100% {
       
        transform: scale(1) ;
       
    }

}

.active #security-strok {

    stroke-dasharray: 96;
    animation: security-strok calc( var(--duration-icon) / 1.2 ) ;

}

@keyframes security-strok {

    0% {

        stroke-dashoffset: 60 ;
       
    }
   
    100% {
       
        stroke-dashoffset: 230 ;
       
    }

}

.active #settings-anm {

    transform-box: fill-box ;
    transform-origin: center ;
    animation: settings-anm calc( var(--duration-icon) / 1.5 ) ;

}

@keyframes settings-anm {

    0% {

        transform: rotate(-60deg);
       
    }
   
    50% {
       
        transform: rotate(60deg);
       
    }

}

</style>
<script>
// Designed by: Hoang Nguyen
// Original image: https://dribbble.com/shots/5919154-Tab- … nteraction

const buttons = document.querySelectorAll(".menu__item");
let activeButton = document.querySelector(".menu__item.active");

buttons.forEach(item => {

    const text = item.querySelector(".menu__text");
    setLineWidth(text, item);

    window.addEventListener("resize", () => {
        setLineWidth(text, item);
    })

    item.addEventListener("click", function() {
        if (this.classList.contains("active")) return;

        this.classList.add("active");
       
        if (activeButton) {
            activeButton.classList.remove("active");
            activeButton.querySelector(".menu__text").classList.remove("active");
        }
       
        handleTransition(this, text);
        activeButton = this;

    });

   
});

function setLineWidth(text, item) {
    const lineWidth = text.offsetWidth + "px";
    item.style.setProperty("--lineWidth", lineWidth);
}

function handleTransition(item, text) {

    item.addEventListener("transitionend", (e) => {

        if (e.propertyName != "flex-grow" ||
        !item.classList.contains("active")) return;

        text.classList.add("active");
       
    });

}
</script>

<menu class="menu">
       
        <button class="menu__item active">
            <div class="menu__icon" >

                <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 179.1 145" >
   
                    <g id="home-anm">
                        <path stroke-linejoin="round"  stroke-linecap="round" d="M70.5,80.1h40.7"/>
                        <path d="M35,64v80"/>
                        <path d="M145.1,143V63"/>
                        <path stroke-linecap="round" stroke-linejoin="round" d="M24.9,70l65.7-50.7L156.3,70"/>
                    </g>
       
                    <path stroke-linejoin="round" d="M145.1,117.6v33.1c0,1.5-1.2,2.8-2.8,2.8h-28.4c-1.5,0-2.8-1.2-2.8-2.8V126c0-11.3-9.2-20.5-20.5-20.5l0,0
                    c-11.3,0-20.5,9.2-20.5,20.5v27.5h16H37.8c-1.5,0-2.8-1.2-2.8-2.8v-34.2"/>
       
                </svg>

            </div>
            <strong class="menu__text active">home</strong>
        </button>

        <button class="menu__item">
            <div class="menu__icon" >

                <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 179.1 145">

                    <g id="strategy-anm" >
                        <path d="M84.1,50.4L72,64.7c-2,2.4-5.2,3.5-8.3,3l-40.1-6.8c-3.2-0.6-5.8,2.4-4.8,5.5L42,127.9c1.2,3.6,4.6,6.1,8.4,6.1
                        h81.6c3.9,0,7.3-2.6,8.5-6.3l21.5-61.4c0.9-3-1.7-6-4.9-5.4l-38.3,6.7c-3,0.6-6.2-0.5-8.2-2.8L97.4,50.2
                        C93.8,46.3,87.6,46.3,84.1,50.4z"/>
                    </g>
                    <path stroke-linecap="round" d="M38.8,153.5h105.5"/>
                    <path stroke-linecap="round" d="M66.8,112.5h49.5"/>
                    <path id="strategy-cir1" stroke-width="0" fill="currentColor" d="M32.4,37.5c0,5.8-4.7,10.5-10.5,10.5s-10.5-4.7-10.5-10.5S16.1,27,21.9,27S32.4,31.7,32.4,37.5z"/>
                    <path id="strategy-cir2" stroke-width="0" fill="currentColor" d="M102.3,23.5c0,5.8-4.7,10.5-10.5,10.5s-10.5-4.7-10.5-10.5S86,13,91.8,13S102.3,17.7,102.3,23.5z"/>
                    <path id="strategy-cir3" stroke-width="0" fill="currentColor" d="M169.6,37.5c0,5.8-4.7,10.5-10.5,10.5s-10.5-4.7-10.5-10.5S153.3,27,159.1,27S169.6,31.7,169.6,37.5z"/>
               
                </svg>

            </div>
            <strong class="menu__text">strategy</strong>
        </button>

        <button class="menu__item">
            <div class="menu__icon" >

                <svg class="icon"  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 179.1 145" >

                    <g id="period-cir">
                        <path fill="currentColor" stroke-width="0" d="M96.5,141.7c0,3.9-3.1,7-7,7s-7-3.1-7-7s3.1-7,7-7C93.4,134.6,96.5,137.8,96.5,141.7z"/>
                        <path fill="currentColor" stroke-width="0" d="M78.2,126.7c0,3.9-3.1,7-7,7s-7-3.1-7-7c0-3.9,3.1-7,7-7S78.2,122.8,78.2,126.7z"/>
                        <path fill="currentColor" stroke-width="0" d="M110.6,120.5c0,3.9-3.1,7-7,7s-7-3.1-7-7s3.1-7,7-7S110.6,116.6,110.6,120.5z"/>
                   
                    </g>
                    <g id="period-anm">
                        <path stroke-linecap="round" d="M30.8,24.7h118.3 M117.3,71.2l9.7-6.7c0.7-0.4,1.1-1.1,1.1-1.9V24.7H50v37.8"/>
                        <path stroke-linecap="round" d="M149.4,153.3H30.6 M75.5,90.7l-23.1,21.2c-1.6,1.4-2.4,3.4-2.4,5.6v35.9h78.1V113"/>
                        <g id="period-line">
                            <path stroke-linecap="round" d="M50,62.5l40,44.2"/>
                            <path stroke-linecap="round" d="M128.1,111.7L95.2,73.4"/>
                        </g>
                    </g>
       
                </svg>

            </div>
            <strong class="menu__text">period</strong>
        </button>

        <button class="menu__item">
            <div class="menu__icon" >

                <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 179.1 145" >

                    <path stroke-linecap="round" d="M94,139c-4.8,1.3-8.8,1.7-11.4,1.8c0,0-18.3,1.1-36.9-11.6c-1.9-1.3-4.7-3.2-7.8-6.2c-1.7-1.6-2.9-2.9-3.4-3.6
                    c0,0-3.6-4.2-6.1-8.6c-4.6-8.4-5.4-18.9-5.5-21l0,0V75.5v-39c0-0.7,0.5-1.3,1.2-1.5l58-14.2c0.2-0.1,0.5-0.1,0.7,0l57.9,14.7
                    c0.7,0.2,1.1,0.8,1.1,1.5v29.7"/>
                    <path id="security-cir" stroke-linecap="round" d="M158.3,120.7c0,18.3-14.8,33.1-33.1,33.1s-33-14.8-33-33.1s14.8-33.1,33.1-33.1S158.3,102.4,158.3,120.7z"/>
                    <g id="security-strok">
                        <path stroke-linecap="round" d="M151.1,104.5l-25,25c-1.3,1.3-3.5,1.3-4.9,0l-9.1-9.1"/>
                        <path stroke-linecap="round" d="M82.6,43L23.1,62.3"/>
                        <path stroke-linecap="round" d="M82.6,68.4L23.1,87.6"/>
                    </g>
       
                </svg>

            </div>
            <strong class="menu__text">security</strong>
        </button>

        <button class="menu__item">
            <div class="menu__icon" >

                <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 179.1 145" >

                    <circle cx="90.5" cy="90.2" r="19.7"/>
                    <g id="settings-anm" >
                        <path stroke-linejoin="round" d="M144.7,73.8l-6.2-1c-0.6-1.5-1.2-3-1.9-4.5l3.6-5.1c3.2-4.4,2.7-10.5-1.2-14.3l-7.4-7.4
                        c-2.1-2.1-4.9-3.3-7.8-3.3c-2.3,0-4.5,0.7-6.4,2.1l-5.1,3.6c-1.6-0.7-3.2-1.4-4.8-2l-1-6.1c-0.9-5.4-5.5-9.3-10.9-9.3H85.1
                        c-5.4,0-10,3.9-10.9,9.2L73.1,42c-1.5,0.6-3,1.2-4.5,1.9l-5-3.6c-1.9-1.4-4.1-2.1-6.5-2.1c-3,0-5.8,1.2-7.8,3.3l-7.4,7.4
                        c-3.8,3.8-4.3,9.8-1.2,14.3l3.7,5.2c-0.7,1.5-1.3,3-1.8,4.5l-6.1,1c-5.4,0.9-9.3,5.5-9.3,10.9v10.5c0,5.4,3.9,10,9.2,10.9l6.3,1.1
                        c0.6,1.5,1.2,3,1.9,4.5l-3.6,5c-3.2,4.4-2.7,10.5,1.2,14.3l7.4,7.4c2.1,2.1,4.9,3.3,7.8,3.3c2.3,0,4.5-0.7,6.4-2.1L69,136
                        c1.4,0.6,2.8,1.2,4.2,1.7l1,6.2c0.9,5.4,5.5,9.3,10.9,9.3h10.5c5.4,0,10-3.9,10.9-9.2l1-6.2c1.5-0.6,3-1.2,4.5-1.9l5.1,3.6
                        c1.9,1.4,4.1,2.1,6.5,2.1c3,0,5.7-1.2,7.8-3.3l7.4-7.4c3.8-3.8,4.3-9.8,1.2-14.3l-3.6-5.1c0.7-1.5,1.3-3,1.9-4.5l6.2-1
                        c5.4-0.9,9.3-5.5,9.3-10.9V84.8C153.9,79.3,150.1,74.7,144.7,73.8z"/>
                    </g>
       
                </svg>

            </div>
            <strong class="menu__text">settings</strong>
        </button>

    </menu>

[/html]

0

95

[html]
<style>
.loader {
  font-size: 5rem;
  font-family: sans-serif;
  font-variant: small-caps;
  font-weight: 900;
  background: conic-gradient(
    #dff2ae 0 25%,
    #ff904f 25% 50%,
    #feefe7 50% 75%,
    #ffde2b 75%
  );
  background-size: 200% 200%;
  animation: animateBackground 4.5s ease-in-out infinite;
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

@keyframes animateBackground {
  25% {
    background-position: 0 100%;
  }

  50% {
    background-position: 100% 100%;
  }

  75% {
    background-position: 100% 0%;
  }

  100% {
    background-position: 0 0;
  }
}

</style>
<script>

</script>
<div class="loader">
  Loading
</div>
[/html]

0

96

[html]
<style>
/* header */
header {
  display: grid;
  align-items: center;
  width: min(60rem, 100%);
  margin-inline: auto;
}
header :is(.orbits, .content){ grid-area: 1/1 }

/* content */
.content { place-self: center; text-align:center; max-width: 40ch }
.content > p:nth-of-type(1) { text-transform: uppercase; font-size: .8rem }
.content > h1 { font-size: 2.5rem; font-weight: 800 }
.content > h1 > span { color: hsl(350 100% 50%) }
.content > p:nth-of-type(2){ font-size: 1.2rem }

/* orbits */
.orbits { 
  --orbit-outer-size: 100%;
  --orbit-inner-size: 75%;
  --orbit-image-size: min(4vw, 3rem);
  --orbit-ring-color: hsl(0 0% 50% / .75);
  --orbit-ring-thickness: 1px;
  --orbit-animation-duration: 10s;

  display: grid;
  grid-template-columns: 1fr 1fr;
  --mask-image: radial-gradient(circle at center, transparent 40%, black 50%);
  -webkit-mask-image: var(--mask-image);
  mask-image: var(--mask-image);
  overflow: hidden;
  z-index: -1;
}
.orbits :is(.left, .right, .outer, .inner) { display: grid; aspect-ratio: 1/1 }
.orbits .left { place-items: center end }
.orbits .right { place-items: center start }

.orbits :is(.outer, .inner){
  grid-area: 1/1;
  width: calc(var(--width) - var(--orbit-image-size));
  border: var(--orbit-ring-thickness) solid var(--orbit-ring-color);
  border-radius: 50%;
  animation: orbit-rotate var(--orbit-animation-duration) linear infinite;
}
.orbits .outer { --width: var(--orbit-outer-size) }
.orbits .inner { --width: var(--orbit-inner-size) }

.orbits [data-orbit-rotate="left"] { --orbit-rotate-to: -360deg }
.orbits [data-orbit-rotate="right"]{ --orbit-rotate-to:  360deg }

.orbits img {
  grid-area: 1/1;
  width: var(--orbit-image-size);
  aspect-ratio: 1/1;
  border-radius: 50%;
  object-fit: cover;
  --translate: translateX(var(--tx, 0)) translateY(var(--ty, 0));
  transform: var(--translate);
  animation: orbit-image-rotate var(--orbit-animation-duration) linear infinite;
  place-self: var(--ps)
}
.orbits img:nth-child(1) { --ps: start center; --ty: -50% }
.orbits img:nth-child(2) { --ps: center end  ; --tx:  50% }
.orbits img:nth-child(3) { --ps: end center  ; --ty:  50% }
.orbits img:nth-child(4) { --ps: center start; --tx: -50% }

/* .orbits :is(.outer, .inner):hover,
.orbits :is(.outer, .inner):hover img{
  animation-play-state: paused;
} */

@keyframes orbit-rotate { to { transform: rotate(var(--orbit-rotate-to)) } }
@keyframes orbit-image-rotate { to { transform: var(--translate) rotate(calc(var(--orbit-rotate-to) * -1)) } }

</style>
<header>
  <div class="orbits">
    <div class="left">
      <div class="outer" data-orbit-rotate="right">
        <img src="https://picsum.photos/32/32?random=1" alt="">
        <img src="https://picsum.photos/32/32?random=2" alt="">
        <img src="https://picsum.photos/32/32?random=3" alt="">
        <img src="https://picsum.photos/32/32?random=4" alt="">
      </div>
      <div class="inner" data-orbit-rotate="left">
        <img src="https://picsum.photos/32/32?random=5" alt="">
        <img src="https://picsum.photos/32/32?random=6" alt="">
        <img src="https://picsum.photos/32/32?random=7" alt="">
        <img src="https://picsum.photos/32/32?random=8" alt="">
      </div>
    </div>
    <div class="right">
      <div class="outer" data-orbit-rotate="left">
        <img src="https://picsum.photos/32/32?random=9" alt="">
        <img src="https://picsum.photos/32/32?random=10" alt="">
        <img src="https://picsum.photos/32/32?random=11" alt="">
        <img src="https://picsum.photos/32/32?random=12" alt="">
      </div>
      <div class="inner" data-orbit-rotate="right">
        <img src="https://picsum.photos/32/32?random=13" alt="">
        <img src="https://picsum.photos/32/32?random=14" alt="">
        <img src="https://picsum.photos/32/32?random=15" alt="">
        <img src="https://picsum.photos/32/32?random=16" alt="">
      </div>
    </div>
  </div>
  <div class="content">
    <p>Lorem Impsum</p>
    <h1 class="logo">CPC<wbr><span>Round</span></h1>
    <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Officia, earum?</p>
  </div>
</header>
[/html]

0

97

[html]
<style>
@import url('https://fonts.googleapis.com/css2?family=Alumni+Sans:wght@400;600&display=swap');

:root {
  --border: 2px solid dimgray;
}

.results {
  font-size: 2rem;
  border: var(--border);
  padding: 0 2rem;
  font-weight: 400;
  letter-spacing: 1px;
  align-self: end;
  background: white;
  box-shadow: 0 0 40px -10px silver;
}

.refresh {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  font-family: system-ui;
  background: #fff85b;
  border: var(--border);
  padding: 0.5rem;
  justify-self: end;
  margin-top: -2rem;
  margin-right: -1rem;
  transition: background 0.25s;
}

.refresh:hover,
.refresh:focus {
  background: orange;
  cursor: pointer;
}

.idea-generator {
  max-width: 500px;
  display: grid;
}

.colors {
  font-size: 80%;
  margin-top: -1rem;
}

.colors li:before {
  content: '';
  background-color: var(--color);
  border: 1px solid white;
  box-shadow: 2px 2px 5px silver;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  height: 1em;
  aspect-ratio: 1 / 1;
}

h1 {
  font-size: 2em;
  display: inline-block;
  background: linear-gradient(-45deg, violet, deeppink, orange);
  margin: 2rem 0 -1rem -1rem;
  border: var(--border);
  padding: 1rem;
  width: 90%;
  text-align: center;
  z-index: 1;
}

</style>

<script>
const industry = ["Спорт", "Мода", "Искусство", "Игры", "Праздники", "Кулинария", "Стиль жизни", "Животные", "Технология", "Путешествия", "Погода"];

const websiteTypes = ["Реклама", "Блог", "Портфолио", "Социальная сеть", "Новости", "Членство", "Nonprofit", "Форум", "Воспитание", "Доска"];

const components = {
  кнопка: ["Добавить в корзину", "Подписаться", "Поделиться", "Загрузить", "Купить"],
  форма: ["Связь", "Поиск", "Регистрация", "Логин", "Отзыв"],
  слайдер: ["Карусель изображений", "Продукт", "Testimonial", "Баннер", "Цены"],
  modal: ["Подписаться на новости", "Видео", "Изображения", "Уведомления", "Информация"],
  меню: ["Выпадающее", "Мега", "Гамбургер", "Таб"],
  карточка: ["Продукт", "Callout", "Пост"]
};

function clearElem(parent) {
    while (parent.firstChild) {
        parent.removeChild(parent.firstChild);
    }
}

function generateRandomColor() {
  // Generate random values for red, green, and blue (RGB)
  const red = Math.floor(Math.random() * 256);
  const green = Math.floor(Math.random() * 256);
  const blue = Math.floor(Math.random() * 256);

  // Construct the CSS color string
  const color = `rgb(${red}, ${green}, ${blue})`;

  // Return the color string
  return color;
}

function generateIdea() {
  // Get a random topic area
  const randomTopic= industry[Math.floor(Math.random() * industry.length)];
 
  // Get a random website type
  const randomWebsiteType = websiteTypes[Math.floor(Math.random() * websiteTypes.length)];

  // Get a random component
  const componentKeys = Object.keys(components);
  const randomComponent = componentKeys[Math.floor(Math.random() * componentKeys.length)];
 
  // Get a random idea from the chosen component
  const ideas = components[randomComponent];
  const randomIdea = ideas[Math.floor(Math.random() * ideas.length)];
 
  // Get a random color theme
  const randomColorTheme = [generateRandomColor(), generateRandomColor(), generateRandomColor()]
 
  // Color list
  const colorList = document.querySelector('.colors');
  clearElem(colorList);
 
  for (let color in randomColorTheme) {
    const newSwatch = document.createElement('li');
    newSwatch.textContent = randomColorTheme[color];
    newSwatch.style.setProperty('--color', randomColorTheme[color])
    colorList.appendChild(newSwatch);
  }
 
  // Text
  document.querySelector('.topic').innerText = randomTopic;
  document.querySelector('.type').innerText = randomWebsiteType;
  document.querySelector('.text').innerText = randomIdea;
  document.querySelector('.component').innerText = randomComponent;
}

document.querySelector('.refresh').addEventListener('click', () => { generateIdea() });

generateIdea()
</script>
<div class="idea-generator">
  <h1>Random Demo Idea Generator</h1>

  <div class="results">
    <p class="idea">
      Для  <span class="topic"></span> <span class="type"></span> сайта создай <span class="text"></span>  <span class="component"></span>
    </p>
    <div class="color-box">
      <p>Используй цвета:</p>
      <ul class="colors"></ul>
    </div>
  </div>
  <button class="refresh">Обновить</button>
</div>

[/html]

0

98

[html]
<style>
body {
    padding: 10em 0;
  margin: 0;
  background-color: #ffc1cc;
  text-align: center;
  color: #ff1d83;
}

.container {
  padding: 1em 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
}
img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  clip-path: path('M213.1,6.7c-32.4-14.4-73.7,0-88.1,30.6C110.6,4.9,67.5-9.5,36.9,6.7C2.8,22.9-13.4,62.4,13.5,110.9 C33.3,145.1,67.5,170.3,125,217c59.3-46.7,93.5-71.9,111.5-106.1C263.4,64.2,247.2,22.9,213.1,6.7z');
  margin: 0;
}

</style>
<script>

</script>
  <h1>happy valentine's day</h1>
<div class="container">

  <div class="img">
    <img src="https://mmgmae.github.io/hosted-assets/64.9.jpg" alt="">
  </div>
    <div class="img">
    <img src="https://mmgmae.github.io/hosted-assets/64.8.jpg" alt="">
  </div>
    <div class="img">
    <img src="https://mmgmae.github.io/hosted-assets/64.3.jpg" alt="">
  </div>
</div>
[/html]

0

99

[html]
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");

:root {
  --container-height: 498px;
}

section {
  position: relative;
  padding-right: 50px;
}

.list {
  max-height: var(--container-height);
  border: 2px solid #37392e;
  border-radius: 5px;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-timeline: listTimeline vertical;
}

.animation {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 100%;
  background-size: 50px 40px;
  /* background image on bottom of css for readability */
}

@supports (scroll-timeline: works) {
  .animation {
    animation: moveBackground 1s alternate linear;
    animation-timeline: listTimeline;
  }
}

@keyframes moveBackground {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 calc(var(--container-height) / -1);
  }
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
  background: #eee5e5;
}

li {
  padding: 20px;
  border-top: 1px solid #ccc;
  scroll-snap-align: start;
}

li:first-child {
  border: 0;
}

/* Demo styles */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #37392e;
  background: #ddcecd;
  font-family: "Poppins", sans-serif;
}

.animation {
  background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg id='Isolation_Mode' data-name='Isolation Mode' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 633.33 680'%3E%3Cpath fill='%2328AFB0' d='M383.33,500c27.61,0,50,22.39,50,50,0,25.99-19.83,47.35-45.18,49.77l-4.82,.23H50c-27.61,0-50-22.39-50-50,0-25.99,19.83-47.35,45.18-49.77l4.82-.23H383.33Zm200-166.67c27.61,0,50,22.39,50,50s-22.39,50-50,50H50c-27.61,0-50-22.39-50-50s22.39-50,50-50H583.33Zm-200-166.67c27.61,0,50,22.39,50,50,0,25.99-19.83,47.35-45.18,49.77l-4.82,.23H50c-27.61,0-50-22.39-50-50,0-25.99,19.83-47.35,45.18-49.77l4.82-.23H383.33ZM583.33,0c27.61,0,50,22.39,50,50,0,25.99-19.83,47.35-45.18,49.77l-4.82,.23H50C22.39,100,0,77.61,0,50,0,24.01,19.83,2.65,45.18,.23l4.82-.23H583.33Z'/%3E%3C/svg%3E");
}

/* width */
::-webkit-scrollbar {
  width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
  background: #f1f1f1;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #28afb0;
  border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #19647e;
}

</style>
<script>

</script>
<section>
  <div class="list">
    <ul>
      <li>Ducks, geese, and waterfowl</li>
      <li>Pheasants, grouse, and allies</li>
      <li>Grebes</li>
      <li>Pigeons and doves</li>
      <li>Sandgrouse</li>
      <li>Bustards</li>
      <li>Cuckoos</li>
      <li>Nightjars</li>
      <li>Swifts</li>
      <li>Cranes</li>
      <li>Rails, gallinules and coots</li>
      <li>Thick-knees</li>
      <li>Stilts and avocets</li>
      <li>Oystercatchers</li>
      <li>Plovers and lapwings</li>
      <li>Sandpipers and allies</li>
      <li>Pratincoles and coursers</li>
      <li>Skuas and jaegers</li>
      <li>Auks, murres and puffins</li>
      <li>Gulls, terns, and skimmers</li>
      <li>Loons</li>
      <li>Albatrosses</li>
      <li>Storks</li>
    </ul>
  </div>
  <div class="animation"></div>
</section>
[/html]

0

100

[html]
<style>
/***************/
/* Theme stuff */
/***************/
body {
  --h: 180; /* Default in case JS doesn't run */
  --text: hsl(var(--h), 30%, 25%);
  --text-alt: hsl(calc(var(--h) + 180), 100%, 25%lob); /* Invert the hue */
  --bg: hsl(var(--h), 20%, 85%);
  --highlight: hsl(var(--h), 70%, 70%);
  --focus: hsl(var(--h), 100%, 50%);}
#theme{
  color: var(--text);
  background-color: var(--bg);
}

code {
  background-color: var(--highlight);
}

#theme h1,
#theme a {
  color: var(--text-alt);
}

#theme a {
  text-decoration-color: var(--focus);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition: text-underline-offset 0.2s, text-decoration-color 0.2s;
}

#theme a:hover {
  text-decoration-color: currentcolor;
  text-underline-offset: 3px;
}

/****************************************************/
/* It's not too bad to style range inputs these days*/
/****************************************************/

[type="range"] {
  --height: 2rem;
  width: 100%;
  height: var(--height);
  appearance: none;
  color: inherit;
  border: 2px solid;
  --s: 90%;
  --l: 70%;
  --rainbow: linear-gradient(
    to right,
    hsl(0deg var(--s) var(--l)),
    hsl(60deg var(--s) var(--l)),
    hsl(120deg var(--s) var(--l)),
    hsl(180deg var(--s) var(--l)),
    hsl(240deg var(--s) var(--l)),
    hsl(300deg var(--s) var(--l)),
    hsl(360deg var(--s) var(--l))
  );
  background-image: var(--rainbow);
}

[type="range"]:focus {
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus);
}

[type="range"]:focus:not(:focus-visible) {
  box-shadow: none;
}

::-moz-range-thumb {
  appearance: none;
  width: 1rem;
  height: calc(var(--height) + 2px);
  border: 2px solid;
  border-radius: 0;
  box-shadow: inset 0 0 0 2px white;
  background-color: white;
  --shading: hsl(var(--h) 0% 85%);
  background-image: linear-gradient(to bottom, white, var(--shading));
}

::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: calc(var(--height) + 2px);
  border: 2px solid;
  border-radius: 0;
  box-shadow: inset 0 0 0 2px white;
  background-color: white;
  --shading: hsl(var(--h) 0% 85%);
  background-image: linear-gradient(to bottom, white, var(--shading));
}

/*****************************************/
/* Unrelated to theming, just layout etc */
/*****************************************/

* {
  margin: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  max-width: 58ch;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
  place-content: center;
  font-family: ui-monospace, monospace;
  line-height: 1.25;
}

code {
  padding: 0.125rem 0.25rem;
  box-decoration-break: clone;
  font-weight: 900;
  font-size: inherit;
}
</style>
<script>
document
  .querySelector("[type='range']")
  .addEventListener("input", event => {
    let hue = event.target.value;
    document.body.style.setProperty("--h", hue);
  })

</script>

<div id="theme">
<h1>Hue theme picker</h1>
<p>A simple theme picker using an <code>&lt;input type="range"&gt;</code>.</p>

<input type="range" min="0" value="180" max="360">

<p>All colours use an <code>--h</code> CSS custom property that is controlled by the range input, so adjusting it updates the entire theme.</p>

<p>Notice that <code>hsl</code> doesn't have uniform perceptual lightness—i.e. the same <code>l</code> percentage can look wildly darker for a given hue. Change the theme to purple and notice how much lower the contrast is.</p>

<p>It's ok though—<a href="https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl" target="_blank" rel="noreferrer"><code>oklch</code> is here to save us!</a></p>
</div>

[/html]

0

101

[html]
<style>
/***************/
/* Theme stuff */
/***************/
body {
  --h: 180; /* Default in case JS doesn't run */
  --text: hsl(var(--h), 30%, 25%);
  --text-alt: hsl(calc(var(--h) + 180), 100%, 25%lob); /* Invert the hue */
  --bg: hsl(var(--h), 20%, 85%);
  --highlight: hsl(var(--h), 70%, 70%);
  --focus: hsl(var(--h), 100%, 50%);}
#theme{ width: 98%;
  color: var(--text);
  background-color: var(--bg);
}

#theme code {
  background-color: var(--highlight);
  font-size: 1.2em;
}
#theme h15{
  font-size: 2em;
  font-weight: normal;
  text-align: center;
  color: var(--h);
}

#theme h15,
#theme a {
  color: var(--text-alt);
}

#imgArt{
max-height: 100px;
width: 98%;
overflow: clip;
border: 2px solid var(--text);
}

#theme a {
  text-decoration: underline !important;
  text-decoration-color: var(--focus)!important;
  text-decoration-thickness: 2px!important;
  text-underline-offset: 8px!important;
  transition: text-underline-offset 0.2s, text-decoration-color 0.2s;
}

#theme a:hover {
  text-decoration-color: currentcolor!important;
  text-underline-offset: 3px!important;
}

#theme p::first-letter {
  font-size: 2em;
  text-decoration-color: var(--focus);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition: text-underline-offset 0.2s, text-decoration-color 0.2s;
}

/****************************************************/
/* It's not too bad to style range inputs these days*/
/****************************************************/

[type="range"] {
  --height: 2rem;
  width: 100%;
  height: var(--height);
  appearance: none;
  color: inherit;
  border: 2px solid;
  --s: 90%;
  --l: 70%;
  --rainbow: linear-gradient(
    to right,
    hsl(0deg var(--s) var(--l)),
    hsl(60deg var(--s) var(--l)),
    hsl(120deg var(--s) var(--l)),
    hsl(180deg var(--s) var(--l)),
    hsl(240deg var(--s) var(--l)),
    hsl(300deg var(--s) var(--l)),
    hsl(360deg var(--s) var(--l))
  );
  background-image: var(--rainbow);
}

[type="range"]:focus {
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus);
}

[type="range"]:focus:not(:focus-visible) {
  box-shadow: none;
}

::-moz-range-thumb {
  appearance: none;
  width: 1rem;
  height: calc(var(--height) + 2px);
  border: 2px solid;
  border-radius: 0;
  box-shadow: inset 0 0 0 2px white;
  background-color: white;
  --shading: hsl(var(--h) 0% 85%);
  background-image: linear-gradient(to bottom, white, var(--shading));
}

::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: calc(var(--height) + 2px);
  border: 2px solid;
  border-radius: 0;
  box-shadow: inset 0 0 0 2px white;
  background-color: white;
  --shading: hsl(var(--h) 0% 85%);
  background-image: linear-gradient(to bottom, white, var(--shading));
}

</style>
<script>
document
  .querySelector("[type='range']")
  .addEventListener("input", event => {
    let hue = event.target.value;
    document.body.style.setProperty("--h", hue);
  })

</script>

<div id="theme">

<h15>Hue theme picker</h15>
<p>A simple theme picker using an <code>&lt;input type="range"&gt;</code>.</p>

<input type="range" min="0" value="180" max="360">

</div>

<div id="theme">

<p>
Зал Совета директоров много лет не ремонтировали, священные фрески, которыми был расписан потолок, почти выцвели, пошли замысловатыми пятнами сырости, придававшими загадочность батальным сценам.
<br><br>
Господин директор Спел разглядывал потолок, словно стараясь угадать смысл в изображениях. Он не хотел показывать, что интересуется происходящим.
<br><br>
Господин директор Мекиль, начальник полиции, уже заканчивал свою разгромную речь, и до слуха Спела долетали лишь отрывки фраз: «... преступно нарушив Порядок, инженер Лемень... опорочив честное имя одного из самых уважаемых семейств, инженер Лемень...»
<br><br>
Мекиль, по прозвищу Мокрица, имел в виду семейство Спелов. Инженер Лемень вознамерился жениться на дочери Спела.
<br><br>
Шестнадцать директоров, сидевших в жестких деревянных <code>креслах вокруг массивного, отполированного локтями стола, слушали внимательно, и каждый из них старался понять, какую угрозу для них таит гневная речь Мокрицы. Тощий, мрачный, похожий на летучую мышь, Первый директор Калгар задумчиво крутил пальцами колокольчик. Его не устраивало усиление позиции начальника полиции.
<br><br>
Калгар покосился на Спела. Тот разглядывал фрески на потолке. Он не посмел пойти против Мокрицы и теперь делает вид, что слова Мекиля его не касаются.</code>
<br><br>
Мокрица кончил говорить. Директора зашевелились. Кто-то кашлянул. Калгар поднялся. Он был Первым директором, и ему проводить голосование.
<br><br>
<div id ="imgArt"><img src="https://wallpapers.com/images/featured/flower-kjzc9tzmwq40sj5f.jpg"></div>
<br><br>
— Господин Спел, — сказал Калгар. — Согласны ли вы, что нарушитель Порядка инженер Лемень заслуживает смерти в Огненной Бездне?
<br><br>
Спел наклонил голову.
<br><br>
— Господин генерал-директор?
<br><br>
Сверкающая нашивками туша колыхнулась.
<br><br>
— Без сомнения.
<br><br>
— Господин директор шахт?
<br><br>
Директор шахт долго жевал губами, изображая работу мысли. Калгар подумал, что Мокрица заплатил ему, но недостаточно.
<br><br>
— Полагаю, что поступки инженера <code>Леменя</code> выходят, так сказать, за рамки... А его идеи о существовании Города Наверху?
<br><br>
— Мы судим Леменя не за идеи, а за нарушение Порядка, — перебил его Мекиль.
<br><br>
— Да, — сказал директор шахт быстро. — Да, да.
<br><br>
— Господин директор коммуникаций?
<br><br>
У директора коммуникаций болит печень. Он морщится, прислушиваясь к боли, достает флакон с лекарством и машет свободной рукой — конечно, что там обсуждать...
<br><br>
Когда последний из директоров проголосовал за смерть Леменю, Калгар отцепил висящий на нагрудной цепи небольшой ключ от Переговорной.
<br><br>
— Тогда, — сказал он, — в согласии с традициями и Порядком, мы должны сделать Всеобщее оповещение. Господин директор Спел!
<br><br>
Хранитель ключа от Переговорной, <a href=#>директор Спел медленно</a> поднялся.
<br><br>
Мокрица смотрел на директоров. Это был час его торжества.
<br><br>
У двери Спел обернулся. У черной портьеры, скрывающей вход в зал заседаний, среди чиновников, жрецов, лакеев и охраны стоял его сын в форме офицера тайной стражи. Спел-старший встретился с ним взглядом. Спел-младший незаметно кивнул.

</p>

</div>

[/html]

0

102

[html]
<style>

</style>
<script>

</script>

[/html]

0

103

[html]
<style>
@keyframes slideup-text{
  50%{
    background-size: 100% 100%;
  }
}
p{
  box-sizing: border-box;
  border: 1px white solid;
  padding: 1rem;
  font-size: clamp(1vw, 1.5rem, 2vh);
  font-family: sans-serif;
  background-image: linear-gradient(white 0%, yellow 50%, green 100%);
  background-repeat: repeat-y;
  background-repeat: no-repeat;
  background-postion: center center;
 
  color: white;
  background-clip: text;-webkit-background-clip: text;color: transparent;
  animation: slideup-text 5s infinite; }
  p.left-right{
    background-size: 0% 100%;
  }
  p.right-left{
    background-size: 0% 100%;
    background-position: top right;
  }
  p.top-bottom{
    background-size: 100% 0%;
  }
  p.bottom-top{
    background-size: 100% 0%;
    background-position: bottom right;
  }
  p.center{
    background-size: 0% 0%;
    background-position: center;
  }
}

</style>
<p class="left-right">Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi, magnam delectus quis voluptatem assumenda, non porro, vero inventore eveniet harum repellat. Culpa, reprehenderit ipsum impedit, molestias sunt magnam repellat sint ipsam inventore commodi quis perferendis. Optio, eius iusto?</p>
<p class="right-left">Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi, magnam delectus quis voluptatem assumenda, non porro, vero inventore eveniet harum repellat. Culpa, reprehenderit ipsum impedit, molestias sunt magnam repellat sint ipsam inventore commodi quis perferendis. Optio, eius iusto?</p>
<p class="center">Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi, magnam delectus quis voluptatem assumenda, non porro, vero inventore eveniet harum repellat. Culpa, reprehenderit ipsum impedit, molestias sunt magnam repellat sint ipsam inventore commodi quis perferendis. Optio, eius iusto?</p>
<p class="top-bottom">Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi, magnam delectus quis voluptatem assumenda, non porro, vero inventore eveniet harum repellat. Culpa, reprehenderit ipsum impedit, molestias sunt magnam repellat sint ipsam inventore commodi quis perferendis. Optio, eius iusto?</p>
<p class="bottom-top">Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi, magnam delectus quis voluptatem assumenda, non porro, vero inventore eveniet harum repellat. Culpa, reprehenderit ipsum impedit, molestias sunt magnam repellat sint ipsam inventore commodi quis perferendis. Optio, eius iusto?</p>

[/html]

0

104

[html]
<style>
h1::before { 
  transform: scaleX(0);
  transform-origin: bottom right;
}

h1:hover::before {
  transform: scaleX(1);
  transform-origin: bottom left;
}

h1::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0 0 0 0;
  background: hsl(200 100% 80%);
  z-index: -1;
  transition: transform .3s ease;
}

h1 {
  position: relative;
  font-size: 5rem;
}

html {
  block-size: 100%;
  inline-size: 100%;
}

body {
  min-block-size: 100%;
  min-inline-size: 100%;
  margin: 0;
  box-sizing: border-box;
  display: grid;
  place-content: center;
  font-family: system-ui, sans-serif;
}

@media (orientation: landscape) {
  body {
    grid-auto-flow: column;
  }
}

</style>
<h1>Hover Me</h1>

[/html]

0

105

[html]
<style>
.panel {
  position:relative;
  display:inline-block;
  width:12.5vw;
  max-width:200px;
  height:25vw;
  margin:5vw 1vw;
  background: rgb(255, 255, 255);
  box-shadow:0 5px 10px rgba(0,0,0,.5);
  border-radius:.25vw;
  overflow:hidden;
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}
.panel:nth-child(2), .panel:nth-child(4) {
  margin:2.5vw 1vw;
  height:30vw;
}
.panel:nth-child(3) {
  height:35vw;
  margin:0 1vw;
}

.panel div {
  position:absolute;
  mix-blend-mode:multiply;
}
.panel .triangle {
  clip-path:polygon(50% 0%, 100% 100%, 0% 100%);
}
.panel .circle {
  border-radius:50%;
}

label {
  width:100px;
  display:block;
  font-size:14px;
  font-family:sans-serif;
  text-align:center;
  color:white;
  position:fixed;
  bottom:35px;
  left:10px;
  left:calc(50% - 50px);
}
#interior_elements {
  width:100px;
  position:fixed;
  bottom:10px;
  left:calc(50% - 50px);
}
</style>
<script>
const divs = document.querySelectorAll('div')
function fillPanels() {
  var elementCount = document.querySelector('input').value
  divs.forEach(function(el){
    el.innerHTML = ''
    function addElement() {
      var d = document.createElement('div')
      var shape = Math.random() < .5 ? 'triangle' : 'circle'
      d.className = Math.random() < .5 ? shape : 'square'
      var size = Math.ceil(Math.random()*7) + 'vw';
      d.style.width = size
      d.style.height = size
      var color = 'hsl('+(Math.random()*360)+'deg, 100%, 60%)'
      if(Math.random() < .5) {
        d.style.backgroundColor = color
      } else {
        d.style.backgroundImage = 'linear-gradient(to bottom, transparent 4px , '+color+' 4px, '+color+' 5px, transparent 5px)'
      }     
      d.style.backgroundSize = '100% 6px'
      d.style.left = Math.random()*100 + '%'
      d.style.top = Math.random()*100 + '%'
      d.style.transform = 'rotate('+Math.random()*360+'deg)'
      el.appendChild(d)
    }

    for(var i=0;i<elementCount;i++) {
      addElement() 
    }
  }) 
}

fillPanels()

window.addEventListener('click', fillPanels)
document.querySelector('input').addEventListener('change', fillPanels)
</script>
<div class='panel'></div>
<div class='panel'></div>
<div class='panel'></div>
<div class='panel'></div>
<div class='panel'></div>

<label for="interior_elements">Interior Shapes:</label>
<input type="number" id="interior_elements" name="interior_elements" min="1" max="50" value="5">
[/html]

0

106

[html]
<style>
#dvid {
    position: relative;
    margin: auto;
    width: 200px;
    height: 100px;
    line-height: 100px;
    text-align: center;
    overflow: hidden;}
   
    #dvid::after {
        content: "Hover Me";
        position: absolute;
        top: 4px;
        bottom: 4px;
        right: 4px;
        left: 4px;
        line-height: 92px;
        font-size: 24px;
        background: #fff;
        // border-radius: 50%;
        border: 2px solid yellowgreen;
        cursor: pointer;
        color: yellowgreen;
    }
   
    #dvid::before {
        content: "";
        position: absolute;
        top: 0px;
        bottom: 0px;
        right: -20px;
        left: 0px;
        background: #fff;
        //border-radius: 50%;
        transform: rotateZ(-90deg) translate(-100%, -100%);
        transform-origin: top left;
        transition: transform .3s;
        transition-timing-function: linear;
    }
   
    #dvid:hover {
        filter: contrast(1.2);
    }
   
        #dvid:hover::before {
            transform: rotateZ(0deg) translate(0%, -0%);
        }

#dvid:nth-child(2) {
    overflow: unset;
   
    #dvid::after {
        content: "";
    }
}

#dvid:nth-child(1):hover ~ #dvid:nth-child(2)::before {
    transform: rotateZ(0deg) translate(0%, -0%);
}
   
</style>
<div id="dvid">Hover Me</div>
<div id="dvid">Hover Me</div>
[/html]

0

107

[html]
<style>
nav {
  max-width: 960px;
  mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 25%, #ffffff 75%, rgba(255, 255, 255, 0) 100%);
  margin: 0 auto;
  padding: 60px 0;
}

nav ul {
  text-align: center;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}

nav ul li {
  display: inline-block;
}

nav ul li a {
  padding: 18px;
  font-family: "Open Sans";
  text-transform:uppercase;
  color: rgba(0, 35, 122, 0.5);
  font-size: 18px;
  text-decoration: none;
  display: block;
}

nav ul li a:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(0, 35, 122, 0.7);
}
</style>
<script>

</script>
<div>
<nav>
  <ul>
    <li>
      <a href="#">Home</a>
    </li>
    <li>
      <a href="#">About</a>
    </li>
    <li>
      <a href="#">Services</a>
    </li>
    <li>
      <a href="#">Contact</a>
    </li>
  </ul>
</nav>
</div>
[/html]

0

108

[html]
<style>
.anim750{
  transition: all 750ms ease-in-out;
}

#Awesome{
position: relative;
width: 180px;
height: 180px;
margin: 0 auto;
 
  backface-visibility: hidden;
}

#Awesome .sticky{
transform: rotate(45deg);
}

#Awesome:hover .sticky{
transform: rotate(10deg);
}

#Awesome .sticky{
position: absolute;
top: 0;
left: 0;
width:180px;
height: 180px;
}

#Awesome .reveal .circle{
box-shadow: 0 1px 0px rgba(0,0,0,.15);
 
  font-family: 'helvetica neue', arial;
  font-weight: 200;
  line-height: 140px;
  text-align: center;
 
  cursor: pointer;
}

#Awesome .reveal .circle{
background: #fafafa;
}

#Awesome .circle_wrapper{
position: absolute;
width: 180px;
height: 180px;
left: 0px;
top: 0px;
overflow: hidden;
}

#Awesome .circle{
position: absolute;
width: 140px;
height:  140px;
margin: 20px;

border-radius: 999px;
}

#Awesome .back{
height: 10px;
top: 30px;
}

#Awesome:hover .back{
height: 90px;
top: 110px;
}

#Awesome .back .circle{
margin-top: -130px;
background-color: #fbec3f;

background-image: -webkit-linear-gradient(bottom, rgba(251,236,63,.0), rgba(255,255,255,.8));
}

#Awesome:hover .back .circle{
margin-top: -50px;
}

#Awesome .front{
height: 150px;
bottom: 0;
top: auto;

-webkit-box-shadow: 0 -140px 20px -140px rgba(0,0,0,.3);
}

#Awesome:hover .front{
height: 70px;

-webkit-box-shadow: 0 -60px 10px -60px rgba(0,0,0,.1);
}

#Awesome .front .circle{
margin-top: -10px;
background: #fbec3f;

background-image: -webkit-linear-gradient(bottom, rgba(251,236,63,.0) 75%, #f7bb37 95%);
  background-image: -moz-linear-gradient(bottom, rgba(251,236,63,.0) 75%, #f7bb37 95%);
  background-image: linear-gradient(bottom, rgba(251,236,63,.0) 75%, #f7bb37 95%);
}

#Awesome h4{
  font-family: 'helvetica neue', arial;
  font-weight: 200;
  text-align: center;
position: absolute;
width: 180px;
height: 140px;
  line-height: 140px;

transition: opacity 50ms linear 400ms;
}

#Awesome:hover h4{
opacity: 0;

transition: opacity 50ms linear 300ms;
}

#Awesome:hover .front .circle{
margin-top: -90px;
background-color: #e2d439;
background-position: 0 100px;
}
</style>
<div id="Awesome" class="anim750">

  <div class="reveal circle_wrapper">
    <div class="circle">У того есть паренек</div>
</div>
           
<div class="sticky anim750">
    <div class="front circle_wrapper anim750">
    <div class="circle anim750"></div>
  </div>
</div>

  <h4>Кто откроет уголок</h4>
           
  <div class="sticky anim750">
    <div class="back circle_wrapper anim750">
    <div class="circle anim750"></div>
    </div>
</div>
           
</div>

[/html]

0

109

[html]
<style>

/* global css variables */
:root {
  --how-color: rgba(249, 133, 70, 0.7);
  --scores-color: rgba(46, 191, 158, 0.7);
  --game-color: rgba(170, 145, 224, 0.7);
  --play-color: rgba(30, 152, 166, 0.8);
  --special-color: rgba(173, 168, 28, 0.7);
}

#box34{
  text-align: center;
  margin:0;
  padding:0;
  font-family: 'Handlee', cursive;
  font-size:18px;
  color: rgba(255, 255, 255, 0.75);
  background: radial-gradient(#f09e7287 15%, transparent 16%) 0 0, radial-gradient(#f09e7287 15%, transparent 16%) 8px 8px, radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px, radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 8px 9px;
  background-size:16px 16px;
  background-color:#615d5d;
  background-attachment: fixed;
  min-height: 500px;
}

/* top navigation */
#header {
  font-size: 45px;
}
header nav {
  position: fixed;
  top: 0px;
  height:auto;
  padding:0px;
  width: 100%;
  transition: transform 0.6s;
  z-index:20;
}
header nav.begone {
  transform: translate3d(0, -100%, 0);
}
nav button{
  position:absolute;
  width:100%;
  left:0;
  background-color: rgb(51, 50, 51);
  color: rgb(255, 255, 255);
  padding: 10px;
  border: none;
  font-size: 17px;
  transition: background-color 0.3s, opacity 0.3s linear;
  outline: none;
  height:40px;
}
#homeButton {
  background-color: rgba(222, 85, 88, 0.7);
  left:0;
  width:50px;
}
#howButton {
  background-color: var(--how-color);
  left:50px;
  width: calc((100% - 50px) / 3);
}
#scoresButton {
  background-color: var(--scores-color);
  left: calc(((100% - 50px) / 3) + 50px);
  width: calc((100% - 50px) / 3);
}
#gameButton {
  background-color: var(--game-color);
  left: calc(((100% - 50px) / 3 * 2) + 50px);
  width: calc((100% - 50px) / 3);
}
button:hover {
  opacity: 0.8;
  cursor: pointer;
}
button.active {
  background-color: rgba(0, 0, 0, 0.2) !important;
}
button {
  font-family: 'Handlee', cursive;
}

/* handles the page transitions */
.showPage{
  -webkit-animation: showPage 2s ease forwards;
  -moz-animation: showPage 2s ease forwards;
  -o-animation: showPage 2s ease forwards;
  animation: showPage 2s ease forwards;
}

/* style of main content */
#content {
  margin-top:40px;
  padding: 10px;
}
#content h1 {
  margin-top:30px;
  font-size:65px;
  font-family: 'Indie Flower', cursive;
  margin-bottom:0px;
  color: rgba(255, 255, 255, 0.25);
}
#content #how article {
  margin-top: 60px;
}

/* styling of the wolves */
.wolves div {
  position: absolute;
  width:100px;
  height:90px;
}
.wolves .top-left {
  top: 60px;
  left: 20px;
  -webkit-animation: wolf-rotate 4s linear infinite;
  -moz-animation: wolf-rotate 4s linear infinite;
  -o-animation: wolf-rotate 4s linear infinite;
  animation: wolf-rotate 4s linear infinite;
}
.wolves .top-right {
  top: 60px;
  left: calc(100% - 120px);
  -webkit-animation: wolf-rotate 4s linear -2s infinite;
  -moz-animation: wolf-rotate 4s linear -2s infinite;
  -o-animation: wolf-rotate 4s linear -2s infinite;
  animation: wolf-rotate 4s linear -2s infinite;
}
.wolf div {
  position: absolute;
}
.wolf .wolf-head {
  width: 0;
  height: 0;
  top: 0px;
  left: 0px;
  border-style: solid;
  border-width: 90px 50px 0 50px;
  border-color: #888 transparent transparent transparent;
  border-radius:100%;
  -webkit-animation: wolf-head-change 4s linear infinite;
  -moz-animation: wolf-head-change 4s linear infinite;
  -o-animation: wolf-head-change 4s linear infinite;
  animation: wolf-head-change 4s linear infinite;
}
.wolf .wolf-ear-left {
  width: 0;
  height: 0;
  top: -20px;
  left: 10px;
  border-style: solid;
  border-width: 0 15px 40px 15px;
  border-color: transparent transparent #888 transparent;
  transform: rotate(-20deg);
}
.wolf .wolf-ear-right {
  width: 0;
  height: 0;
  top: -20px;
  left: 60px;
  border-style: solid;
  border-width: 0 15px 40px 15px;
  border-color: transparent transparent #888 transparent;
  transform: rotate(20deg);
}
.wolf .wolf-eye-left {
  width: 0;
  height: 0;
  top: 25px;
  left: 60px;
  border-style: solid;
  border-width: 18px 14px 0 0;
  border-color: #444 transparent transparent transparent;
  transform: skew(-15deg);
}
.wolf .wolf-eye-right {
  width: 0;
  height: 0;
  top: 25px;
  left: 25px;
  border-style: solid;
  border-width: 0 14px 18px 0;
  border-color: transparent #444 transparent transparent;
  transform: skew(15deg);
}
.wolf .wolf-eyeball-left {
  width: 5px;
  height: 5px;
  top: 27px;
  left: 63px;
  background-color: rgb(255, 255, 255);
  border-radius:50%;
}
.wolf .wolf-eyeball-right {
  width: 5px;
  height: 5px;
  top: 27px;
  left: 31px;
  background-color: rgb(255, 255, 255);
  border-radius:50%;
}
.wolf .wolf-nose {
  width: 0;
  height: 0;
  top: 72px;
  left: 45px;
  border-style: solid;
  border-width: 12px 5px 0 5px;
  border-color: #444444 transparent transparent transparent;
}

/* styling of the box on the home page */
#box {
  padding: 20px;
  width: 300px;
  height:275px;
  text-align: center;
  margin: auto;
  margin-top: 20px;
  border-radius: 0px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
  background-color: rgba(92, 91, 92, 0.4);
}
#box #creator {
  opacity: 0.5;
  font-size: 16px;
}
#box .home-buttons {
  width: 100px;
  height: 100px;
  margin: 20px 10px;
  border: none;
  outline: none;
  transition: background-color 0.3s, opacity 0.3s linear, border-radius 0.4s ease-out;
  color: rgb(255, 255, 255);
  font-size: 18px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}
#box #homeHowButton {
  background-color: var(--how-color);
  border-radius: 0 40px;
  -webkit-animation: rotate 1.5s ease-out 1.5s forwards;
  -moz-animation: rotate 1.5s ease-out 1.5s forwards;
  -o-animation: rotate 1.5s ease-out 1.5s forwards;
  animation: rotate 1.5s ease-out 1.5s forwards;
}
#box #homePlayButton {
  background-color: var(--game-color);
  border-radius: 40px 0;
  -webkit-animation: rotate 1.5s ease-in 1.5s reverse forwards;
  -moz-animation: rotate 1.5s ease-in 1.5s reverse forwards;
  -o-animation: rotate 1.5s ease-in 1.5s reverse forwards;
  animation: rotate 1.5s ease-in 1.5s reverse forwards;
}
#box .home-buttons:hover, #box #homeHowButton:hover, #box #homePlayButton:hover {
  opacity: 0.8;
  cursor: pointer;
  border-radius: 100%;
}
#box #welcome {
  font-size: 20px;
}

/* styling of the text on the how page */
#how .line {
  position: relative;
  margin: 0 auto;
  white-space: nowrap;
  line-height: 40px;
  overflow: hidden;
  opacity: 0;
}
#how .line-1 {
  -webkit-animation: fadein 1s ease-in 1.5s forwards;
  -moz-animation: fadein 1s ease-in 1.5s forwards;
  -o-animation: fadein 1s ease-in 1.5s forwards;
  animation: fadein 1s ease-in 1.5s forwards;
}
#how .line-2 {
  -webkit-animation: fadein 1s ease-in 3.5s forwards;
  -moz-animation: fadein 1s ease-in 3.5s forwards;
  -o-animation: fadein 1s ease-in 3.5s forwards;
  animation: fadein 1s ease-in 3.5s forwards;
}
#how .line-3 {
  -webkit-animation: fadein 1s ease-in 5.5s forwards;
  -moz-animation: fadein 1s ease-in 5.5s forwards;
  -o-animation: fadein 1s ease-in 5.5s forwards;
  animation: fadein 1s ease-in 5.5s forwards;
}
#how .line-4 {
  -webkit-animation: fadein 1s ease-in 7.5s forwards;
  -moz-animation: fadein 1s ease-in 7.5s forwards;
  -o-animation: fadein 1s ease-in 7.5s forwards;
  animation: fadein 1s ease-in 7.5s forwards;
}
#how .line-5 {
  -webkit-animation: fadein 1s ease-in 9.5s forwards;
  -moz-animation: fadein 1s ease-in 9.5s forwards;
  -o-animation: fadein 1s ease-in 9.5s forwards;
  animation: fadein 1s ease-in 9.5s forwards;
}
#how .particle-gold {
  width: 60px;
  height: 60px;
  margin: auto;
  opacity: 0;
  margin-top: 20px;
  -webkit-animation: fadein 1s ease-in 11s forwards, rotate 2s linear infinite;
  -moz-animation: fadein 1s ease-in 11s forwards, rotate 2s linear infinite;
  -o-animation: fadein 1s ease-in 11s forwards, rotate 2s linear infinite;
  animation: fadein 1s ease-in 11s forwards, rotate 2s linear infinite;
}

/* styling of the high scores table */
.table-scores {
  width: 275px;
  border: solid 0px;
  border: none;
  border-collapse: separate;
  border-spacing: 0 7px;
  line-height: 20px;
  margin: auto;
  margin-top: 30px;
  opacity: 0;
  -webkit-animation: fadein 1.5s ease-out 2s forwards;
  -moz-animation: fadein 1.5s ease-out 2s forwards;
  -o-animation: fadein 1.5s ease-out 2s forwards;
  animation: fadein 1.5s ease-out 2s forwards;
}
.table-scores th {
  color: rgba(50, 135, 168, 0.8);
}
.table-scores td {
  font-size: 14px;
  line-height: 20px;
  border-bottom: 1px solid rgba(220, 220, 220, 0.2);
}
.scores-header-name, .scores-name {
  text-align:left;
}
.scores-header-score, .scores-score {
  text-align: right;
}

/* styling of the game */
#game {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#game .game-title {
  padding-top: 50px;
  font-size: 60px;
  color: rgba(200, 200, 200, 0.15);
}
#gameComponents {
  display: none;
}
#gameComponents .game-score {
  margin: auto;
  margin-top: 100px;
  text-align: center;
  font-size: 60px;
  color: rgba(200, 200, 200, 0.2);
  opacity: 0;
  z-index: -1;
  position: relative;
  transition: opacity 0.3s linear;
  -webkit-animation: fadein 1.5s ease-in forwards;
  -moz-animation: fadein 1.5s ease-in forwards;
  -o-animation: fadein 1.5s ease-in forwards;
  animation: fadein 1.5s ease-in forwards;
}
#gameComponents #gameTimer {
  margin: auto;
  margin-top: 100px;
  text-align: center;
  font-size: 50px;
  color: rgba(200, 200, 200, 0.2);
  opacity: 0;
  z-index: -1;
  position: relative;
  transition: opacity 0.3s linear;
  -webkit-animation: fadein 1.5s ease-in forwards;
  -moz-animation: fadein 1.5s ease-in forwards;
  -o-animation: fadein 1.5s ease-in forwards;
  animation: fadein 1.5s ease-in forwards;
}
#gameScore, #gameScoreBest {
  margin: auto;
  text-align: center;
  font-size: 60px;
  color: rgba(200, 200, 200, 0.15);
  opacity: 0;
}
#gameScore {
  margin-top: 120px;
  opacity: 0;
  -webkit-animation: show-scores 0.75s forwards 0.25s;
  -moz-animation: show-scores 0.75s forwards 0.25s;
  -o-animation: show-scores 0.75s forwards 0.25s;
  animation: show-scores 0.75s forwards 0.25s;
}
#gameScoreBest {
  opacity: 0;
  -webkit-animation: show-scores 0.75s forwards 1s;
  -moz-animation: show-scores 0.75s forwards 1s;
  -o-animation: show-scores 0.75s forwards 1s;
  animation: show-scores 0.75s forwards 1s;
}
#gameStartButton, #gameReplayButton {
  position: absolute;
  left: calc(50% - 75px);
  top: calc(50%);
  margin: auto;
  background-color: var(--play-color);
  width: 150px;
  height: 50px;
  font-size: 18px;
  color: rgb(255, 255, 255);
  border: none;
  outline: none;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
  transition: background-color 0.3s, opacity 0.3s linear;
}
#gameReplayButton {
  top: calc(60%);
  opacity: 0;
  -webkit-animation: spin 1.5s forwards 2s;
  -moz-animation: spin 1.5s forwards 2s;
  -o-animation: spin 1.5s forwards 2s;
  animation: spin 1.5s forwards 2s;
}
#gameStartButton:hover, #gameReplayButton:hover {
  opacity: 0.8 !important;
}

/* styling of the particles */
#particle-box {
  position: absolute;
  overflow: hidden;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.particle {
  position:absolute;
  opacity: 0;
  transition: all 1s ease-in-out;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}
.particle-red, .bit-red {
  background-color: rgba(222, 85, 88, 1);
}
.particle-green, .bit-green {
  background-color: rgba(46, 191, 158, 1);
}
.particle-blue, .bit-blue {
  background-color: rgba(0, 145, 224, 1);
}
.particle-gold, .bit-gold {
  background-color: var(--special-color);
  border-radius: 30% 0;
}
div.particle:hover {
  cursor: pointer;
  width: 150px !important;
  height: 150px !important;
  opacity: 0.5 !important;
  -webkit-animation-play-state: paused !important;
  -moz-animation-play-state: paused !important;
  -o-animation-play-state: paused !important;
  animation-play-state: paused !important;
}

/* styling of the explosions when you click a particle */
.explosion {
  position: absolute;
  width: 600px;
  height: 600px;
  pointer-events: none;
}
.bit {
  position: absolute;
  width: 10px;
  height: 10px;
  -webkit-animation: pop 1.5s ease-in reverse forwards;
  -moz-animation: pop 1.5s ease-in reverse forwards;
  -o-animation: pop 1.5s ease-in reverse forwards;
  animation: pop 1.5s ease-in reverse forwards;
}

@-webkit-keyframes showPage {
  from {
    opacity:0;
    transform: translateY(-100%);
  }
  to {
    opacity:1;
    transform: translateY(0%);
  }
}
@-moz-keyframes showPage {
  from {
    opacity:0;
    transform: translateY(-100%);
  }
  to {
    opacity:1;
    transform: translateY(0%);
  }
}
@-o-keyframes showPage {
  from {
    opacity:0;
    transform: translateY(-100%);
  }
  to {
    opacity:1;
    transform: translateY(0%);
  }
}
@keyframes showPage {
  from {
    opacity:0;
    transform: translateY(-100%);
  }
  to {
    opacity:1;
    transform: translateY(0%);
  }
}

@-webkit-keyframes wolf-rotate {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-20deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@-moz-keyframes wolf-rotate {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-20deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@-o-keyframes wolf-rotate {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-20deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@keyframes wolf-rotate {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-20deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@-webkit-keyframes wolf-head-change {
  0% {
    border-color: #F98546 transparent transparent transparent;
  }
  20% {
    border-color: #2EBF9E transparent transparent transparent;
  }
  40% {
    border-color: #218F76 transparent transparent transparent;
  }
  60% {
    border-color: #0091e0 transparent transparent transparent;
  }
  80% {
    border-color: #f3554a transparent transparent transparent;
  }
  100% {
    border-color: #F98546 transparent transparent transparent;
  }
}
@-moz-keyframes wolf-head-change {
  0% {
    border-color: #F98546 transparent transparent transparent;
  }
  20% {
    border-color: #2EBF9E transparent transparent transparent;
  }
  40% {
    border-color: #218F76 transparent transparent transparent;
  }
  60% {
    border-color: #0091e0 transparent transparent transparent;
  }
  80% {
    border-color: #f3554a transparent transparent transparent;
  }
  100% {
    border-color: #F98546 transparent transparent transparent;
  }
}
@-o-keyframes wolf-head-change {
  0% {
    border-color: #F98546 transparent transparent transparent;
  }
  20% {
    border-color: #2EBF9E transparent transparent transparent;
  }
  40% {
    border-color: #218F76 transparent transparent transparent;
  }
  60% {
    border-color: #0091e0 transparent transparent transparent;
  }
  80% {
    border-color: #f3554a transparent transparent transparent;
  }
  100% {
    border-color: #F98546 transparent transparent transparent;
  }
}
@keyframes wolf-head-change {
  0% {
    border-color: #F98546 transparent transparent transparent;
  }
  20% {
    border-color: #2EBF9E transparent transparent transparent;
  }
  40% {
    border-color: #218F76 transparent transparent transparent;
  }
  60% {
    border-color: #0091e0 transparent transparent transparent;
  }
  80% {
    border-color: #f3554a transparent transparent transparent;
  }
  100% {
    border-color: #F98546 transparent transparent transparent;
  }
}

@-webkit-keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@-moz-keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@-o-keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@-webkit-keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@-moz-keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@-o-keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@-webkit-keyframes spin {
  0% {
    opacity: 0;
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(360deg);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
}
@-moz-keyframes spin {
  0% {
    opacity: 0;
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(360deg);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
}
@-o-keyframes spin {
  0% {
    opacity: 0;
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(360deg);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
}
@keyframes spin {
  0% {
    opacity: 0;
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(360deg);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
}

@-webkit-keyframes show-scores {
  from {
    opacity: 0;
    transform: rotate(0deg);
  }
  to {
    opacity: 1;
    transform: rotate(360deg);
  }
}
@-moz-keyframes show-scores {
  from {
    opacity: 0;
    transform: rotate(0deg);
  }
  to {
    opacity: 1;
    transform: rotate(360deg);
  }
}
@-o-keyframes show-scores {
  from {
    opacity: 0;
    transform: rotate(0deg);
  }
  to {
    opacity: 1;
    transform: rotate(360deg);
  }
}
@keyframes show-scores {
  from {
    opacity: 0;
    transform: rotate(0deg);
  }
  to {
    opacity: 1;
    transform: rotate(360deg);
  }
}

@-webkit-keyframes move {
  0% {
    transform: translateY(500px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px)  rotate(360deg);
    opacity: 0;
  }
}
@-moz-keyframes move {
  0% {
    transform: translateY(500px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px)  rotate(360deg);
    opacity: 0;
  }
}
@-o-keyframes move {
  0% {
    transform: translateY(500px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px)  rotate(360deg);
    opacity: 0;
  }
}
@keyframes move {
  0% {
    transform: translateY(500px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px)  rotate(360deg);
    opacity: 0;
  }
}

@-webkit-keyframes pop {
  from {
    transform: rotate(360deg);
    opacity: 0;
  }
  to {
    transform: rotate(0deg);
    top: 50%;
    left: 50%;
    opacity: 1;
  }
}
@-moz-keyframes pop {
  from {
    transform: rotate(360deg);
    opacity: 0;
  }
  to {
    transform: rotate(0deg);
    top: 50%;
    left: 50%;
    opacity: 1;
  }
}
@-o-keyframes pop {
  from {
    transform: rotate(360deg);
    opacity: 0;
  }
  to {
    transform: rotate(0deg);
    top: 50%;
    left: 50%;
    opacity: 1;
  }
}
@keyframes pop {
  from {
    transform: rotate(360deg);
    opacity: 0;
  }
  to {
    transform: rotate(0deg);
    top: 50%;
    left: 50%;
    opacity: 1;
  }
}

</style>
<script>

var game_score = 0;
var game_score_best = 0;
var GAME_TIMER_START = 30;
var game_timer = 0;
var game_highscores = false;
var game_over = false;
var gameCountdownTimer;
var gameSpecialTimer = 0;
var game_scores = [
  {
    name: "Grant Jenkins",
    score: 131
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  },
  {
    name: "Could be you",
    score: 0
  }
];
game_scores.sort(function(a, b) {
  return b.score - a.score;
});

// get random number between min and max value
function rand(min, max) {
  return Math.floor(Math.random() * (max + 1)) + min;
}

//add explosions when you click on a particle
function explode(x, y, bitcolor) {
  var particles = 15,
      // explosion container and its reference to be able to delete it on animation end
      explosion = $('<div class="explosion"></div>');

  //put the explosion container into the game page
  $('#game').append(explosion);

  //position the container to be centered
  explosion.css('left', x - explosion.width() / 2);
  explosion.css('top', y - explosion.height() / 2);

  for (var i = 0; i < particles; i++) {
    //random end positions for each of the particles
    var x = (explosion.width() / 2) + rand(80, 150) * Math.cos(2 * Math.PI * i / rand(particles - 10, particles + 10));
    var y = (explosion.height() / 2) + rand(80, 150) * Math.sin(2 * Math.PI * i / rand(particles - 10, particles + 10));

    //create the particle elements
    elm = $('<div class="bit bit-' + bitcolor + '" style="' +
            'top: ' + y + 'px; ' +
            'left: ' + x + 'px"></div>');

    // no need to add the listener on all generated elements
    if (i == 0) {
      //when animation ends then it will automatically remove the element
      elm.one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(e) {
        explosion.remove();
      });
    }
    //add the particle
    explosion.append(elm);
  }
}

//event triggered when the user clicks on a particle
var particleClick = function(e) {
  let particleWidth = this.offsetWidth;

  //if particle reached full width
  if(particleWidth === 150) {
    //add appropriate score/time based on type of particle
    switch($(this).data("type")) {
      case "time":
        game_score++;
        game_timer+=5;
        break;
      case "points":
        game_score+=5;
        game_timer++;
        break;
      default:
        game_score++;
        game_timer++;
    }

    //add the score to the screen
    $(".game-score").text(game_score);

    //get the color of the particle
    var arr = $(this).attr("class").split('-');
    var item = arr[arr.length-1];

    //remove the particle
    this.remove();

    //add explosions
    explode(e.pageX, e.pageY, item);

    //create a new particle in place if the existing one
    createParticle();
  }
}

//creates each particle
var createParticle = function() {
  //initiate and set properties on particle
  let particle = {
    x: Math.random() * window.innerWidth,
    y: Math.random() * window.innerHeight + 20,
    size: Math.random() * 25 + 10,
    speed: Math.random() * 6 + 3,
    delay: Math.random() * 0.3 + 0.2,
    color: Math.random() < 0.33 ? "red" : Math.random() < 0.5 ? "green" : "blue",
    data: "normal"
  };

  //increase the special timer so that we get a
  //special particle at least every 5 particles
  gameSpecialTimer = (gameSpecialTimer + 1) % 5;

  //if special particle the set properties here
  if(Math.random() < 0.1 || gameSpecialTimer === 0) {
    particle.color = "gold";
    particle.data = Math.random() < 0.3 ? "time" : "points";
  }

  //append the particle to the particle box
  $("#particle-box").append("<div class='particle particle-" +
                            particle.color + "' data-type='" + particle.data + "'></div>");

  //get the particle that was just added
  var last = $("#particle-box").children().last();

  //setup the click event for the particle
  last.on( "click", particleClick );

  //add appropriate css properties including css animation
  last.css(
    "animation",
    "move " + particle.speed + "s infinite linear " + particle.delay + "s");
  last.css(
    "left",
    particle.x);
  last.css(
    "top",
    particle.y);
  last.css(
    "width",
    particle.size);
  last.css(
    "height",
    particle.size);
}

//setup the initial particles for each game
var setupParticles = function() {
  //remove any existing particles
  $("#particle-box").empty();

  //create an initial set of 40 particles
  for(var i = 0; i < 40; i++) {
    createParticle();
  }
}

//reset the game
var resetGame = function() {
  //reset game timer   
  game_timer = 0;

  //set game over to true
  game_over = true;

  //reset special timer
  gameSpecialTimer = 0;

  //clear the existing interval if it exists
  clearInterval(gameCountdownTimer);

  //remove any existing explosions
  $(".explosion").empty();

  //remove all particles
  $("#particle-box").empty();

  //show/hide appropriate components
  $("#gameStartButton").show();
  $("#gameComponents").hide();
  $("#gameOver").hide();
}

//starts the game
var startGame = function() {
  //reset score
  game_score = 0;

  //set game over to false
  game_over = false;

  //reset game score
  $(".game-score").text(game_score);

  //reset timer
  game_timer = GAME_TIMER_START;

  //hide/show components
  $("#gameStartButton").hide();
  $("#gameOver").hide();
  $("#gameComponents").show();

  //setup particles
  setupParticles();

  //display initial timer
  $("#gameTimer").text(game_timer + " seconds remaining");

  //setup interval to control the timing of the game
  gameCountdownTimer = setInterval(function(){
    //if game over...
    if(game_timer <= 0){
      //clear the interval (remove it)
      clearInterval(gameCountdownTimer);

      if(!game_over) {
        //set best score to be the max score
        game_score_best = Math.max(game_score_best, game_score);

        //display the scores
        $("#gameScore").text("Score: " + game_score);
        $("#gameScoreBest").text("Best Score: " + game_score_best);

        //display the game over box
        $("#gameOver").show();

        //remove the particles
        $("#particle-box").empty();

        //hide the start button and game components
        $("#gameStartButton").hide();
        $("#gameComponents").hide();
      }
    }
    //else if game still in progress
    else {
      $("#gameTimer").text(game_timer + " seconds remaining");
    }
    //decrease the timer by 1 each second
    game_timer -= 1;
  },
                                   1000); //interval set to 1 second
}

setupScores = function() {
  var scoresTable = '<table cellspacing="0" class="table-scores">' +
      '<thead>' +
      '<tr>' +
      '<th class="scores-header-name">Name</th>' +
      '<th class="scores-header-score">Score</th>' +
      '</tr>' +
      '</thead>' +
      '<tbody>';

  for(var i = 0; i < game_scores.length; i++) {
    let score = game_scores[i];

    scoresTable += '<tr>' +
      '<td class="scores-name">' + score.name + '</td>' +
      '<td class="scores-score">' + score.score + '</td>' +
      '</tr>';
  }

  scoresTable += '</tbody></table>';

  $("#scoresTable").empty();
  $("#scoresTable").append(scoresTable);
}

$(".page").css({display: "none"});
$("#home").css({display: "block"});
var switchPage = function (page){
  $(".page").css({display: "none"});
  $(page).css({display: "block",});

  $(".page").removeClass('showPage');
  $(page).addClass('showPage');

  $('button').removeClass('active');
  $(page+"Button").addClass('active');

  //reset game
  if(page === "#game") {
    resetGame();
  }
  //build highscores (only once)
  else if(page === "#scores" && !game_highscores) {
    setupScores();
  }
};
//switch to the home page when first get to the site
switchPage("#home");

</script>

<!--
  Particles (Game)
  Grant Jenkins, March 2023
  #cpc-random-button, #codepenchallenge

  - All animations using CSS animations
  - All particles are divs with translations
  - Wolves are pure HTML/CSS (style/animations)
  - CSS caters for all major browsers (webkit, moz, o)

  Check out my Khan Academy projects here:
  https://www.khanacademy.org/profile/gra … s/projects
 
  Find me in the Microsoft Power Automate forums here:
  https://powerusers.microsoft.com/t5/use … r-id/76589

    -----------------------------------------------------
    If you want to submit your score, let me know :)
    -----------------------------------------------------
-->

<div id="box34">
<html>
    <head>
        <meta charset="utf-8">
        <title>Particles (Game)</title>
        <link
        href="https://fonts.googleapis.com/css?family=Indie+Flower|Material+Icons|Handlee&display=swap"
        rel="stylesheet">
       
    </head>
    <body>
        <header>
            <nav>
                <button id="homeButton" onClick="switchPage('#home');" class="active material-icons">house</button>
                <button id="howButton" onClick="switchPage('#how');">How To Play</button>
                <button id="scoresButton" onClick="switchPage('#scores');">High Scores</button>
                <button id="gameButton" onClick="switchPage('#game');">Play</button>
            </nav>
        </header> <!--Navigation-->
        <div id="content">
            <div id="home" class="page"> <!--Home Page-->
                <div class="wolves">
                    <div class="wolf top-left">
                        <div class="wolf-ear-left"></div>
                        <div class="wolf-ear-right"></div>
                        <div class="wolf-head"></div>
                        <div class="wolf-eye-left"></div>
                        <div class="wolf-eye-right"></div>
                        <div class="wolf-eyeball-left"></div>
                        <div class="wolf-eyeball-right"></div>
                        <div class="wolf-nose"></div>
                    </div>
                    <div class="wolf top-right">
                        <div class="wolf-ear-left"></div>
                        <div class="wolf-ear-right"></div>
                        <div class="wolf-head"></div>
                        <div class="wolf-eye-left"></div>
                        <div class="wolf-eye-right"></div>
                        <div class="wolf-eyeball-left"></div>
                        <div class="wolf-eyeball-right"></div>
                        <div class="wolf-nose"></div>
                    </div>
                </div> <!--Wolves-->
           
                <h1 id="header">Particles</h1>
                <div id="box">
                    <p id="creator">A game by Grant Jenkins</p>
                    <p id="welcome">Welcome to Particles, a game of speed and accuracy.</p>
                    <div id="circles">
                        <button id="homeHowButton" class="home-buttons" onClick="switchPage('#how');">How</button>
                        <button id="homePlayButton" class="home-buttons" onClick="switchPage('#game');">Play</button>
                    </div>
                </div>
               
            </div> <!--home-->
            <div id="how" class="page"> <!--How page-->
                <h1>How</h1>
                <article>
                    <p class="line line-1">You need to hover over the particles as they move up the screen.</p>
                    <p class="line line-2">When a particle reaches full size you need to click on it.</p>
                    <p class="line line-3">Clicking on a particle will award you one point and add one second to your time.</p>
                    <p class="line line-4">There are special gold particles that award you even more points/time.</p>
                    <p class="line line-5">Click on the Play button to get started.</p>
                    <div class="particle-gold"></div>
                </article>
                <div class="wolves">
                    <div class="wolf top-left">
                        <div class="wolf-ear-left"></div>
                        <div class="wolf-ear-right"></div>
                        <div class="wolf-head"></div>
                        <div class="wolf-eye-left"></div>
                        <div class="wolf-eye-right"></div>
                        <div class="wolf-eyeball-left"></div>
                        <div class="wolf-eyeball-right"></div>
                        <div class="wolf-nose"></div>
                    </div>
                    <div class="wolf top-right">
                        <div class="wolf-ear-left"></div>
                        <div class="wolf-ear-right"></div>
                        <div class="wolf-head"></div>
                        <div class="wolf-eye-left"></div>
                        <div class="wolf-eye-right"></div>
                        <div class="wolf-eyeball-left"></div>
                        <div class="wolf-eyeball-right"></div>
                        <div class="wolf-nose"></div>
                    </div>
                </div> <!--Wolves-->
               
            </div> <!--how-->
            <div id="scores" class="page"> <!--Scores page-->
                <h1>Scores</h1>
                <div id="scoresTable"></div>
                <div class="wolves">
                    <div class="wolf top-left">
                        <div class="wolf-ear-left"></div>
                        <div class="wolf-ear-right"></div>
                        <div class="wolf-head"></div>
                        <div class="wolf-eye-left"></div>
                        <div class="wolf-eye-right"></div>
                        <div class="wolf-eyeball-left"></div>
                        <div class="wolf-eyeball-right"></div>
                        <div class="wolf-nose"></div>
                    </div>
                    <div class="wolf top-right">
                        <div class="wolf-ear-left"></div>
                        <div class="wolf-ear-right"></div>
                        <div class="wolf-head"></div>
                        <div class="wolf-eye-left"></div>
                        <div class="wolf-eye-right"></div>
                        <div class="wolf-eyeball-left"></div>
                        <div class="wolf-eyeball-right"></div>
                        <div class="wolf-nose"></div>
                    </div>
                </div> <!--Wolves-->
               
            </div> <!--scores-->
            <div id="game" class="page"> <!--game page-->
                <div id="particle-box"></div>
                <div id="gameComponents">
                    <div id="gameTimer"></div>
                    <div class="game-score">0</div>
                </div>
                <div id="gameOver">
                    <div id="gameScore" class="game-score">0</div>
                    <div id="gameScoreBest">0</div>
                    <button id="gameReplayButton" onclick="startGame();">Replay</button>
                </div>
                <button id="gameStartButton" onclick="startGame();">Start</button>
            </div> <!--Game-->
        </div> <!--Content-->
   
        <!--jQuery library-->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    </body>
</html>
</div>
[/html]

0

110

[html]
<style>
.container{
  display:flex;
  flex-direction:column;
  gap:0.5em;
  place-items: center;
}

.container a{
  color:#000;
  text-decoration:none;
  display:block;
  position:relative;
}

.container a:after{
  width:100%;
  height:100%;
  content: '';
  position:absolute;
background-image: url("https://assets.codepen.io/2970881/highlighter.svg");
  background-repeat:no-repeat;
  left:0;
  z-index:-1;
  transform: scalex(0);
  transform-origin: 100% 50%;
  transition: transform 255ms ease-in-out;
}

.container a:hover:after{
  transform:scalex(1);
  transform-origin: 0 0;
}

.container a:nth-of-type(2):after{
  background-image: url("https://assets.codepen.io/2970881/highlighter_highlighter-blue.svg");
}
.container a:nth-of-type(3):after{
    background-image: url("https://assets.codepen.io/2970881/highlighter_highlighter-pink.svg");
}
.container a:nth-of-type(4):after{
  background-image: url("https://assets.codepen.io/2970881/highlighter_highlighter-green.svg");
}
</style>
<div class="container">
  <a href="#">Click to learn more.</a>
  <a href="#">Click to learn more.</a>
  <a href="#">Click to learn more.</a>
  <a href="#">Click to learn more.</a>
</div>

<!--
highlighter image links:
Yellow: https://assets.codepen.io/2970881/highlighter.svg
Pink: https://assets.codepen.io/2970881/highl … r-pink.svg
Blue: https://assets.codepen.io/2970881/highl … r-blue.svg
Green: https://assets.codepen.io/2970881/highl … -green.svg
-->
[/html]

0

111

[html]<svg xmlns="http://www.w3.org/2000/svg">
    <filter id="filter">
        <feTurbulence baseFrequency="0.8"/>
        <feColorMatrix values="9 0 0 0 -7
                               0 9 0 0 -6
                               0 0 9 0 -8
                               0 0 0 0 1" result="s"/>
        <feMorphology operator="dilate" radius="20 0" result="h"/>
        <feMorphology operator="dilate" radius="0 20" in="s"/>
        <feBlend in="h" mode="screen"/>
        <feColorMatrix values=".24 .77 0 0 0
                               .11 .23 .37 0 0
                               1 1 1 0 0
                               0 0 0 0 1"/>
    </filter>
    <rect width="100%" height="100%" filter="url(#filter)"/>
</svg>[/html]

0

112

[html]
<style>
#divIx {
height: 500px;
display: table-cell;
width: 200px;
  vertical-align: middle;
  text-align: center;
}

button.bite {
--bgcolor: red;
--bordercolor: #a31139;
--font-size: 30px;
--height: calc(var(--font-size) + 20px);
background-color: transparent;
color: var(--bordercolor);
position: relative;
height: var(--height);
border: none;
font-size: var(--font-size);
padding: 0px 20px;
}

button.bite:before,
button.bite:after {
content: "";
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: calc(var(--height) / 2);
background-color: var(--bgcolor);

background: rgb(172,25,109);
background: linear-gradient(270deg, var(--bgcolor) 0%, var(--bordercolor) 100%);

transform-origin: bottom left;
transition: transform 0.3s;
border: 5px solid var(--bordercolor);

}

button.bite:before {
border-bottom: none;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}

button.bite:after {
top: calc(var(--height) / 2);
transform-origin: top left;
background-color: var(--bgcolor);
border-top: none;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}

button.bite:hover:after {
transform: rotate(30deg);
}

button.bite:hover:before {
transform: rotate(-30deg);
}

button.guillotine {
  --size: 60px;
  height: calc(var(--size) * 2.66);
  width: var(--size);
  appearance: none;
  outline: none;
  background-color: transparent;
  cursor: pointer;
  position: relative;
  margin: 0px;
  display: block;
  border-left: calc(var(--size) * 0.1) solid #855E42;
  border-right: calc(var(--size) * 0.1) solid #855E42;
  border-bottom: calc(var(--size) * 0.67) solid #855E42;
  font-size: 14px;
  font-weight: 700;
  color: black;
  transition: color 0.3;
}

button.guillotine:hover {
  color: red;
 
}

button.guillotine:after {
  content: " ";
  position: absolute;
  top: 1px;
  left: 0px;
  width: 100%;
  height: calc(var(--size) * 0.83);
  background: rgb(113,121,126);
  background-color: silver;
  background-image: linear-gradient(196deg, transparent, rgba(255, 255, 255, 0.25) 25%, rgba(0, 0, 0, 0.25) 50%);
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 50%);
  transition: top 0.3s, background 0.3s;
}

button.guillotine:hover:after {
  top: calc(var(--size) * 1.7);
  background-image: linear-gradient(196deg, transparent, rgba(255, 255, 255, 0.25) 25%, rgba(0, 0, 0, 0.25), rgba(255,0,39,1) 90%);
}

button.guillotine:before {
  content: " ";
  display: block;
  position: absolute;
  top: calc(var(--size) * 2.66 * 0.6);
  left: calc(50% - (var(--size) * 0.25));
  width: calc(var(--size) * 0.5);
  height: calc(var(--size) * 0.5);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(61,35,20,1) 0%, rgba(61,35,20,1) 60%, rgba(232,190,172,1) 90%);
  z-index: 10
}

button.guillotine:hover:before {
  animation-delay: 0.2s;
  animation-name: head;
  animation-duration: 0.5s;
  animation-iteration-count: 1;
  animation-timing-function: ease-out;
  animation-direction: alternate;
  animation-fill-mode: forwards;
}

@keyframes head {
  0% {
    top: calc(var(--size) * 2.66 * 0.6);
    left: calc(50% - (var(--size) * 0.25));
  }
  20% {
    top: calc(var(--size) * 2.3);
    left: calc(50% - (var(--size) * 0.25));
    transform: rotate(0deg);
  }
  100% {
    top: calc(var(--size) * 2.3);
    left: 200%;
    transform: rotate(380deg);
  }
}

</style>
<div id="divIx">
<button class="bite">Send</button>
<br><br><br><br>
<button class="guillotine">Send</button>
</div>
[/html]

0

113

[html]
<style>
:root {
--black: #2a2927;
--white: #fff;
--bg: #fbf6e6;
--face: #fdda5f;
--face-shadow: #fd9744;
--main-width: 6.25rem;
--main-height: 6.25rem;}

@mixin center {
  display: flex;
  align-items: center;
  justify-content: center;
}
button {
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  border: 0;
  vertical-align: middle; }
 
button.face-button {
    width: var(--main-width);
    height: var(--main-height) ;
    border-radius: 50%;
    background: var(--face);
    box-shadow: inset 2px -4px 18px var(--face-shadow);
  }

.face-container {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  margin: auto;
}

.eye {top: 7px;
  position: absolute;
  height: 0.5rem;
  width: 0.5rem;
  background: black;
  border-radius: 50%;
  animation: eyeBlink 3200ms linear infinite; }
  .eye.left {
    left: 0;
  }
  .eye.right {
    left: 2rem;
  }

.mouth {
  position: absolute;
  top: 1.625rem;
  left: 0.8rem;
  width: 1rem;
  height: 0.125rem;
  background: black;
  border-radius: 0;
}

.eye, .mouth {
  box-shadow: inset 1px 2px 4px #121110;
}

.face-button:hover .mouth,
.face-button:active .mouth {
  left: 1rem;
  width: 0.5rem;
  height: 0.4rem;
  border-radius: 1rem 1rem 0.125rem 0.125rem;
}

.face-button:hover .eye,
.face-button:active .eye {
  height: 0.375rem;
  width: 0.375rem;
  box-shadow: 0 0 0 0.25rem #fff;
}

@keyframes eyeBlink {
  0%, 30%, 36%, 100% {
    transform: scale(1);
  }
  32%, 34% {
    transform: scale(1,0);
  }
}
</style>
<script>
const faceButton = document.querySelector('.face-button');
const faceContainer = document.querySelector('.face-container');
const containerCoords = document.querySelector('#container');
const mouseCoords = containerCoords.getBoundingClientRect();

faceButton.addEventListener('mousemove', function(e) {
  const mouseX = e.pageX - containerCoords.offsetLeft;
  const mouseY = e.pageY - containerCoords.offsetTop;
 
  TweenMax.to(faceButton, 0.3, {
     x: (mouseX - mouseCoords.width / 2) / mouseCoords.width * 50,
     y: (mouseY - mouseCoords.height / 2) / mouseCoords.width * 50,
     ease: Power4.easeOut
   })
});

faceButton.addEventListener('mousemove', function(e) {
  const mouseX = e.pageX - containerCoords.offsetLeft;
  const mouseY = e.pageY - containerCoords.offsetTop;
 
  TweenMax.to(faceContainer, 0.3, {
     x: (mouseX - mouseCoords.width / 2) / mouseCoords.width * 25,
     y: (mouseY - mouseCoords.height / 2) / mouseCoords.width * 25,
     ease: Power4.easeOut
   })
});

faceButton.addEventListener('mouseenter', function(e) {
  TweenMax.to(faceButton, 0.3, {
    scale: 0.975
  })
});

faceButton.addEventListener('mouseleave', function(e) {
  TweenMax.to(faceButton, 0.3, {
    x: 0,
    y: 0,
    scale: 1
  })
 
  TweenMax.to(faceContainer, 0.3, {
    x: 0,
    y: 0,
    scale: 1
  })
});
</script>

<div id="container">
  <button class="face-button">
    <span class="face-container">
      <span class="eye left"></span>
      <span class="eye right"></span>
      <span class="mouth"></span>
    </span>
  </button>
</div>

[/html]

0

114

[html]
<style>
@import "bourbon";

*, *:after, *:before {
  box-sizing: border-box;
}

body {
  @include display(flex);
  @include align-content(center);
  color: #353535;
  min-height: 100vh;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  text-align: center;
  background-color: lightgreen;
}

.container{
  padding: 60px 80px;
  background-color: white;
  box-shadow: 0 0 4px 1px #BBB;
  margin: auto;
  text-align: center;
}

.wrap{ 
  position: relative;
  width: 80px;
  height: 80px;
  margin: 20px auto 30px auto;
  &:last-child {
    margin-bottom: 0;
  }
}

.clicker{
  background-color: white;
  outline: none; 
  font-weight: 600;
  position:absolute;
  cursor: pointer;
  padding: 0;
  border: none;
  height: 64px;
  width: 64px;
  left: 8px;
  top: 8px;
  border-radius: 100px;
  z-index: 2;
}

.clicker:active{
  transform: translate(0, 1px);
  height: 63px;
  box-shadow: 0px 1px 0 0 rgb(190,190,190) inset;
}

.circle{
  position: relative;
  border-radius:40px;
  width: 80px;
  height: 80px;
  z-index: 1;
}

.circle.third{
  border-radius: 0;
}

.clicker.faster:hover + .circle, .clicker.faster:active + .circle {
  animation: rotator linear .4s infinite;
}

.clicker.fast:hover + .circle, .clicker.fast:active + .circle {
  animation: rotator linear .5s infinite;
}

.clicker:hover + .circle, .clicker:active + .circle {
  animation: rotator linear .8s infinite;
}

@keyframes rotator{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

   
.angled {
    background-image: linear-gradient(45deg,
                white 0%,
                white 30%,
                rgb(20,190,235) 30%,
                rgb(20,190,235) 70%,
                white 70%,
                white 100%);
    }

.angled.second{
      background-image: linear-gradient(
                white 0%,
                white 30%,
                rgb(250,160,120) 30%,
                rgb(250,160,120) 70%,
                white 70%,
                white 100%);
}

.angled.third{
    background-image: linear-gradient(45deg,
                white 0%,
                white 30%,
                rgb(130,230,135) 30%,
                rgb(130,230,135) 70%,
                white 70%,
                white 100%);
}
</style>

<link href='https://fonts.googleapis.com/css?family=Open+Sans:600,700' rel='stylesheet' type='text/css'>

  <div class="container">
Medium, border-radius, 45deg background
<div class="wrap">
    <button class="clicker">press</button>
    <div class="circle angled"></div>
  </div>

Fast, border-radius, vertical background
  <div class="wrap">
    <button class="clicker fast">press</button>
    <div class="circle angled second"></div>
  </div>

Faster, no border-radius, 45 deg background
<div class="wrap">
    <button class="clicker faster">press</button>
    <div class="circle angled third"></div>
  </div>
</div>

[/html]

0

115

[html]
<style>

figure {
  display: grid;
  cursor: pointer;
  border-radius: 50%;
}
figure > * {
  grid-area: 1/1;
  border-radius: 50%;
}
figure figcaption {
  color: #D5DED9;
  background: radial-gradient(50% 50%,#8C2318 50%,#0000 90%);
  display: grid;
  place-items: center;
  padding: 22%;
}
figure img {
  transform: translate(-200vmax,-200vmax);
}
figure:after {
  content:"";
  grid-area: 1/1;
  border-radius: 50%;
  --g: -moz-element(#img) no-repeat;
  --m: radial-gradient(50% 50%,#000 97%,#0000) no-repeat;
  background:
    var(--g) 100% 50%,
    var(--g) 50% 100%,
    var(--g) 0% 50%,
    var(--g) 50% 0%,
    var(--g) calc(50%*(1 + cos(45deg))) calc(50%*(1 + sin(45deg))),
    var(--g) calc(50%*(1 - cos(45deg))) calc(50%*(1 + sin(45deg))),
    var(--g) calc(50%*(1 + cos(45deg))) calc(50%*(1 - sin(45deg))),
    var(--g) calc(50%*(1 - cos(45deg))) calc(50%*(1 - sin(45deg)));
  -webkit-mask:
    var(--m) 100% 50%,
    var(--m) 50% 100%,
    var(--m) 0% 50%,
    var(--m) 50% 0%,
    var(--m) calc(50%*(1 + cos(45deg))) calc(50%*(1 + sin(45deg))),
    var(--m) calc(50%*(1 - cos(45deg))) calc(50%*(1 + sin(45deg))),
    var(--m) calc(50%*(1 + cos(45deg))) calc(50%*(1 - sin(45deg))),
    var(--m) calc(50%*(1 - cos(45deg))) calc(50%*(1 - sin(45deg)));
  -webkit-mask-size: 100% 100%;
  background-size: 100% 100%;
  transition: .5s;
}
figure:hover:after {
  background-size: 20% 20%;
  -webkit-mask-size: 20% 20%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-content: center;
  grid-auto-flow: column;
  background: #425a52;
}

figure figcaption {
  font-family: sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
}

</style>

<figure>
    <img src="https://picsum.photos/id/582/250/250" alt="A wolf" id="img">
    <figcaption>Wolf</figcaption>
</figure>

[/html]

0

116

[html]
<style>
figure {
  display: grid;
  cursor: pointer;
  border-radius: 50%;
}
figure > * {
  grid-area: 1/1;
  border-radius: 50%;
}
figure figcaption {
  color: #D5DED9;
  background: radial-gradient(50% 50%,#8C2318 50%,#0000 90%);
  display: grid;
  place-items: center;
  padding: 50px;
width: 150px;
height: 150px;
}
figure img {
  --g: radial-gradient(50% 50%,#000 97%,#0000) no-repeat;
  -webkit-mask:
    var(--g) 100% 50%,
    var(--g) 50% 100%,
    var(--g) 0% 50%,
    var(--g) 50% 0%,
    var(--g) calc(50%*(1 + cos(45deg))) calc(50%*(1 + sin(45deg))),
    var(--g) calc(50%*(1 - cos(45deg))) calc(50%*(1 + sin(45deg))),
    var(--g) calc(50%*(1 + cos(45deg))) calc(50%*(1 - sin(45deg))),
    var(--g) calc(50%*(1 - cos(45deg))) calc(50%*(1 - sin(45deg)));
  -webkit-mask-size: 100% 100%;
  transition: .4s;
}
figure:hover img {
  -webkit-mask-size: 30% 30%;
}

@supports not (opacity:sin(45deg)) {
  figure img {
  -webkit-mask:
    var(--g) 100% 50%,
    var(--g) 50% 100%,
    var(--g) 0% 50%,
    var(--g) 50% 0%,
    var(--g) 85.35% 85.35%,
    var(--g) 14.65% 85.35%,
    var(--g) 85.35% 14.65%,
    var(--g) 14.65% 14.65%;
  }
}

figure figcaption {
  font-family: sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
}
</style>
<script>

</script>

<figure>
    <img src="https://cdn.coil.com/images/4wNWOYIPTD6aRAGIXqmRTA.gif" alt="A wolf">
    <figcaption>Wolf</figcaption>
</figure>
<figure>
    <img src="https://thumbs.gfycat.com/EarnestUnrealisticIrishsetter-size_restricted.gif" alt="A Lioness">
    <figcaption>Lioness</figcaption>
</figure>
[/html]

0

117

[html]
<style>
small {
  margin-bottom:4px;
}

figure {
  margin:0;
  color:white;
}

.story-element {
  position: relative;
  float: left;
  overflow: hidden;
  background:#ccc;
}

.story-element:nth-child(2n) {
  margin-right: 0;
}

.story-element img {
  -webkit-transition: 500ms;
  -o-transition: 500ms;
  transition: 500ms;
}

.story-element figcaption {
  position: absolute;
  margin: auto;
  top:0; right:0; left:0; bottom:0;
  height: 40%;
  width: 80%;
  background: rgba(112,108,135, 0.8);
  -webkit-transition: 750ms;
  -o-transition: 750ms;
  transition: 750ms; 
}

.story-element[data-effeckt-type~="story-element"] figcaption {
  top: 0;
  left: 0;
  text-align: center;
  padding: 20px;
  -webkit-transform: translateX(120%);
  -ms-transform: translateX(120%);
  -o-transform: translateX(120%);
  transform: translateX(120%);
}

.story-element[data-effeckt-type~="story-element"] img {
  display: block;
  position: relative;
}

.story-element[data-effeckt-type~="story-element"]:hover figcaption,
.story-element[data-effeckt-type~="story-element"]:active figcaption {
  -webkit-transform: translateX(0);
  -ms-transform: translateX(0);
  -o-transform: translateX(0);
  transform: translateX(0);
}

.hidden-content {
  max-width:100px;
}

.story-element h1,
.story-element h2,
.story-element h3,
.story-element h4,
.story-element h5,
.story-element h6 {
margin: 0;
}

.visible-content {
  position: absolute;
  top: 0;
  left:0;
  padding: 20px ;
  margin: 20px 0 20px 20px;
  background: rgba(112,108,135, 0.8);
  -webkit-transition: 500ms;
  -o-transition: 500ms;
  transition: 500ms;
}

.story-element[data-effeckt-type~="story-element"]:hover .visible-content,
.story-element[data-effeckt-type~="story-element"]:active .visible-content {
-webkit-transform: translateX(-120%);
  -ms-transform: translateX(-120%);
  -o-transform: translateX(-120%);
  transform: translateX(-120%);
}

@media (max-width:700px) {
  .story-element {
  overflow: visible;
}
  .story-element[data-effeckt-type~="story-element"] figcaption {
  top: 0;
  left: 0;
  padding: 0;
  -webkit-transform: none;
  -ms-transform: none;
  -o-transform: none;
  transform: none;
}
  .story-element figcaption {
  position: static;
  height: inherit;
  width: 100%;
  background: rgba(112,108,135, 1);
}
  .story-element-wrap {
    padding:20px;
}
  .story-element[data-effeckt-type~="story-element"]:hover .visible-content,
.story-element[data-effeckt-type~="story-element"]:active .visible-content {
-webkit-transform: none;
  -ms-transform: none;
  -o-transform: none;
  transform: none;
}
  .visuallyhidden--palm {
    display:none;
}
}

@media (max-width:400px) {
  .visible-content {
 
  padding: 14px ;
  margin: 6px;
  background: rgba(112,108,135, 0.8);
}
}
</style>

<div class="container">
 

<figure class="story-element" data-effeckt-type="story-element">
              <img src="https://i.pinimg.com/736x/0d/a9/7e/0da97ec890dce08b8998305781257094.jpg" alt="">
                <caption>
                  <span class="visible-content">            <h3><em>Первый блок</em></h3>
                    <small>малые буквы</small>
                    <br />
                    <small class="visuallyhidden--palm">Read More ></small>
                   
                  </span>
                </caption>
              <figcaption>
                <div class="story-element-wrap">
                 
                  <span class="hidden-content">
                    <h2>Где то в горах</h2>
                  <p>Текст который катается туда сюда уууувиииии!!!!</p>
                  </span>
                 
                </div>
              </figcaption>
            </figure>
  </div>

[/html]

0

118

[html]
<style>
h5 {
  opacity: 0.66;
  font-weight: normal;
  font-size: 1.25rem;
}

.container {
  position: relative;
  width: 430px;
  height: 350px;
  margin: 50px auto;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

.time {
  padding: 10px;
  display: flex;
  justify-content: space-around;
}

.time-item {
  flex: 1 1 auto;
  border-radius: 5px;
  margin-right: 5px;
  height: 10px;
  background-color: rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
}

.time-item:last-child {
  margin-right: 0;
}

.time-item > div {
  position: absolute;
  width: 0%;
  height: 100%;
  background-color: rgba(255,255,255,0.5);
}

.content {
  position: absolute;
  height: 350px;
  width:430px;
  background-image: linear-gradient(-180deg, rgba(255,255,255,0.00) 0%, rgba(0,0,0,0.15) 100%);

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.texts {
  padding: 7%;
}

#back, #next {
  position: absolute;
  top: 0;
}

#back {
  left: 0;
  height: 100%;
  width: 50%;
}

#next {
  left: 50%;
  height: 100%;
  width: 50%;
}

</style>
<script>

const stories = [
  {
    title: 'Story 1',
    description: 'description 1',
    image: 'https://i.pinimg.com/736x/2e/be/62/2ebe623d6d27d70ea13731a01b4210e9.jpg',
    time: 3500
  },
  {
    title: 'Story 2',
    description: 'description 2',
    image: 'https://i.pinimg.com/736x/7c/f8/18/7cf818809ed21f9d21263b8a8417d504.jpg',
    time: 4000
  },{
    title: 'Story 3',
    description: 'description 3',
    image: 'https://i.pinimg.com/736x/b7/7b/e1/b77be1a020e21187490bb65859d2832c.jpg',
    time: 2500
  },
  {
    title: 'Story 4',
    description: 'description 4',
    image: 'https://i.pinimg.com/736x/8d/77/5e/8d775e040b58466a44518ad6b5c2a678.jpg',
    time: 7500
  }
]

const container = document.querySelector('.container')
const nextButton = document.querySelector('#next')
const backButton = document.querySelector('#back')

function Storyfier(storiesArray, rootEl) {
  this.stories = storiesArray
  this.root = rootEl
  this.times = rootEl.querySelector('#times')
  this.currentTime = 0
  this.currentIndex = 0

  // create breakpoints for when the slides should change
  this.intervals = this.stories.map((story, index) => {
    // TODO change so that it just uses the previous value + current time
    let sum = 0
    for (let i = 0; i < index; i++){
      sum += this.stories[i].time
    }
    return sum
  })

  // necessary to make sure the last slide plays to completion
  this.maxTime = this.intervals[this.intervals.length - 1] + this.stories[this.stories.length - 1].time

  // render progress bars
  this.progressBars = this.stories.map(() => {
    const el = document.createElement('div')
    el.classList.add('time-item')
    el.innerHTML = '<div style="width: 0%"></div>'
    return el
  })

  this.progressBars.forEach((el) => {
    this.times.appendChild(el)
  })

  // methods
  this.render = () => {
    const story = this.stories[this.currentIndex]
    this.root.style.background = `url('${story.image}')`
    this.root.querySelector('#title').innerHTML = story.title
    this.root.querySelector('#description').innerHTML = story.description
  }

  this.updateProgress = () => {
    this.progressBars.map((bar, index) => {
      // Fill already passed bars
      if (this.currentIndex > index) {
        bar.querySelector('div').style.width = '100%'
        return
      }

      if (this.currentIndex < index) {
        bar.querySelector('div').style.width = '0%'
        return
      }

      // update progress of current bar
      if (this.currentIndex == index) {
        const timeStart = this.intervals[this.currentIndex]

        let timeEnd;
        if (this.currentIndex == this.stories.length - 1){
          timeEnd = this.maxTime
        } else {
          timeEnd = this.intervals[this.currentIndex + 1]
        }

        const animatable = bar.querySelector('div')
        animatable.style.width = `${((this.currentTime - timeStart)/(timeEnd - timeStart))*100}%`

      }
    })
  }
}

Storyfier.prototype.start = function(){
  // Render initial state
  this.render()

  // START INTERVAL
  const test = setInterval(() => {
    this.currentTime += 10
    this.updateProgress()

    if (this.currentIndex >= this.stories.length - 1 && (this.currentTime > this.maxTime)){
      clearInterval(test)
      return
    }

    const lastIndex = this.currentIndex
    if (this.currentTime >= this.intervals[this.currentIndex + 1]){
      this.currentIndex += 1
    }

    if (this.currentIndex != lastIndex) {
      this.render()
    }
  }, 10)
}

Storyfier.prototype.next = function(){
  const next = this.currentIndex + 1
  if (next > this.stories.length - 1){
    return
  }

  this.currentIndex = next
  this.currentTime = this.intervals[this.currentIndex]
  this.render()
}

Storyfier.prototype.back = function(){
  if ((this.currentTime > (this.intervals[this.currentIndex] + 350)) || this.currentIndex === 0){
    this.currentTime = this.intervals[this.currentIndex]
    return
  }

  this.currentIndex -= 1
  this.currentTime = this.intervals[this.currentIndex]
  this.render()
}

const setup = async () => {
  const loadImages = stories.map(({ image }) => {
    return new Promise((resolve, reject) => {
      let img = new Image()
      img.onload = () => {
        resolve(image)
      }
      img.src = image
    })
  })

  await Promise.all(loadImages)

  const s = new Storyfier(stories, container);
  s.start()

  nextButton.addEventListener('click', () => {
    s.next()
  })

  backButton.addEventListener('click', () => {
    s.back()
  })
}

setup()

</script>
<div class="container">
  <div id="times" class="time">
  </div>

  <div class="content">
    <div class="texts">
      <h1 id="title"></h1>
      <h5 id="description"></h5>
    </div>
  </div>

  <div id="back"></div>
  <div id="next"></div>
</div>
[/html]

0

119

[html]
<style>
.options {
display: flex;
gap: 10px;
flex-wrap: wrap;
}

canvas {
position: absolute;
top: 0;
left: 0;
z-index: -1;
}

</style>
<script>
const canvas = document.getElementById("particles");
const ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

const particlesArray = [];

class Particle {
constructor() {
    this.x = Math.random() * canvas.width;
    this.y = Math.random() * canvas.height;
    this.size = Math.random() * 5 + 1;
    this.speedX = Math.random() * 3 - 1.5;
    this.speedY = Math.random() * 3 - 1.5;
    this.color = `hsl(${Math.random() * 360}, 100%, 50%)`;
}

update() {
    this.x += this.speedX;
    this.y += this.speedY;

    if (this.size > 0.2) this.size -= 0.1;
    if (this.x < 0 || this.x > canvas.width) this.speedX *= -1;
    if (this.y < 0 || this.y > canvas.height) this.speedY *= -1;
}

draw() {
    ctx.fillStyle = this.color;
    ctx.beginPath();
    ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
    ctx.closePath();
    ctx.fill();
}
}

function handleParticles() {
for (let i = 0; i < particlesArray.length; i++) {
    particlesArray[i].update();
    particlesArray[i].draw();

    if (particlesArray[i].size <= 0.2) {
    particlesArray.splice(i, 1);
    i--;
    }
}
}

function createParticles() {
if (particlesArray.length < 100) {
    particlesArray.push(new Particle());
}
}

function animateParticles() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
handleParticles();
createParticles();
requestAnimationFrame(animateParticles);
}

animateParticles();

window.addEventListener("resize", () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
});

</script>
<div class="options" style="height:500px">

</div>

<canvas id="particles" style="height:500px"></canvas>

[/html]

0

120

[html]
<style>
@property --a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@property --o {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

img {
  --c: 22px; /* size of the border and circles */
  --g: 7px;  /* the gap*/
  --c1: #1693A7;
  --c2: #C8CF02;
  --c3: #E6781E;
  --c4: #CC0C39;
 
  padding: calc(var(--c) + var(--g));
  border-radius: 50%;
  cursor: pointer;
  --_s: /var(--c) var(--c) no-repeat;
  background:
    calc(50%*(1 + cos(var(--a) +   0deg))) calc(50%*(1 + sin(var(--a) +   0deg)))
    var(--_s) radial-gradient(var(--c1) 71%,#0000 72%),
    calc(50%*(1 + cos(var(--a) +  90deg))) calc(50%*(1 + sin(var(--a) +  90deg)))
    var(--_s) radial-gradient(var(--c2) 71%,#0000 72%),
    calc(50%*(1 + cos(var(--a) -  90deg))) calc(50%*(1 + sin(var(--a) -  90deg)))
    var(--_s) radial-gradient(var(--c3) 71%,#0000 72%),
    calc(50%*(1 + cos(var(--a) + 180deg))) calc(50%*(1 + sin(var(--a) + 180deg)))
    var(--_s) radial-gradient(var(--c4) 71%,#0000 72%),
    conic-gradient(
      var(--c3)                 var(--a),  #0000 0 90deg,
      var(--c1) 0 calc(90deg  + var(--a)), #0000 0 180deg,
      var(--c2) 0 calc(180deg + var(--a)), #0000 0 270deg,
      var(--c4) 0 calc(270deg + var(--a)), #0000 0
    );
  -webkit-mask:
    radial-gradient(50% 50%,
      #000  calc(99% - var(--c) - var(--g)),
      #0000 calc(100% - var(--c) - var(--g)) calc(99% - var(--c)),
      rgb(0 0 0/var(--o))  calc(100% - var(--c)));
  transition: --a 0s .2s,--o .2s,transform .2s;
}
img:hover {
  --a: 90deg;
  --o: 1;
  transform: scale(1.2);
  transition: --a .5s,--o .1s,transform .5s;
}
</style>
<script>

</script>
<img src="https://picsum.photos/id/152/200/200" alt="some flowers">
[/html]

0


Вы здесь » concoction » ХТМЛ и журнал » штучки


Рейтинг форумов | Создать форум бесплатно