Загрузка видео...

Не удалось загрузить видео

На главную

Use masks for your scrollable areas Use the CSS at-rule `property` to register stops as animatable values. The browser treats your custom property as a `percentage`, so the mask edges transition smoothly. Result: scroll lists that fade at the edges, revealing content underneath. No JavaScript needed.

49,867 просмотров • 3 месяцев назад •via X (Twitter)

Комментарии: 0

Нет доступных комментариев

Здесь появятся комментарии из оригинального поста

Похожие видео

CSS Tip! 🍬 You can create a CSS-only sticky CTA using position: sticky or scroll-driven animations 🤙 .cta { position: sticky; margin-top: 110vh; bottom: 2rem; /* 👈 Stick! */ } This is one way 👀 This first way relies on you setting a layout on the body and putting the CTA in a zero-space part of the layout body { display: grid; grid-template-columns: auto 0; } The children of the body are an element with your content and then the CTA. You could also use display:flex too. .content { flex: 1 0 100%; } .cta { place-self: end; } As you scroll the body, the CTA comes into view and sticks in position 🙌 That's one way. If you want to take it further and do something like flip between showing or not, maybe scale it up, or add some special easing, etc. an animation is another way 📜 First, change the styles for your CTA. Note the translate property that's powered by a custom property .cta { position: fixed; bottom: 2rem; right: 2rem; translate: 0 calc(20vh - (var(--show) * 20vh)); transition: translate 0.875s var(--elastic); } Next you need a custom property that you're going to animate @​property --show { inherits: true; initial-value: 0; syntax: ' '; } Lastly, you animate this value on the body. As the property value changes, the value will trickle down to the CTA @​supports (animation-timeline: scroll()) { body { animation: show-cta both steps(1); animation-timeline: scroll(root); animation-range: 0 10vh; } @​keyframes show-cta { to { --show: 1; } } } Using @​supports you can use this as a progressive enhancement. If scroll-driven animations are supported, use them. Otherwise fallback to using position: sticky 🤙 That's it! As always, any questions or requests, hit me up! 🙏 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

133,020 просмотров • 2 лет назад

SHOULD GOVERNMENT BE ALLOWED TO TAKE PRIVATE PROPERTY? “People are waking up to the fact that the asset seizure tax is an elimination of private property rights, that fundamentally what you're saying [is] that private property now becomes public property. Because as soon as you give the government the right to collect your post-tax assets through a legislative vote, you are basically saying that you no longer have private property — because at any point in the future the government can vote to say I'm going to take your private property — which is different than an income tax. [An income tax] is when you earn something that you didn't have before, and they take a percentage of your earnings (of your income). The statement now is after you've made your income (it's now your private property) — they can come and take it. And so that is a distinction that has never existed in the United States. And I will make the retort right now to property tax, because people always say to me: ‘what about property tax?’ A property tax is a service fee on a particular, specific asset. The money that is collected provides services for that asset to make it more valuable. So you get roads, infrastructure, policing, fire, schools… All the stuff that comes with property tax makes that property [more valuable]. And you have the option at any point you want to sell that property and stop paying that property tax. You have the option at any point to downgrade your property and get a cheaper property and pay [a lower tax]. And here's the other important point about property tax: it’s uniform. Uniform means that everyone pays the same percentage, the same property tax rate in a county. This asset seizure tax that's being proposed is a demographic tax — meaning that the state or the legislature defines a specific group of individuals (in this case, they're saying anyone with a net worth over a billion dollars) and then they can go and take assets from only that group. That is nonuniform taxation. It means that for the first time we're saying based on the demographics of a person meaning whatever you want to use to define that person (in this case their wealth) — you are going to be treated differently. And that is different than an income tax, because remember when you have graduated income tax rates (and you say high earners get taxed more) — what you're taxing is the earnings, not the individual. You're not looking through to the individual to determine whether or not they're wealthy. All you're doing is looking at the independent earnings amount that's coming in. And so a uniformity clause is supposed to protect people from being demographically discriminated against. And you may roll your hand and be like: ‘Oh, who cares about the billionaires? Eat the rich. That's great.’ But fundamentally, you're giving the government, the legislature, the ability to in the future take any demographic definition they want and go in and take any percentage they want of after-tax property from you. That is why this is so troubling.” david friedberg The All-In Podcast

Ron Pragides 

258,567 просмотров • 5 месяцев назад

CSS Tip! 🤙 You can use mask-composite and some JavaScript to create this pointer proximity following glow border ✨ .glow { mask-composite: intersect; mask-clip: padding-box, border-box; mask: linear-gradient(#0000, #0000), conic-gradient(#0000 0deg, #​fff, #0000 45deg); } The trick is to mask a background-image with a combination of mask layers. mask-composite: intersect; means the mask used will be the intersection of the layers 🔥 use source-in, xor; in browsers that don't support intersect; In this demo, you can use pseudoelements and rely on scoped custom properties to do a lot of the heavy lifting for you 🙌 Once you've masked the background, you need to update the starting angle of the conic-gradient on pointermove 👆 You can work that out by getting the center point of each card and then calculating the angle between that and the pointer with Math.atan2 🤓 let ANGLE = Math.atan2( event?.y - CARD_CENTER[1], event?.x - CARD_CENTER[0] ) * 180 / Math.PI ANGLE = ANGLE < 0 ? ANGLE + 360 : ANGLE; CARD.​style.setProperty('--start', ANGLE + 90) You plug that into your conic-gradient mask as a custom property accounting for --spread ⚡️ conic-gradient(from calc((var(--angle) - (var(--spread) * 0.5)) * 1deg), #000 0deg, #​fff, #0000 calc(var(--spread) * 1deg)); To get the blur, you apply a blur to the glow container on each card 🤙 .glows { filter: blur(calc(var(--blur) * 1px); } That's it! Layers of masks that are clipped and composited before being blurred 😎 The added trick is to fade each one in when the pointer is in the defined proximity of the card. For example, don't show unless within 100px of a card. You can see that in the video. Check out the JavaScript code for that 🫶 Couldn't resist making this one 😁 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

1,179,837 просмотров • 2 лет назад

CSS Tip! 📜 You can use scroll-driven animations to progressively enhance collapsing a floating call to action 🤏 .cta { animation: shrink; animation-timeline: scroll(); animation-range: 0 100px; } @​keyframes shrink { to { width: 48px; } } That's the gist of it. Use the body scroll position with animation-timeline: scroll(). Define the animation-range as when you have scrolled 100px. There's a little more though 🤓 That would "scrub" the width animation. Ideally, you want to trigger that animation. You could animate a custom property with steps() timing and use that to define the width ✨ @​property --scrub { syntax: ' '; inherits: true; initial-value: 0; } body { animation: scrub both steps(1, end); animation-timeline: scroll(); animation-range: 0 100px; } Then transition the --scrub property on the CTA and use it for the width 🤙 .cta { transition: --scrub 0.2s; width: calc(48px + (120px * (1 - (var(--scrub) / 100)))); } Other animations are a matter of preference and timing. For example, you could then make the hand wave, scale down the size, and then slide a gradient across 😉 They have the same structure and technique as the original concept. Waving the hand? 👋 Run it twice, offset the transform-origin. .hand { animation: wave both linear 2; animation-timeline: scroll(); animation-range: 30vh 50vh; transform-origin: 65% 75%; } @​keyframes wave { 50% { rotate: 20deg; } } How's it progressively enhanced? Wrap everything in a @​supports query and a @​media query. If there isn't support, users still get a good experience. It's a floating action button that's circular and already collapsed 🤙 @​supports(animation-timeline: scroll()) { @​media(prefers-reduced-motion: no-preference) {...} } Definitely have a play with the code. Amazing what we're going to be able to do with CSS alone! 🔥 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

177,781 просмотров • 2 лет назад