#loader html css
Explore tagged Tumblr posts
divinector · 1 year ago
Text
Tumblr media
Loading CSS Animation
1 note · View note
codingflicks · 1 year ago
Text
Tumblr media
How to Make a Simple CSS Loader Spinner
0 notes
codenewbies · 2 years ago
Text
Tumblr media
CSS Glowing Gradient Loader
1 note · View note
techwrath · 26 days ago
Text
1 note · View note
newcodesociety · 1 year ago
Text
0 notes
snugglesquiggle · 5 days ago
Text
my neocities site used to have a bunch of javascript.
for example, i had a page that existed to load up chapters of various stories so that you could read all of the chapters in one page, sort of like ao3's view full work feature. because it was scripted dynamically, i didn't have to maintain a separate copy of the text, and it was actually more flexible than what ao3 offers, because you could read specific arcs, heck, you could read a specific sequence of chapters (e.g., 2-13 specifically)
another thing i didn't want to maintain by hand was header at the top of the page with navigational links, so i had a script that updates them on page load.
problem is, it kind of just feels bad to load a page, then see a visible delay before the header pops in.
i spent almost a year living like that, but i eventually stopped maintaining my html by hand, and learned the joys of the static site generator.
i didn't need the chapter loader anymore, either - i could code my site generator to concatenate chapters into a full-text page, and since it's static, it'd load much faster than make the user's browser stitch together the html every time they want to open that page.
slowly but surely, everything i might've used js for was getting replaced by simpler, faster, and easier means.
i don't make much use of it, but my site actually has discord-style spoiler text. blocks of text you can click to reveal (and the css is uses currentColor, so it works even on different themes)
Tumblr media Tumblr media
i don't even need javascript for this; the way i accomplish it is a bit clever:
Tumblr media
it's a checkbox! even if you hide the actual box, you can still click the label to toggle its state
this was something i implemented early, based on this blog post where a similar trick was used for a no-js dark/light mode toggle.
but i took this to a new height this year: i added fancy footnotes
Tumblr media
but under the hood, it's the same principle
Tumblr media
check box to toggle the state, then some fancy css it position it to float above the text.
but of course, if i'm doing all of this without javascript, what do i need javascript for?
and there was only one feature that stuck around. it's something that i think no one really used, but i'm attached to it.
you see, i'm notorious for writing long chapters. i could split them up, but i have particular stopping points in mind. still, i am merciful, so in my stories with consistently long chapters, i'm gone out of my way to insert break points, "subchapters" seamless into the main text.
Tumblr media
those little roman numerals would trigger a script that reformatted the page to hide all the other subchapters, and reconfiguring the next/prev buttons so that clicking them takes you to the next section rather than the next chapter
in theory, you could read Hostile Takeover as if it were a fic with 72 chapters instead of 16.
now, this is a very complex feature. you cant use checkbox tricks to emulate this, unless you want to go crazy writing a dozen css rules for every permutation of checkboxes, or force the user to figure out an arcane system where you need to uncheck one section before loading the next
but it turns out, while i wasn't paying attention, the css committee added a crazy new feature. there are :has selectors, enabling you to style elements based on the properties of elements that come below it in the document.
the whole game has changed now.
couple this with learning about :target selectors courtesy of wonder how a couple of really ambitious ao3 fics do their magic, i had everything i need
all it took to make subchapters happen now a few simple rules
Tumblr media
really, you only need that first line. it says "if main has a target element, hide all subchapters that aren't the target"
the other lines are convenience; they had the next/prev chapter buttons if you're in the middle of the chapter. there's a couple other rules (beside the subchap nav i added a button that takes you to the top of the page, which resets the anchor target), but overall, it was quick and painless. really, the actual struggle was teaching my site generator spit out the right html. (i spent five minutes tearing out my hair and rebuilding to no effect because i forgot i had two layers of caching. whoops)
this new approach does sacrifice the ability to make the arrow buttons do double duty, but i don't think it's a big loss when the subchapter buttons are right there, and arguably retaining the single function of each button is a win for usability.
the biggest loss is that there's no real way to style the buttons differently if they've been clicked, so you don't actually know which subchapter you're actually browsing.
(maybe if anyone i actually uses this feature, they can complain to me and i'll whip up a quick bit of js to patch it :v)
but until then, i'll take some satisfaction in delete my site's scripts entirely. in a way, that's the biggest loss, but it's one of i'm proud of
2 notes · View notes
gleitzman · 1 month ago
Text
Yet Another Age Verification Pop-up for Squarespace
I wanted to add an Age Gate / Age Verification pop-up for Squarespace. The top search engine result had some code, but it A) didn't work B) didn't look very good and C) didn't have any functionality for tracking cookies. Instead, use this code:
Tumblr media
First, put this into the injected code in the Header
<!-- Age Verification Pop-up HTML --> <div id="age-verification-popup"> <div class="popup-content"> <h2>ARE YOU 21+?</h2> <div class="image-circle-container" style="margin-bottom: 24px;"> <img src="https://images.squarespace-cdn.com/content/6788837817ec6330feff09fe/a0416e38-e21f-4f14-88b3-0a8c8589e435/lambi_lamb_black.png" alt="LAMBI" class="centered-image" fetchpriority="high" loading="eager" decoding="async" data-loader="raw"> </div> <div class="button-container"> <button id="verify-button-yes">YES</button> <button id="verify-button-no">NO</button> </div> <p class="disclaimer"> You must be of legal drinking age in<br> your respective country for entry.<br><br> We encourage drinking responsibly! </p> </div> </div>
Next, inject this CSS:
/* Style for Age Verification Pop-up */ #age-verification-popup { display: none; /* Initially hidden, JS will show it if needed */ position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black overlay */ z-index: 9999; font-family: Arial, sans-serif; /* Or choose a font that matches */ } .popup-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: #fff; /* White background */ padding: 40px 30px; /* Adjust padding as needed */ text-align: center; border: 1px solid #ccc; /* Optional: adds a light border */ min-width: 300px; /* Minimum width */ box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Optional subtle shadow */ } /* Optional logo styling */ /* .popup-logo { max-width: 80px; margin-bottom: 20px; } */ .popup-content h2 { font-size: 1.2em; /* Adjust size as needed */ margin-top: 0; margin-bottom: 25px; font-weight: bold; line-height: 1.4; color: #000; /* Black text */ } .button-container { margin-bottom: 25px; } #verify-button-yes, #verify-button-no { background-color: #000; /* Black background */ color: #fff; /* White text */ padding: 12px 30px; /* Adjust padding */ border: none; cursor: pointer; font-size: 1em; font-weight: bold; margin: 0 5px; /* Space between buttons */ min-width: 80px; /* Minimum width for buttons */ transition: background-color 0.2s ease; /* Smooth hover effect */ } #verify-button-yes:hover, #verify-button-no:hover { background-color: #333; /* Slightly lighter black on hover */ } .popup-content .disclaimer { font-size: 0.9em; /* Smaller font size for disclaimer */ color: #555; /* Grey text */ line-height: 1.5; } .image-circle-container { width: 70px; /* Adjust size of the circle as needed */ height: 70px; /* Must be the same as width for a perfect circle */ background-color: transparent; /* Black background */ border-radius: 50%; /* This makes the div circular */ display: flex; /* Enables flexbox for easy centering */ justify-content: center; /* Centers content (image) horizontally */ align-items: center; /* Centers content (image) vertically */ overflow: hidden; /* Ensures image doesn't spill outside the circle if it's too big */ margin-left: auto; /* Centers the circle container itself horizontally */ margin-right: auto; /* Centers the circle container itself horizontally */ } .centered-image { display: block; /* Removes extra space below the image */ height: 50px; /* Your desired image height */ width: auto; /* Let width adjust automatically to maintain aspect ratio */ max-width: 90%; /* Optional: Prevents image from touching the circle edge */ max-height: 90%;/* Optional: Prevents image from touching the circle edge */ }
Finally, inject this code into the footer
<script> // JavaScript for Age Verification Pop-up with Cookies document.addEventListener("DOMContentLoaded", function () { const popup = document.getElementById("age-verification-popup"); const verifyButtonYes = document.getElementById("verify-button-yes"); const verifyButtonNo = document.getElementById("verify-button-no"); const cookieName = "ageVerified"; // Name of our cookie // Function to set a cookie function setCookie(name, value, days) { let expires = ""; if (days) { const date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } // Add SameSite=Lax and Secure attributes for better security, especially if using HTTPS // For local testing (http), you might omit 'Secure' // document.cookie = name + "=" + (value || "") + expires + "; path=/; SameSite=Lax; Secure"; document.cookie = name + "=" + (value || "") + expires + "; path=/; SameSite=Lax"; // Use this line if not using HTTPS for testing } // Function to get a cookie function getCookie(name) { const nameEQ = name + "="; const ca = document.cookie.split(';'); for(let i = 0; i < ca.length; i++) { let c = ca[i]; while (c.charAt(0) === ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); } return null; } // Check if the age verification cookie exists const isVerified = getCookie(cookieName); if (!isVerified) { // If the cookie doesn't exist, show the pop-up if (popup) { popup.style.display = "block"; } } else { // If the cookie exists, keep the pop-up hidden (it's hidden by default CSS) console.log("Age already verified."); } // Event listener for the "YES" button if (verifyButtonYes) { verifyButtonYes.addEventListener("click", function () { // Set a cookie to remember verification for 365 days setCookie(cookieName, "yes", 365); // Hide the pop-up if (popup) { popup.style.display = "none"; } }); } // Event listener for the "NO" button if (verifyButtonNo) { verifyButtonNo.addEventListener("click", function () { // Redirect the user to the specified URL when they click "NO" window.location.href = "https://www.youtube.com/watch?v=s50vvwTystA"; }); } }); </script>
Enjoy!
0 notes
some-programming-pearls · 1 month ago
Video
youtube
Loaders using html and css #coding #html #css
0 notes
cssscriptcom · 2 months ago
Text
Convert HTML Elements to Skeleton Loaders with SkeletonJS
SkeletonJS is a lightweight JavaScript library that helps you create animated skeleton loaders using CSS custom properties and a built-in shimmer animation. Instead of presenting users with blank spaces or generic spinners during loading states, SkeletonJS transforms your existing HTML elements into skeleton loaders that maintain your page layout and improve perceived loading performance. How to…
0 notes
visitklaten · 1 year ago
Text
0 notes
cssmonster · 1 year ago
Text
Explore 10+ CSS Skeleton Loadings
Tumblr media
Welcome to CSS Monster! Dive into our latest compilation of HTML and CSS poster code examples sourced from premier platforms like CodePen and GitHub. In this August 2023 update, we present 7 fresh additions to spark your creativity and elevate your projects. CSS posters are an artistic means to enhance the visual appeal of your website or application. They empower you to craft vibrant and interactive posters that captivate your audience. Tailor them to harmonize seamlessly with your project's aesthetic, ensuring a unified and engaging design. Embark on an exploration of our updated CSS poster collection. Each poster is meticulously curated, offering distinct features and design elements. Whether you're an experienced developer or a novice, these posters stand as a valuable asset for your projects. Keep in mind that all the posters are not only visually captivating but also free to use and modify according to your requirements. Don't hesitate—explore the collection now and infuse a touch of creativity into your projects! Happy coding on CSS Monster! Author Chris Sev January 13, 2021 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS (SCSS) About a code LOADING CARD Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:no Dependencies:- Author Steven Lei January 9, 2021 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS About a code CSS SKELETON Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:no Dependencies:- Author Håvard Brynjulfsen June 9, 2020 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS (SCSS) About a code SKELETON LOADING USING ONLY A FEW LINES OF CSS Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:yes Dependencies:- Author Kiran A June 28, 2019 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS About a code MOVIES SKELETON LOADING Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:yes Dependencies:bootstrap.css Author Samir Munjewar November 9, 2018 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS About a code CSS SKELETON LOADER ANIMATION Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:yes Dependencies:- Author Markus Oberlehner November 4, 2018 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS (SCSS) About a code PURE CSS SKELETON LOADING ANIMATION WITH SHIMMER Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:yes Dependencies:- Author Rafael Goulart September 6, 2018 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS (Less) About a code CSS GRID CARD SKELETON SCREEN WITH CUSTOM PROPERTIES Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:yes Dependencies:- Author Alexander Kusminov February 23, 2018 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS About a code CARD SKELETON LOADER Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:no Dependencies:- Author Max Böck August 9, 2017 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS (SCSS) About a code CARD UI SKELETON SCREEN Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:no Dependencies:- Author Viktor Hundahl Strate July 22, 2017 Links Just Get The Demo Link How To Download - Article How To Download - Video Made with HTML / CSS (Sass) About a code SKELETON SCREEN GRADIENT ANIMATION Compatible browsers:Chrome, Edge, Firefox, Opera, Safari Responsive:no Dependencies:-
Frequently Asked Questions
Q: What is CSS Monster? A: CSS Monster is a curated collection of free HTML and CSS code examples, showcasing diverse elements for web development sourced from platforms like CodePen and GitHub. Q: How frequently is the collection updated? A: The collection is regularly updated with fresh additions, ensuring a dynamic range of the latest and most innovative HTML and CSS code examples. Q: Can I use the code examples in my projects? A: Absolutely! All code examples on CSS Monster are free to use and modify, empowering developers to integrate them seamlessly into their projects. Q: Are there specific categories in the collection? A: Yes, CSS Monster covers a wide array of categories, including calendars, carousels, charts, games, illustrations, and more, providing a comprehensive toolkit for web development. Q: Is there a need for attribution when using the code? A: No attribution is required. The code examples are generously shared for developers to use freely without any attribution obligations. Q: How can I stay updated on new additions? A: Stay tuned to CSS Monster's website for the latest updates, or follow our social media channels for notifications on new code examples and features. Q: Can I contribute to CSS Monster? A: Currently, the collection is curated by the CSS Monster team. However, suggestions and feedback are always welcome through our contact page.
Conclusion:
Explore, create, and innovate with CSS Monster! This curated collection serves as a go-to resource for developers, offering a rich array of free HTML and CSS code examples. Whether you're a seasoned developer or just starting out, CSS Monster provides the inspiration and tools you need to elevate your web development projects. Happy coding on CSS Monster! Read the full article
0 notes
divinector · 2 years ago
Text
Tumblr media
How to Make a Loader Animation in CSS
1 note · View note
codingflicks · 3 months ago
Text
Tumblr media
CSS Loader
3 notes · View notes
codenewbies · 4 months ago
Text
Tumblr media
Flipping Text CSS Loader
4 notes · View notes
snoozealarms · 2 years ago
Video
youtube
Pencil Loader Animation in Pure CSS || Loaders animation in HTML & CSS
0 notes
novalabs · 2 years ago
Text
How to Improve Website Loading Speed?
Tumblr media
Novalabs — The top website development company in Saudi Arabia will give the most practical advice for enhancing website loading speed optimization to improve WordPress or HTML website performance through Saudi Arabian SEO services.
Why is Website Loading Speed Important?
Website loading speed is crucial for delivering an optimal user experience, improving search engine visibility, maximizing conversions, and staying ahead in a highly competitive online environment.
In addition to giving visitors a bad experience, a slow-loading website will affect its search engine ranking. You’ll lose money and harm your reputation with slow websites. Faster website loads will help the sales and marketing processes.
What slows down the website loading speed?
A website��s speed issues are primarily caused by
Web hosting — A poorly set up web hosting server will slow down your website.
Code Density: One of the main reasons websites take so long to load is the amount of code in the CSS, HTML, and JavaScript that supports the website design.
Page Size — Mostly unoptimized images for the web.
Bad plugins — If you use a plugin that is badly coded, it may slow down your website.
External scripts — External scripts, such as advertisements and font loaders, among others, can significantly affect how well your website performs.
Five different ways you can improve the speed of your website.
1. Enable caching
When you visit a website, some of its components are saved in a cache so that the next time you do, the website can quickly access and load them faster.
You may enhance your site’s loading time for frequent users by enabling cache.
2. Remove Resource Plugins and Add-ons
Too many plugins on a website may slow down your site.
The simplest method to achieve this is to run a baseline loading speed test using
a program like SEMRush or Google Pagespeed Insights. Afterward, proceed through your list of plugins and deactivate each one at a time. Run the speed test after that with the plugin turned off.
While this may take some time, it will help you identify the plugins that are most detrimental to the speed at which your site loads. Then, you can look for a plugin that uses fewer resources or find another alternative.
3. Image Optimization
The speed at which your site loads will suffer if it has several graphics. You will force the browser to load big files if the images are larger. Reduce the size of an image so your website can load faster.
4. Keep Your Code Simple
The website will take substantially longer to load if your code is disorganized. There will be extraneous line breaks, spaces, and other elements when using a website builder, a CMS, or both to design your site.
5. Use a CDN
The user’s proximity to the server hosting your website has an impact on how quickly it loads. Your site will load more slowly the further they are from this specific location. This issue can be fixed by using a CDN.
For your users to view your website through the server that is nearest to them, a CDN distributes the files on your site throughout a network of international servers.
Conclusion:
The recommendations above ought to enhance website loading times and enhance your user experience as a whole. For the best SEO Services in Saudi Arabia, get in touch with Novalabs.
0 notes