Pen Settings

HTML

CSS

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>Mouse hover</title>
</head>

<body>
    <div class="cursor"></div>
  
    <svg class="background" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
        <defs>
            <style>
                .a,
                .c {
                    fill: none;
                }

                .a {
                    stroke: #8c442a;
                    stroke-width: 3px;
                    opacity: 0.31;
                }

                .b {
                    stroke: none;
                }
            </style>
        </defs>
        <g transform="translate(90 81.5)">
            <line class="a" y1="603" x2="539" transform="translate(-37.5 -80.5)" />
            <g class="a" transform="translate(1715 80)">
                <circle class="b" cx="173" cy="173" r="173" />
                <circle class="c" cx="173" cy="173" r="171.5" />
            </g>
            <g class="a" transform="translate(-90 715)">
                <circle class="b" cx="295.5" cy="295.5" r="295.5" />
                <circle class="c" cx="295.5" cy="295.5" r="294" />
            </g>
        </g>
    </svg>
  
    <div class="container">
        <h1 class="title">My Projects</h1>
        <div class="project project__1">
            <div class="project__img">
                <span> Print</span>
                <img class="overlay" src="https://res.cloudinary.com/adanmacreates/image/upload/v1583626626/card_lqblrz.jpg">
            </div>
            <div class="project__dec">
                <h2 class="project__dec__title">Card</h2>
                <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
                    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor</p>
                <button class="project__dec__view">View Work</button>
            </div>
        </div>
    </div>
</body>

</html>
              
            
!

CSS

              
                $base: #401616;
$secondary: #8c442a;
$lighter: #937a70;

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Roboto:wght@400;700&family=Rubik+Mono+One&display=swap");

html,
body,
img,
div, 
body,
button
{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-size: 14px; // for codepen's window size
}

body {
  background: $base;
  color: $lighter;
  font-family: "Roboto", sans-serif;
  cursor: none;
}

img {
  width: 100%;
}

h1 {
  font-family: "Rubik Mono One", sans-serif;
  color: #937a70; // fallback
  -webkit-text-stroke: $lighter 1.5px;
  -webkit-text-fill-color: transparent;
  font-size: 4.5rem;
  margin: 10vh 2rem 0rem 2rem;
  z-index: 9;
}

h2 {
  font-family: "Montserrat", sans-serif;
  margin: 0;
  font-size: 3.5rem;
  text-transform: uppercase;
  color: #8c442a;
}

.background {
    position: fixed;
    left: -10%;
    z-index: -1;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project {
  margin: 1rem 1rem 1rem 1.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 60rem;
  > * {
    margin: 1rem;
  }
  // Image
  &__img {
    display: flex;
    position: relative;
    &::before {
      content: "";
      background-color: $secondary;
      width: 100%;
      height: 100%;
      z-index: 1;
      opacity: 0.8;
      position: absolute;
      transition: opacity 0.5s ease-in-out;
    }
    &:hover::before {
      opacity: 0.3;
      transition: opacity 0.5s ease-in-out;
    }
    .overlay {
      display: block;
      object-fit: cover;
      filter: grayscale(100%);
    }
    >span {
        position: absolute;
        font-size: 1rem;
        left: -0.7rem;
        bottom: -0.5rem;
        z-index: 9;
        color: $secondary;
        text-transform: uppercase;
        transform: rotate(-90deg);
        transform-origin: left;
        letter-spacing: 0.5rem;
        font-weight: bold;
        &::before {
            content: "";
            background-color: $secondary;
            display: inline-block;
            width: 1rem;
            height: 0.15rem;
            margin-bottom: 0.35rem;
        }
    }
  }
  // Details
  &__dec {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    > p {
      line-height: 2rem;
    }
    &__view {
        background-color: transparent;
        border: $secondary 2.5px solid;
        padding: 1rem 3rem;
        color: $secondary;
        text-transform: uppercase;
        transition: background-color 0.3s ease-in-out;
        &:hover {
            cursor: none;
            background-color: $secondary;
            color: $base;
            transition: background-color 0.3s ease-in-out;
        }
    }
  }
}

.cursor {
    width: 3rem;
    height: 3rem;
    border: 2px solid $lighter;
    border-radius: 50%;
    position: absolute;
    z-index: 8;
    transform: translate(-50%, -50%);
    transform-origin: 150% 150%;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
    transition-property: background, transform, border-color;
    &__title {
        transform: scale(1.5);
        transform-origin: 150% 150%;
        background-color: $secondary;
        border-color: $secondary;
        transition: all 0.3s ease-in-out;
        transition-property: background-color, transform, border-color;
    }
    &__image {
        transform: scale(1.5);
        transform-origin: 150% 150%;
        background: url('https://res.cloudinary.com/adanmacreates/image/upload/v1583626625/arrowImage_dtimdm.svg');
        background-position: center;
        background-size: 1.5rem;
        background-repeat: no-repeat;
        background-color: $base;
        border-color: $base;
        transition: all 0.3s ease-in-out;
        transition-property: background-color, transform, border-color;
    }
    &__link {
        transform: scale(1.5);
        transform-origin: 150% 150%;
        background-color: rgba(147, 122, 112, 0.5);
        border-color:  rgba(147, 122, 112, 0.1);
        transition: all 0.3s ease-in-out;
        transition-property: background, transform, border-color;
    }
}



@media only screen and (max-width: 650px) {
  h1 {
    font-size: 9vw;
  }

  .project {
    grid-template-columns: 1fr;
  }
}
              
            
!

JS

              
                let title = document.querySelector('.title');
let image = document.querySelector('.project__img');
let mouseCursor = document.querySelector('.cursor');
let links = document.querySelectorAll('button');

window.addEventListener('mousemove', cursor);

function cursor(e) {
    mouseCursor.style.top = e.pageY + 'px';
    mouseCursor.style.left = e.pageX + 'px';
}


title.addEventListener('mouseover', () => {
    mouseCursor.classList.add('cursor__title');
});
title.addEventListener('mouseleave', () => {
    mouseCursor.classList.remove('cursor__title');
});

image.addEventListener('mouseover', () => {
    mouseCursor.classList.add('cursor__image');
});
image.addEventListener('mouseleave', () => {
    mouseCursor.classList.remove('cursor__image');
});

links.forEach(link => {
    link.addEventListener('mouseover', () => {
        mouseCursor.classList.add('cursor__link');
    });
    link.addEventListener('mouseleave', () => {
        mouseCursor.classList.remove('cursor__link');
    });
})
              
            
!
999px

Console