Streaming live at 10am (PST)

Codepen Implementation

#1

Hi guys, would anyone be kind enough to assist me in implementing this code pen on my site?: https://codepen.io/nathantaylor/pen/rvMaKY

Have a base knowledge of implementing JS & external stuff into webflow, but this one is boggling me haha.

https://preview.webflow.com/preview/holbrow-portfolio-v2?utm_source=holbrow-portfolio-v2&preview=e40912e20650a08bd181dd12e6190bec

#2

Hi @elwips,

I guess you’ll need to:

  1. rebuild the entire html structure within Webflow
  2. implement the images directly within Webflow
  3. remove the background-image attribute of the SCSS (you’ve done it in Webflow already)
  4. transfrom the SCSS into regular CSS using codepen
  5. copy that CSS into the header wrapped inside <style> tags
  6. copy the javascript before the end of the </body> tag

Hope that helps

#3

Thanks Anthony, that does help!

Step 1 is my struggle, I’ve now done a HTML embed directly within a container. I’m testing with this codepen I’ve forked: https://codepen.io/elwips/pen/ywQzYv

So i’m hosting the svg with gist since the svg file is too large for webflows custom html embed element. Un-sure how to target it with css & JS.

I think once I’ve got my head round this it will open a whole new world for me haha!

#4

I’m not sure you can call an svg through a script tag. The script class in your SCSS doesn’t refer to any class in your svg so the css actually does nothing here. I believe you’re trying to do too many things at the same time, try to come up with a simpler case study and build upon it. I am actually not entirely sure what it is that you want to achieve.

You can try come up with a simpler, cleaner svg… I would suggest you build your own svg in illsutrator for example, then export it into svg. Once you have it exported, you can even drag and drop the svg file into codpen (in the html module) and see its code and start clean things you don’t need etc… You could also then use a tool to minify your html like this one that I use all the time: https://www.willpeavy.com/minifier/

Again, try to start with simpler svg, understand how to implement it and rebuild the structure in webflow, then only add the custom css / javascript to your project.

Hope that helps :slight_smile:

#5

I think you’re right, I’m gonna use bodymovin to export & implement that way.

Thanks!