Shopify themes, liquid, logos, and UX
Hi all, I am trying to import these codes for a loading screen on the Dawn theme. Can anyone help me with this?
Sample code: https://codepen.io/chrisgannon/pen/WNNJqXz
Website: www.ourthirsttrap.com
Password: ilovethirsttrap
Hi @thirsttrap ,
This is Amelia from PageFly - a Landing Page Builder App,
You can try to do some steps below to embed the loading animation to your page.
Go to your Shopify admin panel.
Navigate to Online Store > Themes.
Click on Actions > Edit code next to your Dawn theme.
In the left sidebar, find and click on the Snippets folder.
Click Add a new snippet and name it loading-screen.
Copy the HTML and CSS from the CodePen example.
Paste the HTML code into the loading-screen.liquid snippet.
In the Assets folder, open the theme.css or base.css file.
Add the CSS code from the CodePen example to the bottom of the file.
In the Assets folder, click Add a new asset and create a new JavaScript file (e.g., loading-screen.js).
Copy the JavaScript code from the CodePen example and paste it into the new JavaScript file.
In the Layout folder, open theme.liquid.
Add the following line to include the loading screen snippet where you want it to appear:
{% include 'loading-screen' %}
3. Add the following line before the closing </body> tag to include the JavaScript file
<script src="{{ 'loading-screen.js' | asset_url }}"></script>
Note: When you add the Javascript from Codepen to the loading-screen.js file. You need to copy this code to the end of that file to make this work.
document.addEventListener('DOMContentLoaded', function() {
var loadingScreen = document.querySelector('.mainSVG');
window.addEventListener('load', function() {
loadingScreen.style.display = 'none';
});
});
I hope that my solution works for you.
Best regards,
Amelia | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
➜ Weekly updated Shopify tutorials on YouTube
All features are available from Free plan. Live Chat Support is available 24/7.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025