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 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

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

              
                #app
              
            
!

CSS

              
                html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background: #141414;
  color: var(--off-white);
  font-family: 'Aeonik', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji';
  background-image: url('https://temporal.io/StarBackgroundMuted.svg');
  background-attachment: fixed;
  overflow-x: hidden;
}

/* temporal design colors https://www.notion.so/temporalio/Color-Palette-62829d945d30440eaffd410dbbb6689f */
html {
  /* primary */
  --space-black: #141414;
  --off-white: #f2f2f2;
  /* secondary */
  --temporal-blue: #c7edef;
  --temporal-purple: #b8b4dc;
  --bright-blue: #127ae5;
  --bright-purple: #8f86da;
  --scroll-white: hsla(0, 0%, 90%, 0.5);
  /* accents */
  --green-1: #9ee587;
  --green-2: #32d67b;
  --orange-1: #ffa280;
  --orange-2: #ff7065;
}

.transform-3d {
  transform-style: preserve-3d;
}

.perspective {
  perspective: 800px;
}

.dir-control {
  width: 300px;
  height: 60px;
  transition: all 0.2s;
  border: 2px solid white;
  border-radius: 9999px;
  text-decoration: none;
  outline: transparent;
  position: relative;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-study--active {
  --tw-grayscale: grayscale(0);
  --tw-scale-x: 1;
  --tw-scale-y: 1;
}
.case-study__tabs {
  transform: translate3d(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px), 40px)
    rotateY(calc(var(--x, 0) * 1deg)) rotate(calc(var(--x, 0) * 0.25deg));
}

.dir-control {
  --buttonColor: var(--temporal-blue);
  --backdrop: var(--temporal-blue);
  --slideColor: var(--space-black);
  --bg: var(--temporal-blue);
  --borderWidth: 2;
  --textColor: var(--space-black);
  border-color: var(--buttonColor, var(--bg));
  color: var(--textColor, var(--buttonColor));
  background: var(--backdrop);
  transform: translate(0, calc(var(--y, 0) * 1%)) scale(var(--scale, 1));
}

.text-temporalblue {
  color: var(--temporal-blue);
}

.dir-control:hover {
  --y: -5;
  --scale: 1.05;
}

.dir-control:active {
  --y: 0;
  --scale: 0.95;
}

.dir-control span {
  clip-path: var(--clip);
  bottom: calc(var(--borderWidth) * -1px);
  left: calc(var(--borderWidth) * -1px);
  right: calc(var(--borderWidth) * -1px);
  top: calc(var(--borderWidth) * -1px);
}

.dir-control span:nth-of-type(1):hover,
.dir-control span:nth-of-type(2):hover,
.dir-control span:nth-of-type(3):hover,
.dir-control span:nth-of-type(4):hover {
  --clip: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  z-index: 2;
}

.dir-control span:nth-of-type(1):hover ~ b:nth-of-type(1),
.dir-control span:nth-of-type(2):hover ~ b:nth-of-type(2),
.dir-control span:nth-of-type(3):hover ~ b:nth-of-type(3),
.dir-control span:nth-of-type(4):hover ~ b:nth-of-type(4) {
  --clip: inset(0 0 0 0);
}

.dir-control span:nth-of-type(1) {
  --clip: polygon(0 0, 100% 0, 50% 50%, 50% 50%);
}
.dir-control span:nth-of-type(2) {
  --clip: polygon(100% 0, 100% 100%, 50% 50%);
}
.dir-control span:nth-of-type(3) {
  --clip: polygon(0 100%, 100% 100%, 50% 50%);
}
.dir-control span:nth-of-type(4) {
  --clip: polygon(0 0, 0 100%, 50% 50%);
}

.dir-control b {
  background: var(--slideColor, var(--buttonColor));
  border-color: var(--buttonColor, var(--bg));
  bottom: calc(var(--borderWidth) * -1px);
  clip-path: var(--clip);
  color: var(--bg, var(--off-white));
  left: calc(var(--borderWidth) * -1px);
  right: calc(var(--borderWidth) * -1px);
  top: calc(var(--borderWidth) * -1px);
}

.dir-control b:nth-of-type(1) {
  --clip: inset(0 0 100% 0);
}
.dir-control b:nth-of-type(2) {
  --clip: inset(0 0 0 100%);
}
.dir-control b:nth-of-type(3) {
  --clip: inset(100% 0 0 0);
}
.dir-control b:nth-of-type(4) {
  --clip: inset(0 100% 0 0);
}

.dir-control--secondary {
  --bg: var(--space-black);
  --backdrop: transparent;
  --buttonColor: var(--off-white);
  --slideColor: var(--off-white);
  --textColor: var(--off-white);
}
              
            
!

JS

              
                import React, { useEffect, useRef } from 'https://cdn.skypack.dev/react'
import T from 'https://cdn.skypack.dev/prop-types'
import { render } from 'https://cdn.skypack.dev/react-dom'
import { Tab, Tabs, TabList, TabPanel } from 'https://cdn.skypack.dev/react-tabs';

const DirectionalControl = ({ as, className, children, filled, secondary, ...rest }) => {
  const that = {
    as
  };
  return (
    <that.as
      className={`dir-control ${secondary ? 'dir-control--secondary' : ''} ${
        filled ? 'dir-control--filled' : ''
      } ${className}`}
      {...rest}>
      {children}
      <span className="inline-block absolute z-1" />
      <span className="inline-block absolute z-1" />
      <span className="inline-block absolute z-1" />
      <span className="inline-block absolute z-1" />
      <b
        className="border-2 font-bold absolute transition-all rounded-full flex items-center justify-center"
        aria-hidden="true">
        {children}
      </b>
      <b
        className="border-2 font-bold absolute transition-all rounded-full flex items-center justify-center"
        aria-hidden="true">
        {children}
      </b>
      <b
        className="border-2 font-bold absolute transition-all rounded-full flex items-center justify-center"
        aria-hidden="true">
        {children}
      </b>
      <b
        className="border-2 font-bold absolute transition-all rounded-full flex items-center justify-center"
        aria-hidden="true">
        {children}
      </b>
    </that.as>
  );
};
DirectionalControl.propTypes = {
  as: T.oneOf(['button', 'a'])
};
DirectionalControl.defaultProps = {
  as: 'a'
};



const mapRange = (inputLower, inputUpper, outputLower, outputUpper) => {
  const INPUT_RANGE = inputUpper - inputLower;
  const OUTPUT_RANGE = outputUpper - outputLower;
  return (value) => outputLower + (((value - inputLower) / INPUT_RANGE) * OUTPUT_RANGE || 0);
};

const QUOTES = [
  {
    url: 'https://docs.temporal.io/blog/temporal-a-central-brain-for-box/',
    img: 'https://temporal.io/logos/photo-steven.png',
    quote: (
      <span>
        One thing that the API does really well is give you this illusion of single threaded
        execution <span className="text-temporalblue">without having to orchestrate</span> multiple
        things. It's pretty amazing.
      </span>
    ),
    name: 'Steven Cipolla',
    title: 'Senior Staff Software Engineer, Box',
    logo: 'https://temporal.io/logos/logo-Box2.png',
    logoAlt: 'Box Logo'
  },
  {
    url: 'https://docs.temporal.io/blog/how-temporal-simplified-checkr-workflows/',
    img: 'https://avatars1.githubusercontent.com/u/114386',
    quote: (
      <span>
        <span className="text-temporalblue">Developer happiness has increased</span>. Thinking about
        our problems in terms of workflows and activities has{' '}
        <span className="text-temporalblue">clarified our product</span> and now allow us to{' '}
        <span className="text-temporalblue">share workflow components</span> with different teams.
      </span>
    ),
    name: 'Ben Jacobson',
    title: 'Staff Software Engineer, Checkr',
    logo: 'https://temporal.io/logos/logo-Checkr.png',
    logoAlt: 'Checkr Logo'
  },
  {
    url: 'https://docs.temporal.io/blog/reliable-crypto-transactions-at-coinbase',
    img: 'https://pbs.twimg.com/profile_images/943640175/new_photo_400x400.jpg',
    quote: (
      <span>
        Trying to model complex SAGAS using{' '}
        <span className="text-temporalblue">a plain execution graph</span> such as Zeebe and Step
        Functions <span className="text-temporalblue">makes things unnecessarily complex</span>.
        This is where Temporal really shines.
      </span>
    ),
    name: 'Anthony Dmitriyev',
    title: 'Software Engineer, Coinbase',
    logo: 'https://temporal.io/logos/logo-Coinbase.svg',
    logoAlt: 'Coinbase Logo'
  },
  {
    url: 'https://docs.temporal.io/blog/descript-case-study',
    img: 'https://avatars.githubusercontent.com/u/2502591?v=4',
    quote: (
      <span>
        It was a game changing revelation - Temporal gave us{' '}
        <span className="text-temporalblue">the ability to test our workflows</span> with unit
        tests, basically just writing code instead of writing JSON or YAML, which are completely
        untestable.
      </span>
    ),
    name: 'Nicolas Gere',
    title: 'Software Engineer, Descript',
    logo: 'https://temporal.io/logos/logo-Descript.png',
    logoAlt: 'Descript Logo'
  }
];

const CaseStudies = () => {
  const tabsRef = useRef(null);

  // // Todo: figure out if we can make deviceorientation work on iOS
  // useEffect(() => {
  //   const update = ({ beta, gamma }) => {
  //     const newX = mapRange(-180, 180, -10, 10)(beta);
  //     const newY = mapRange(-90, 90, -10, 10)(gamma);
  //     tabsRef.current.style.setProperty('--x', newX);
  //     tabsRef.current.style.setProperty('--y', newY);
  //   };

  //   if (tabsRef.current) {
  //     if (
  //       typeof DeviceOrientationEvent !== 'undefined' &&
  //       typeof DeviceOrientationEvent.requestPermission === 'function'
  //     ) {
  //       // ios
  //       DeviceOrientationEvent.requestPermission()
  //         .then((response) => {
  //           if (response == 'granted') {
  //             window.addEventListener('deviceorientation', update);
  //           }
  //         })
  //         .catch(console.error);
  //     } else {
  //       window.addEventListener('deviceorientation', update);
  //     }
  //   }

  //   return () => {
  //     document.removeEventListener('deviceorientation', update);
  //   };
  // }, []);
  useEffect(() => {
    const update = ({ x, y }) => {
      const newX = mapRange(0, window.innerWidth, -10, 10)(x);
      const newY = mapRange(0, window.innerHeight, -10, 10)(y);
      tabsRef.current.style.setProperty('--x', newX);
      tabsRef.current.style.setProperty('--y', newY);
    };

    if (tabsRef.current) {
      document.addEventListener('pointermove', update);
    }

    return () => {
      document.removeEventListener('pointermove', update);
    };
  }, []);
  return (
    <section id="case-studies" className={`container my-16 mx-auto px-8 py-16 text-center`}>
      <Tabs className="case-study transform-3d perspective">
        <TabList className="flex gap-2 justify-center mb-12">
          {QUOTES.map((quote) => (
            <Tab
              key={quote.img}
              selectedClassName="case-study--active"
              className="transform hover:scale-125 scale-75 transition-all cursor-pointer filter grayscale p-2 grid place-items-center border-spaceblack">
              <img
                className="h-12 w-12 object-cover"
                src={quote.logo}
                aria-label={quote.logoAlt}
                alt={quote.logoAlt}
              />
            </Tab>
          ))}
        </TabList>
        <div ref={tabsRef} className="case-study__tabs transform-3d">
          {QUOTES.map((quote) => (
            <TabPanel key={quote.url} className="" selectedClassName="">
              <Quote
                url={quote.url}
                img={quote.img}
                quote={quote.quote}
                name={quote.name}
                title={quote.title}
              />
            </TabPanel>
          ))}
        </div>
        <div className="mt-12 flex justify-center">
          <DirectionalControl secondary href="https://docs.temporal.io/blog/tags/case-study">
            See Case Studies
          </DirectionalControl>
        </div>
      </Tabs>
    </section>
  );
};

const Quote = ({ quote, name, title }) => (
  <div className="">
    <blockquote className="mb-8 relative mx-auto text-xl leading-xl sm:text-4xl sm:leading-48 lg:w-800 flex-1 text-white">
      <svg
        viewBox="0 0 512 512"
        className="absolute w-24 h-24 fill-current text-temporalblue opacity-30 -z-1 transform -translate-x-1/3 -translate-y-1/3 case-study__quote"
        title="quote-left">
        <path d="M464 256h-80v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8c-88.4 0-160 71.6-160 160v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48zm-288 0H96v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8C71.6 32 0 103.6 0 192v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" />
      </svg>
      {quote}
    </blockquote>
    <div className="flex items-center justify-center mb-12">
      <div className="flex flex-col text-white text-center">
        <span className="font-bold text-lg uppercase">{name}</span>
        <span className="font-light">{title}</span>
      </div>
    </div>
  </div>
);


render(<CaseStudies/>, document.querySelector('#app'))
              
            
!
999px

Console