Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="flex flex-col h-screen max-w-5xl mx-auto px-6 py-8 mx-auto my-0 text-gray-800" x-data="teamHover()">
  <h1 class="my-2 text-4xl font-extrabold text-left">Our Team</h1>
  <p>
    Hover or focus over each card to see the person’s job title slide in
    and the colour treatment change.
  </p>
  <div class="grid grid-cols-1 gap-0 p-10 sm:grid-cols-2 md:grid-cols-3" x-ref="team">
    <template x-for="member in members" :key="member.id">
      <div class="relative flex flex-col justify-end w-full h-full overflow-hidden text-left text-white duration-200 ease-linear transform bg-top bg-no-repeat bg-cover filter" x-bind:style="`
							background-image: url('${member.picture}');
							aspect-ratio: 1/1;
							backface-visibility: hidden;`
						" :id="`profile_${member.id}`" x-spread="profile" x-bind:class="{ 'hover:-translate-y-1' : active === member.id, 'grayscale': active != member.id }">
        <div id="hero-before" class="absolute inset-0 w-full h-full transition-opacity duration-500 bg-gradient-to-t from-gray-900 to-gray-800 opacity-20 -z-1" aria-hidden="true" x-bind:attribute="{ 'hover:opacity-0' : active === member.id }"></div>
        <h2 :id="`name_${member.id}`" x-text="member.name" class="mx-4 my-4 text-xl font-extrabold leading-5 tracking-wide transition-transform duration-300 ease-linear transform translate-y-5" x-bind:class="{ '-translate-y-2': active === member.id }"></h2>
        <p :id="`role_${member.id}`" x-text="member.role" class="mx-4 my-1 antialiased font-medium transition duration-300 ease-linear delay-100 transform translate-y-7 text-md" x-bind:class="{ '-translate-y-6': active === member.id }"></p>

        <div id="hero-after" class="absolute inset-0 w-full h-full transition-opacity duration-700 opacity-5 bg-gray-50 hover:opacity-10 -z-1" aria-hidden="true"></div>
      </div>
    </template>
  </div>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                function teamHover() {
  return {
    active: 0,
    members: [
      {
        id: 1,
        name: "Leslie Alexander",
        role: "Co-Founder / CEO",
        picture:
          "https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixqx=KhFm8xbAom&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
      },
      {
        id: 2,
        name: "Michael Foster",
        role: "Co-Founder / CTO",
        picture:
          "https://images.unsplash.com/photo-1519244703995-f4e0f30006d5?ixlib=rb-1.2.1&ixqx=KhFm8xbAom&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
      },
      {
        id: 3,
        name: "Dries Vincent",
        role: "Business Relations",
        picture:
          "https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?ixlib=rb-1.2.1&ixqx=KhFm8xbAom&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
      },
      {
        id: 4,
        name: "Lindsay Walton",
        role: "Front-end Developer",
        picture:
          "https://images.unsplash.com/photo-1517841905240-472988babdf9?ixlib=rb-1.2.1&ixqx=KhFm8xbAom&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
      },
      {
        id: 5,
        name: "Courtney Henry",
        role: "Designer",
        picture:
          "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixqx=KhFm8xbAom&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
      },
      {
        id: 6,
        name: "Tom Cook",
        role: "Product Development",
        picture:
          "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixqx=KhFm8xbAom&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
      }
    ],
    profile: {
      ["@mouseenter"](event) {
        const elem = event.target;
        this.active = Array.from(this.$refs.team.children).indexOf(elem);
      },
      ["@mouseleave"](event) {
        this.active = 0;
        const elem = event.target;
      }
    }
  };
}

              
            
!
999px

Console