Jump to content

Add Timeline to Section

Recommended Posts

2 hours ago, gab said:

Hello everyone,

Could you please guide me how to insert this timeline from codepen inside a section?

https://codepen.io/miss_cluna/pen/KBeQRY

 

Thank you in advance!

It requires to convert code into html and css. Then add these code in a code block on your site.

Here is my code for it

<div class="main-timeline">
    <h1 class="center">Responsive Vertical Timeline</h1>
    <ul class="timeline">
        <li class="timeline-item">
            <div class="timeline-content">
                <h3>Danish toffee marzipan chocolate</h3>
                <p>Sugar plum topping tootsie roll cheesecake gummi bears pie halvah. Gummies topping brownie marshmallow macaroon cotton candy. Marshmallow candy canes lemon drops wafer danish pastry cake dessert cupcake. Chocolate dessert chocolate cake bear claw icing toppinng.</p><button>Learn More</button>
            </div>
        </li>
        <li class="timeline-item">
            <div class="timeline-content"><img class="item-img" src="https://placeimg.com/640/200/any" />
                <h3>Danish toffee marzipan chocolate</h3>
                <p>Sugar plum topping tootsie roll cheesecake gummi bears pie halvah. Gummies topping brownie marshmallow macaroon cotton candy. Marshmallow candy canes lemon drops wafer danish pastry cake dessert cupcake. Chocolate dessert chocolate cake bear claw icing topping.</p><button>Learn More</button>
            </div>
        </li>
        <li class="timeline-item">
            <div class="timeline-content">
                <h3>Danish toffee marzipan chocolate</h3>
                <p>Sugar plum topping tootsie roll cheesecake gummi bears pie halvah. Gummies topping brownie marshmallow macaroon cotton candy. Marshmallow candy canes lemon drops wafer danish pastry cake dessert cupcake. Chocolate dessert chocolate cake bear claw icing topping.</p><button>Learn More</button>
            </div>
        </li>
    </ul>
</div>

<style>
  
@import url('https://fonts.googleapis.com/css?family=Amaranth|Source+Sans+Pro&display=swap');

 .main-timeline {
	 padding: 2em 0;
}
 .main-timeline h1 {
	 color: #61d4d7;
	 font-family: 'Amaranth', sans-serif;
	 line-height: 3em;
}
 .main-timeline h3 {
	 color: #fff;
	 font-family: 'Amaranth', sans-serif;
}
 .main-timeline p {
	 color: #fff;
	 font-family: 'Source Sans Pro', sans-serif;
	 font-size: 18px;
	 font-weight: 400;
	 line-height: 1.4em;
}
 .main-timeline .timeline {
	 position: relative;
}
 .main-timeline .timeline:before {
	 background: #f1efef;
	 content: '';
	 height: 100%;
	 left: 50%;
	 position: absolute;
	 transform: translateX(-50%);
	 width: 4px;
}
 .main-timeline .timeline .timeline-item {
	 clear: both;
	 list-style-type: none;
	 padding: 0 30px;
	 position: relative;
}
 .main-timeline .timeline .timeline-item:before {
	 background: #8ed6d6;
	 border-radius: 50%;
	 content: '';
	 height: 20px;
	 left: 50%;
	 position: absolute;
	 transform: translateX(-50%);
	 width: 20px;
}
 .main-timeline .timeline .timeline-item .timeline-content {
	 background: #8ed6d6;
	 border: 2px solid #8ed6d6;
	 padding: 1em;
	 width: 46%;
}
 .main-timeline .timeline .timeline-item .timeline-content h3, .main-timeline .timeline .timeline-item .timeline-content p, .main-timeline .timeline .timeline-item .timeline-content button {
	 margin: 20px;
}
 .main-timeline .timeline .timeline-item:nth-child(even) .timeline-content {
	 float: right;
}
 .main-timeline .timeline .timeline-item:nth-child(2):before {
	 background: #bea4ec;
}
 .main-timeline .timeline .timeline-item:nth-child(2) .timeline-content {
	 background: #bea4ec;
	 border: 2px solid #bea4ec;
}
 .main-timeline .timeline .timeline-item:nth-child(3):before {
	 background: #aec785;
}
 .main-timeline .timeline .timeline-item:nth-child(3) .timeline-content {
	 background: #aec785;
	 border: 2px solid #aec785;
}
 .main-timeline .timeline button {
	 background: #fff;
	 border: 2px solid #fff;
	 color: #656565;
	 font-weight: 500;
	 padding: 10px;
	 transition: all 0.3s;
}
 .main-timeline .timeline button:hover {
	 background: #fff;
	 border: 2px solid #656565;
}
 @media screen and (max-width: 968px) {
	 .main-timeline .timeline {
		 margin: 0 0 0 10px;
	}
	 .main-timeline .timeline:before {
		 left: 0px;
	}
	 .main-timeline .timeline .timeline-item:before {
		 left: 0;
	}
	 .main-timeline .timeline .timeline-item .timeline-content {
		 margin: 2em 0;
		 width: 100%;
	}
	 .main-timeline .timeline .timeline-item:nth-child(even) .timeline-content {
		 float: initial;
	}
}
 
</style>

I change from the 'main' class  into 'main-timeline' in order not to make any conflict of Squarespace's standard block

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

My testing on my own site

image.png.094b4857f9532d60c8689b09e08a9815.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
10 hours ago, bangank36 said:

My testing on my own site

image.png.094b4857f9532d60c8689b09e08a9815.png

Thanks a lot @bangank36 
You are awesome! 

The only problem I see is that the timeline nodes are shown offset from the vertical line to the right, and the vertical line itself is not centred between the boxes. Any idea how to fix it?

Link to comment
  • 4 weeks later...
On 3/15/2022 at 10:26 AM, gab said:

Thanks a lot @bangank36 
You are awesome! 

The only problem I see is that the timeline nodes are shown offset from the vertical line to the right, and the vertical line itself is not centred between the boxes. Any idea how to fix it?

Try adding the following code to fix the issue

.timeline {
  padding-left:0;
}

Let me know how it works

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

My testing

image.thumb.png.a134b5a8c6d069696da2b1ba947aeb5a.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
On 4/13/2022 at 1:29 AM, bangank36 said:

My testing

image.thumb.png.a134b5a8c6d069696da2b1ba947aeb5a.png

Thank you very much, it works!!! 

I use the "Raleway" font family in my website. Could you guide me please how to install the font inside the code?

 

Link to comment
On 4/18/2022 at 4:06 AM, gab said:

Thank you very much, it works!!! 

I use the "Raleway" font family in my website. Could you guide me please how to install the font inside the code?

 

Try adding this to Design > Custom CSS

.timeline * {
	font-family: Raleway !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
On 4/19/2022 at 5:56 PM, gab said:

Thank you but it doesn't work 😞

Can you share link to page where you added timeline? We can check easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.