Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ add another resource


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


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.


Save Automatically?

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.


                <!doctype html>
<html lang="en">

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="">
  <link rel="stylesheet" href="style.css">

  <nav class="menu">
    <a class="menu__item" data-img="">
      <span class="menu__item-text"><span class="menu__item-textinner">Maria Costa</span></span>
    <a class="menu__item" data-img="">
      <span class="menu__item-text"><span class="menu__item-textinner">Lana Ferrari</span></span>
    <a class="menu__item" data-img="">
      <span class="menu__item-text"><span class="menu__item-textinner">Franklin Roth</span></span>
    <a class="menu__item" data-img="img/4.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Cristie Noe</span></span>
    <a class="menu__item" data-img="img/5.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Wilma Quest</span></span>
    <a class="menu__item" data-img="img/6.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Gary Winston</span></span>
    <a class="menu__item" data-img="img/7.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Nesta Freeman</span></span>
    <a class="menu__item" data-img="img/8.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Jolanda French</span></span>
    <a class="menu__item" data-img="img/9.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Samantha Dunne</span></span>
    <a class="menu__item" data-img="img/10.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Tony Albert</span></span>
    <a class="menu__item" data-img="img/11.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Jacky Speed</span></span>
    <a class="menu__item" data-img="img/12.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Carlton Holle</span></span>
    <a class="menu__item" data-img="img/13.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Kylla Maushet</span></span>
    <a class="menu__item" data-img="img/14.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Fernando Castello</span></span>
    <a class="menu__item" data-img="img/15.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Sofie Henriette</span></span>
    <a class="menu__item" data-img="img/16.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Adelie Bisset</span></span>
    <a class="menu__item" data-img="img/17.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Takato Yang</span></span>
    <a class="menu__item" data-img="img/18.jpg">
      <span class="menu__item-text"><span class="menu__item-textinner">Hadrian Kaiser</span></span>
    <p class="credits">Images by <a href="">Andrey Yakovlev and Lili Aleeva</a>,
      licensed under <a href="">CC BY-NC-ND 4.0</a></p>
  <script src=""></script>
  <script src="script.js"></script>



                :root {
  margin: 0;
  --color-text: #111;
  --color-bg: #edeee9;
  --color-link: #000;
  --color-link-hover: #000;
  --color-menu: #000;
  --color-menu-hover: #f32015;
  color: var(--color-text);
  background-color: var(--color-bg);
  --cursor-stroke: #000;
  --cursor-fill: #000;
  --cursor-stroke-width: 1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: degular, sans-serif;

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);

.menu {
  padding: 5rem 0;

.menu__item {
  position: relative;
  display: flex;
  flex: none;
  padding-left: 25vw;
  cursor: pointer;

.menu__item-textinner {
  display: block;
  font-family: goldenbook, serif;
  font-weight: 300;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 4vw;
  color: var(--color-menu);
  padding: 1vh 0;

.hover-reveal {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  width: 220px;
  height: 320px;
  opacity: 0;

.hover-reveal__inner {
  position: relative;
  width: 100%;
  height: 100%;

.hover-reveal img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: 50% 50%;



                const layout = () => {
  let links = gsap.utils.toArray(".menu__item");
  links.forEach((link) => {
    const { img } = link.dataset;
    const reveal = document.createElement("div");
    reveal.setAttribute("class", "hover-reveal");
    const revealInner = document.createElement("div");
    revealInner.setAttribute("class", "hover-reveal__inner");
    const revealImage = document.createElement("img");
    revealImage.setAttribute("class", "hover-reveal__image");
    revealImage.setAttribute("src", img);

const hoverRevealInit = () => {
  let links = gsap.utils.toArray(".menu__item");
  links.forEach((link) => {
    link.addEventListener("mouseenter", hoverReveal);
    link.addEventListener("mouseleave", hoverReveal);

const hoverReveal = (e) => {
  const revealImage =".hover-reveal");
  if (e.type === "mouseenter") {
    let xPos = e.clientX -;
    let yPos = e.clientY -;
    console.log(xPos, yPos);
    let tl = gsap.timeline();
      { autoAlpha: 1, zIndex: 5, ease: "Power2.InOut" },
    ).to(revealImage, 0.4, { y: yPos, x: xPos }, 0);
  } else {
    let tl = gsap.timeline();, 0.8, { autoAlpha: 0, zIndex: -1, ease: "Power2.InOut" });
const init = () => {

window.addEventListener("load", function () {