Back

Unveiling the Futuristic Plasma Wave Input Field

Craft an imaginative input field inspired by the mesmerizing undulations of plasma waves, blending Glassmorphism with tactile feedback.

Component Explanation

Design a Futuristic Plasma Wave Input Field

Introduction

Explore crafting a unique input field that merges futuristic aesthetics and interactivity, utilizing the latest CSS techniques for a shimmering glass effect.

HTML Structure

We'll create a simple yet visually striking input field. Begin by defining a container to perfectly center the input within the page.
        <div class="plasma-wave-container">
          <input type="text" class="plasma-wave-input" aria-label="Plasma Wave Text Input" placeholder="Type something amazing...">
        </div>
      
The aria-label ensures our input is accessible by describing its function to screen readers.

Adding Style with CSS

Let's bring the plasma wave to life with CSS. The Glassmorphism style introduces a blurred background, mimicking frosted glass while the color-changing box shadows mirror plasma movement.
        .plasma-wave-container {
          display: flex;
          justify-content: center;
          align-items: center;
          width: 100%;
          padding: 50px 0;
        }

        .plasma-wave-input {
          padding: 15px 20px;
          border: none;
          border-radius: 30px;
          font-size: 16px;
          color: #333;
          background: rgba(255, 255, 255, 0.4);
          backdrop-filter: blur(10px);
          box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
          transition: box-shadow 0.3s, transform 0.3s;
          outline: none;
        }

        .plasma-wave-input.focused {
          box-shadow: 0 0 15px rgb(63, 94, 251), 0 0 25px rgb(70, 229, 184);
          transform: translateY(-2px);
        }
      
The :focus pseudo-class provides visual feedback, letting users visually detect interaction through the varied glow and subtle translation.

JavaScript for Enhanced Interaction

Our JavaScript manages the focus and blur states, adding an engaging user experience.
        document.querySelector('.plasma-wave-input').addEventListener('focus', function() {
          this.classList.add('focused');
        });

        document.querySelector('.plasma-wave-input').addEventListener('blur', function() {
          this.classList.remove('focused');
        });
      
By dynamically adding and removing the focused class, we activate the visual transitions upon interacting with the input.

Conclusion

The Plasma Wave Input field, utilizing a state-of-the-art aesthetic, offers users a touch of modern, futuristic interface design wrapped with functionality and attention to accessibility.

Interactive elements are accessible with description, color changes for focused states, and a smooth user-friendly experience with no jarring changes, respecting those with motion restrictions.

Whole code

<div class="plasma-wave-container">
  <input type="text" class="plasma-wave-input" aria-label="Plasma Wave Text Input" placeholder="Type something amazing...">
</div>


<script>
document.querySelector('.plasma-wave-input').addEventListener('focus', function() {
  this.classList.add('focused');
});

document.querySelector('.plasma-wave-input').addEventListener('blur', function() {
  this.classList.remove('focused');
});

</script>

<style>
.plasma-wave-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 50px 0;
}
.plasma-wave-input {
  padding: 15px 20px;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  color: #333;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s, transform 0.3s;
  outline: none;
}
.plasma-wave-input.focused {
  box-shadow: 0 0 15px rgb(63, 94, 251), 0 0 25px rgb(70, 229, 184);
  transform: translateY(-2px);
}

</style>
      
Thank you for reading this article.

Comments

More inputs

Similar

See also