Skip to content

Windmill Energy

Generate button with windmill spinning, wind particles, energy filling, and success animation

Windmill Energy

by FreeCsStyles Dev's

AnimatedStorybook
🌐🎨⚛️💚🅰️🔥☁️
#windmill#energy#generate#wind#power#sustainable

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/windmill-energy.

<iframe src="/embed/windmill-energy" sandbox="allow-scripts" loading="lazy" title="Windmill Energy" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Windmill Energy, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.

HTML
<div class="windmill-container">
  <button class="windmill-button" onclick="generateEnergy()">
    <span class="wind-icon">🌬️</span>
    <span class="button-text">Generate</span>
    <div class="windmill"></div>
    <div class="blades"></div>
    <div class="wind-particles"></div>
    <div class="energy-fill"></div>
  </button>
</div>
CSS
.windmill-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.windmill-button {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #0e7490, #155e75);
  border: none;
  border-radius: 0.75rem;
  color: #ecfeff;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(14, 116, 144, 0.3);
}

.windmill-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 116, 144, 0.4);
}

.wind-icon {
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
}

.windmill {
  position: absolute;
  bottom: 10px;
  left: 20%;
  width: 4px;
  height: 25px;
  background: #9ca3af;
  border-radius: 2px;
  opacity: 0;
}

.windmill-button.animating .windmill {
  animation: windmill-appear 0.3s ease-out forwards;
}

@keyframes windmill-appear {
  0% { opacity: 0; transform: scaleY(0); }
  100% { opacity: 1; transform: scaleY(1); }
}

.blades {
  position: absolute;
  bottom: 35px;
  left: 18%;
  width: 20px;
  height: 20px;
  opacity: 0;
}

.windmill-button.animating .blades {
  animation: blades-spin 2s linear 0.3s infinite;
}

@keyframes blades-spin {
  0% { transform: rotate(0deg); opacity: 1; }
  100% { transform: rotate(360deg); opacity: 1; }
}

.wind-particles {
  position: absolute;
  top: 50%;
  left: 10%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  opacity: 0;
}

.windmill-button.animating .wind-particles {
  animation: wind-particles 1s ease-out 0.5s forwards;
}

@keyframes wind-particles {
  0% { opacity: 0; transform: translate(0, 0); }
  50% { opacity: 1; transform: translate(30px, -20px); }
  100% { opacity: 0; transform: translate(60px, -40px); }
}

.energy-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.6));
  opacity: 0;
}

.windmill-button.animating .energy-fill {
  animation: energy-fill 1.5s ease-in-out 1s forwards;
}

@keyframes energy-fill {
  0% { height: 0; opacity: 0; }
  100% { height: 100%; opacity: 1; }
}

.windmill-button.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.windmill-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .windmill-button.animating * {
    animation: none !important;
  }
}
Tailwind CSS
<div class="flex justify-center items-center p-8">
  <button class="relative px-8 py-4 bg-gradient-to-r from-cyan-600 to-cyan-700 text-cyan-50 font-bold rounded-xl overflow-hidden transition-all hover:-translate-y-1 hover:shadow-lg hover:shadow-cyan-600/40 active:scale-95">
    <span class="mr-2">🌬️</span>
    <span>Generate</span>
    <div class="absolute inset-0 pointer-events-none">
      <div class="absolute bottom-2 left-1/4 w-1 h-6 bg-gray-400 rounded-full animate-mill"></div>
      <div class="absolute bottom-8 left-1/4 w-5 h-5 border-2 border-white/60 rounded-full -translate-x-1/2 -translate-y-1/2 animate-spin-slow"></div>
      <div class="absolute top-1/2 left-1/4 w-1 h-1 bg-white/60 rounded-full animate-particle"></div>
      <div class="absolute bottom-0 left-0 right-0 h-0 bg-gradient-to-t from-green-500/30 to-green-500/60 animate-energy"></div>
    </div>
  </button>
</div>

<style>
@keyframes mill {
  0% { transform: scaleY(0); opacity: 0; }
  100% { transform: scaleY(1); opacity: 1; }
}
@keyframes spin-slow {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes particle {
  0% { opacity: 0; transform: translate(0, 0); }
  50% { opacity: 1; transform: translate(30px, -20px); }
  100% { opacity: 0; transform: translate(60px, -40px); }
}
@keyframes energy {
  0% { height: 0; opacity: 0; }
  100% { height: 100%; opacity: 1; }
}
.animate-mill { animation: mill 0.3s ease-out forwards; }
.animate-spin-slow { animation: spin-slow 2s linear infinite; }
.animate-particle { animation: particle 1s ease-out infinite; }
.animate-energy { animation: energy 1.5s ease-in-out forwards; }
</style>
React
import { useState, useEffect } from 'react';

function WindmillEnergyButton() {
  const [phase, setPhase] = useState('idle');
  
  const handleClick = () => {
    if (phase === 'animating') return;
    setPhase('animating');
    
    setTimeout(() => {
      setPhase('success');
      setTimeout(() => setPhase('idle'), 2000);
    }, 2500);
  };
  
  return (
    <>
      <style>{`
        .windmill-btn {
          position: relative;
          padding: 1rem 2rem;
          background: linear-gradient(135deg, #0e7490, #155e75);
          border: none;
          border-radius: 0.75rem;
          color: #ecfeff;
          font-weight: 700;
          cursor: pointer;
          overflow: hidden;
          transition: all 0.3s ease;
          box-shadow: 0 4px 15px rgba(14, 116, 144, 0.3);
        }
        .windmill-btn.animating {
          background: linear-gradient(135deg, #0891b2, #0e7490);
        }
        .windmill-btn.success {
          background: linear-gradient(135deg, #10b981, #059669);
          color: white;
        }
        .windmill-btn:hover:not(:disabled) {
          transform: translateY(-2px);
          box-shadow: 0 8px 25px rgba(14, 116, 144, 0.4);
        }
        .wind-element {
          position: absolute;
          opacity: 0;
        }
        .windmill {
          bottom: 10px;
          left: 20%;
          width: 4px;
          height: 25px;
          background: #9ca3af;
          border-radius: 2px;
          transform: scaleY(0);
        }
        .blades {
          bottom: 35px;
          left: 18%;
          width: 20px;
          height: 20px;
        }
        .wind-particles {
          top: 50%;
          left: 10%;
          width: 5px;
          height: 5px;
          background: rgba(255, 255, 255, 0.6);
          border-radius: 50%;
          transform: translate(0, 0);
        }
        .energy-fill {
          bottom: 0;
          left: 0;
          width: 100%;
          height: 0;
          background: linear-gradient(180deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.6));
        }
        @keyframes windmillAppear {
          0% { opacity: 0; transform: scaleY(0); }
          100% { opacity: 1; transform: scaleY(1); }
        }
        @keyframes bladesSpin {
          0% { transform: rotate(0deg); opacity: 1; }
          100% { transform: rotate(360deg); opacity: 1; }
        }
        @keyframes windParticles {
          0% { opacity: 0; transform: translate(0, 0); }
          50% { opacity: 1; transform: translate(30px, -20px); }
          100% { opacity: 0; transform: translate(60px, -40px); }
        }
        @keyframes energyFill {
          0% { height: 0; opacity: 0; }
          100% { height: 100%; opacity: 1; }
        }
      `}</style>
      <button
        className={`windmill-btn ${phase}`}
        onClick={handleClick}
        disabled={phase === 'animating'}
      >
        <span className="mr-2">🌬️</span>
        <span>{phase === 'success' ? 'Generated!' : 'Generate'}</span>
        {phase === 'animating' && (
          <>
            <div className="wind-element windmill" style={{ animation: 'windmillAppear 0.3s ease-out forwards' }}></div>
            <div className="wind-element blades" style={{ animation: 'bladesSpin 2s linear 0.3s infinite' }}></div>
            <div className="wind-element wind-particles" style={{ animation: 'windParticles 1s ease-out 0.5s forwards' }}></div>
            <div className="wind-element energy-fill" style={{ animation: 'energyFill 1.5s ease-in-out 1s forwards' }}></div>
          </>
        )}
      </button>
    </>
  );
}

export default WindmillEnergyButton;
Vue
<template>
  <div class="windmill-container">
    <button
      :class="['windmill-button', phase]"
      @click="handleClick"
      :disabled="phase === 'animating'"
    >
      <span class="wind-icon">🌬️</span>
      <span class="button-text">{{ phase === 'success' ? 'Generated!' : 'Generate' }}</span>
      <div v-if="phase === 'animating'" class="animation-elements">
        <div class="wind-element windmill"></div>
        <div class="wind-element blades"></div>
        <div class="wind-element wind-particles"></div>
        <div class="wind-element energy-fill"></div>
      </div>
    </button>
  </div>
</template>

<script setup>
import { ref } from 'vue';

const phase = ref('idle');

const handleClick = () => {
  if (phase.value === 'animating') return;
  phase.value = 'animating';
  
  setTimeout(() => {
    phase.value = 'success';
    setTimeout(() => {
      phase.value = 'idle';
    }, 2000);
  }, 2500);
};
</script>

<style scoped>
.windmill-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.windmill-button {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #0e7490, #155e75);
  border: none;
  border-radius: 0.75rem;
  color: #ecfeff;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(14, 116, 144, 0.3);
}

.windmill-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 116, 144, 0.4);
}

.windmill-button.animating {
  background: linear-gradient(135deg, #0891b2, #0e7490);
}

.windmill-button.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.wind-icon { margin-right: 0.5rem; }

.wind-element { position: absolute; opacity: 0; }
.windmill { bottom: 10px; left: 20%; width: 4px; height: 25px; background: #9ca3af; border-radius: 2px; transform: scaleY(0); animation: windmillAppear 0.3s ease-out forwards; }
.blades { bottom: 35px; left: 18%; width: 20px; height: 20px; animation: bladesSpin 2s linear 0.3s infinite; }
.wind-particles { top: 50%; left: 10%; width: 5px; height: 5px; background: rgba(255, 255, 255, 0.6); border-radius: 50%; animation: windParticles 1s ease-out 0.5s forwards; }
.energy-fill { bottom: 0; left: 0; width: 100%; height: 0; background: linear-gradient(180deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.6)); animation: energyFill 1.5s ease-in-out 1s forwards; }

@keyframes windmillAppear { 0% { opacity: 0; transform: scaleY(0); } 100% { opacity: 1; transform: scaleY(1); } }
@keyframes bladesSpin { 0% { transform: rotate(0deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: 1; } }
@keyframes windParticles { 0% { opacity: 0; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(30px, -20px); } 100% { opacity: 0; transform: translate(60px, -40px); } }
@keyframes energyFill { 0% { height: 0; opacity: 0; } 100% { height: 100%; opacity: 1; } }

.windmill-button:disabled { opacity: 0.7; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .windmill-button.animating .wind-element {
    animation: none !important;
  }
}
</style>
Svelte
<script>
  let phase = 'idle';
  
  function handleClick() {
    if (phase === 'animating') return;
    phase = 'animating';
    
    setTimeout(() => {
      phase = 'success';
      setTimeout(() => {
        phase = 'idle';
      }, 2000);
    }, 2500);
  }
</script>

<div class="windmill-container">
  <button class="windmill-button {phase}" on:click={handleClick} disabled={phase === 'animating'}>
    <span class="wind-icon">🌬️</span>
    <span class="button-text">{phase === 'success' ? 'Generated!' : 'Generate'}</span>
    {#if phase === 'animating'}
      <div class="wind-element windmill"></div>
      <div class="wind-element blades"></div>
      <div class="wind-element wind-particles"></div>
      <div class="wind-element energy-fill"></div>
    {/if}
  </button>
</div>

<style>
  .windmill-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
  }
  .windmill-button {
    position: relative;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #0e7490, #155e75);
    border: none;
    border-radius: 0.75rem;
    color: #ecfeff;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 116, 144, 0.3);
  }
  .windmill-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 116, 144, 0.4);
  }
  .windmill-button.animating {
    background: linear-gradient(135deg, #0891b2, #0e7490);
  }
  .windmill-button.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
  }
  .wind-icon { margin-right: 0.5rem; }
  .wind-element { position: absolute; opacity: 0; }
  .windmill { bottom: 10px; left: 20%; width: 4px; height: 25px; background: #9ca3af; border-radius: 2px; transform: scaleY(0); animation: windmillAppear 0.3s ease-out forwards; }
  .blades { bottom: 35px; left: 18%; width: 20px; height: 20px; animation: bladesSpin 2s linear 0.3s infinite; }
  .wind-particles { top: 50%; left: 10%; width: 5px; height: 5px; background: rgba(255, 255, 255, 0.6); border-radius: 50%; animation: windParticles 1s ease-out 0.5s forwards; }
  .energy-fill { bottom: 0; left: 0; width: 100%; height: 0; background: linear-gradient(180deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.6)); animation: energyFill 1.5s ease-in-out 1s forwards; }
  @keyframes windmillAppear { 0% { opacity: 0; transform: scaleY(0); } 100% { opacity: 1; transform: scaleY(1); } }
  @keyframes bladesSpin { 0% { transform: rotate(0deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: 1; } }
  @keyframes windParticles { 0% { opacity: 0; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(30px, -20px); } 100% { opacity: 0; transform: translate(60px, -40px); } }
  @keyframes energyFill { 0% { height: 0; opacity: 0; } 100% { height: 100%; opacity: 1; } }
  .windmill-button:disabled { opacity: 0.7; cursor: not-allowed; }
  @media (prefers-reduced-motion: reduce) { .windmill-button.animating .wind-element { animation: none !important; } }
</style>
Angular
import { Component } from '@angular/core';

@Component({
  selector: 'app-windmill-energy-button',
  template: `
    <div class="windmill-container">
      <button
        [class]="'windmill-button ' + phase"
        (click)="handleClick()"
        [disabled]="phase === 'animating'"
      >
        <span class="wind-icon">🌬️</span>
        <span class="button-text">{{ phase === 'success' ? 'Generated!' : 'Generate' }}</span>
        <div *ngIf="phase === 'animating'" class="animation-elements">
          <div class="wind-element windmill"></div>
          <div class="wind-element blades"></div>
          <div class="wind-element wind-particles"></div>
          <div class="wind-element energy-fill"></div>
        </div>
      </button>
    </div>
  `,
  styles: [`
    .windmill-container {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 2rem;
    }
    .windmill-button {
      position: relative;
      padding: 1rem 2rem;
      background: linear-gradient(135deg, #0e7490, #155e75);
      border: none;
      border-radius: 0.75rem;
      color: #ecfeff;
      font-weight: 700;
      cursor: pointer;
      overflow: hidden;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(14, 116, 144, 0.3);
    }
    .windmill-button:hover:not(:disabled) {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(14, 116, 144, 0.4);
    }
    .windmill-button.animating {
      background: linear-gradient(135deg, #0891b2, #0e7490);
    }
    .windmill-button.success {
      background: linear-gradient(135deg, #10b981, #059669);
      color: white;
    }
    .wind-icon { margin-right: 0.5rem; }
    .wind-element { position: absolute; opacity: 0; }
    .windmill { bottom: 10px; left: 20%; width: 4px; height: 25px; background: #9ca3af; border-radius: 2px; transform: scaleY(0); animation: windmillAppear 0.3s ease-out forwards; }
    .blades { bottom: 35px; left: 18%; width: 20px; height: 20px; animation: bladesSpin 2s linear 0.3s infinite; }
    .wind-particles { top: 50%; left: 10%; width: 5px; height: 5px; background: rgba(255, 255, 255, 0.6); border-radius: 50%; animation: windParticles 1s ease-out 0.5s forwards; }
    .energy-fill { bottom: 0; left: 0; width: 100%; height: 0; background: linear-gradient(180deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.6)); animation: energyFill 1.5s ease-in-out 1s forwards; }
    @keyframes windmillAppear { 0% { opacity: 0; transform: scaleY(0); } 100% { opacity: 1; transform: scaleY(1); } }
    @keyframes bladesSpin { 0% { transform: rotate(0deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: 1; } }
    @keyframes windParticles { 0% { opacity: 0; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(30px, -20px); } 100% { opacity: 0; transform: translate(60px, -40px); } }
    @keyframes energyFill { 0% { height: 0; opacity: 0; } 100% { height: 100%; opacity: 1; } }
    .windmill-button:disabled { opacity: 0.7; cursor: not-allowed; }
    @media (prefers-reduced-motion: reduce) { .windmill-button.animating .wind-element { animation: none !important; } }
  `]
})
export class WindmillEnergyButtonComponent {
  phase = 'idle';

  handleClick(): void {
    if (this.phase === 'animating') return;
    this.phase = 'animating';
    
    setTimeout(() => {
      this.phase = 'success';
      setTimeout(() => {
        this.phase = 'idle';
      }, 2000);
    }, 2500);
  }
}
LWC — HTML template
<template>
  <div class="windmill-container">
    <button class="windmill-button {buttonClass}" onclick={handleClick} disabled={isAnimating}>
      <span class="wind-icon">🌬️</span>
      <span class="button-text">{buttonText}</span>
      <template if:true={isAnimating}>
        <div class="wind-element windmill"></div>
        <div class="wind-element blades"></div>
        <div class="wind-element wind-particles"></div>
        <div class="wind-element energy-fill"></div>
      </template>
    </button>
  </div>
</template>
LWC — JavaScript
import { LightningElement, api } from 'lwc';

export default class WindmillEnergyButton extends LightningElement {
  @api label = 'Generate';
  phase = 'idle';
  
  get isAnimating() {
    return this.phase === 'animating';
  }
  
  get buttonText() {
    return this.phase === 'success' ? 'Generated!' : this.label;
  }
  
  get buttonClass() {
    return `windmill-button ${this.phase}`;
  }
  
  handleClick() {
    if (this.phase === 'animating') return;
    this.phase = 'animating';
    
    setTimeout(() => {
      this.phase = 'success';
      setTimeout(() => {
        this.phase = 'idle';
      }, 2000);
    }, 2500);
  }
}
LWC — CSS
.windmill-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.windmill-button {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #0e7490, #155e75);
  border: none;
  border-radius: 0.75rem;
  color: #ecfeff;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(14, 116, 144, 0.3);
}

.windmill-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 116, 144, 0.4);
}

.windmill-button.animating {
  background: linear-gradient(135deg, #0891b2, #0e7490);
}

.windmill-button.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.wind-icon { margin-right: 0.5rem; }
.wind-element { position: absolute; opacity: 0; }
.windmill { bottom: 10px; left: 20%; width: 4px; height: 25px; background: #9ca3af; border-radius: 2px; transform: scaleY(0); animation: windmillAppear 0.3s ease-out forwards; }
.blades { bottom: 35px; left: 18%; width: 20px; height: 20px; animation: bladesSpin 2s linear 0.3s infinite; }
.wind-particles { top: 50%; left: 10%; width: 5px; height: 5px; background: rgba(255, 255, 255, 0.6); border-radius: 50%; animation: windParticles 1s ease-out 0.5s forwards; }
.energy-fill { bottom: 0; left: 0; width: 100%; height: 0; background: linear-gradient(180deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.6)); animation: energyFill 1.5s ease-in-out 1s forwards; }
@keyframes windmillAppear { 0% { opacity: 0; transform: scaleY(0); } 100% { opacity: 1; transform: scaleY(1); } }
@keyframes bladesSpin { 0% { transform: rotate(0deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: 1; } }
@keyframes windParticles { 0% { opacity: 0; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(30px, -20px); } 100% { opacity: 0; transform: translate(60px, -40px); } }
@keyframes energyFill { 0% { height: 0; opacity: 0; } 100% { height: 100%; opacity: 1; } }
.windmill-button:disabled { opacity: 0.7; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .windmill-button.animating .wind-element { animation: none !important; } }
LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
  <apiVersion>59.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>

Where Windmill Energy fits

  • Generate reports
  • Create content
  • Process data
  • Energy generation

Interaction states & animations

  • Windmill Spin
  • Wind Particles
  • Energy Fill
  • Success
  • Complete

Topics

  • #windmill
  • #energy
  • #generate
  • #wind
  • #power
  • #sustainable

Accessibility notes

Animation is decorative. Button text remains readable. Respect reduced-motion preference.

Browser support

  • All modern browsers