Pen Settings



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


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.


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.


                <div id="root"></div>


                .app {
  background-color: rgb(250, 238, 224);
  overflow: hidden;

.section1 {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffff33;

.section {
  position: relative;
  display: flex;
  background-color: #121212;
  color: #ffffff;
  height: 100vh;
  width: 150vh;
  justify-content: space-between;

.textWrapper {
  display: flex;
  align-items: center;
  flex-direction: column;
  z-index: 1;
  height: 100%;
  width: 51%;
  padding: 20vh 6.44vh 0 13.44vh;

.title {
  font: 600 8vh/98.49% "New York Extra Large", serif;
  letter-spacing: -0.06em;
  white-space: pre-wrap;
  margin-bottom: 6.3vh;

.text {
  color: #dddddd;
  font: 500 2.35vh/150% "Neue Haas Grotesk Display Pro", Arial, Helvetica,
  text-align: justify;
  white-space: pre-wrap;

.imageWrapper {
  position: relative;
  height: 100%;
  width: fit-content;
  display: flex;
  justify-content: flex-end;
  padding: 20vh 13.33vh 0 0;

.image {
  width: auto;
  clip-path: inset(0% 100% 0% 0%);
  height: 71.6vh;



                import * as gsap from "[email protected]";
import * as React from "[email protected]";
import * as ReactDOM from "[email protected]";

// Dummy component of width 100vw to mirror app version where there's such component with actual content and with this same width
const SectionOne = () => {
  return <section id="section-one" data-scroll-section className="section1">empty test div!</section>;

// The component with the element I want to animate with scroll trigger
const SectionThree = () => {
  // React.useEffect(() => {
  //   gsap.gsap.registerPlugin(ScrollTrigger);
  //"#img", {
  //     scrollTrigger: {
  //       horizontal: true,
  //       scroller: "#scroll",
  //       trigger: "#img",
  //       start: "left center",
  //       end: "left left",
  //       invalidateOnRefresh: true,
  //       markers: true,
  //       toggleActions: "play reverse play reverse",
  //       onEnter: () => {
  //         console.log("Enter");
  //       }
  //     },
  //     clipPath: "inset(0% 0% 0% 0%)"
  //   });
  // }, []);

  return (
    <section data-scroll-section>
      <div className="section">
        <div className="textWrapper">
          <h2 className="title">A minmalistic approach to chair design</h2>
          <p className="text">
            Barn & Bed  is a chair without any unnecessary details or materials:
            it features a seat in molded polyurethane with a simple steel
            structure. This flexible, stackable chair can be used both indoors
            and outdoors, and has the potential to establish a new way of
            defining furniture for public spaces.
        <div className="imageWrapper">

function App() {
  const scrollRef = React.useRef(null);
  React.useEffect(() => {
    if (scrollRef.current) {
      const scroll = new LocomotiveScroll({
        smooth: true,
        el: scrollRef.current,
        direction: "horizontal",
        gestureDirection: "both",
        tablet: {
          smooth: true
        smartphone: {
          smooth: true
  }, []);

  return (
    <div ref={scrollRef} id="scroll" className="app" data-scroll-container>
      <SectionOne />
      <SectionThree />

ReactDOM.render(<App />, document.getElementById("root"));