Logo Grid
Client logos in a hairline grid, grey and all the same weight. A cell can link to its case study: on hover or focus the logo rolls up and the result rises in. Tiers for sponsors.
View codeA case study in one block: the result very large, its digits rolling up to the value, then the quote rising line by line, the person and a link to the full story. Played once, on scroll.
With your AI
Say it to your AI. It gets the exact code below, not its best guess, and knows where it goes.
Add the Kodza Result Quote to my page.
claude mcp add -t http kodza https://kodza.dev/api/mcp
<section class="kodza-result-quote" data-kodza-result-quote aria-label="Case study: Fjordly">
<div class="kodza-result-quote__inner">
<div class="kodza-result-quote__head">
<p class="kodza-result-quote__eyebrow">Case studies</p>
<h2 class="kodza-result-quote__title">Results, not adjectives.</h2>
</div>
<div class="kodza-result-quote__body">
<div class="kodza-result-quote__result">
<p class="kodza-result-quote__value">3.2×</p>
<p class="kodza-result-quote__label"><span class="kodza-result-quote__label-text">Demo requests, first quarter after launch</span></p>
</div>
<div class="kodza-result-quote__story">
<figure class="kodza-result-quote__figure">
<blockquote class="kodza-result-quote__quote"><p>They cut our homepage from nine sections to four and put the real load time where the slogan used to be. Demo requests more than tripled in one quarter.</p></blockquote>
<figcaption class="kodza-result-quote__who"><span class="kodza-result-quote__face" aria-hidden="true">IS</span><span class="kodza-result-quote__name">Ingrid Solberg</span><span class="kodza-result-quote__role">Head of growth, Fjordly · Bergen</span></figcaption>
</figure>
<a class="kodza-result-quote__link" href="#">Read the Fjordly case study<span class="kodza-result-quote__arrow" aria-hidden="true"><svg viewBox="0 0 16 16"><path class="kodza-result-quote__shaft" d="M2.5 8h10" pathLength="1" /><path class="kodza-result-quote__tip" d="M8.5 3.5 13 8l-4.5 4.5" /></svg></span></a>
</div>
</div>
</div>
</section>
<section class="kodza-result-quote kodza-result-quote--flip" data-kodza-result-quote aria-label="Case study: Halde">
<div class="kodza-result-quote__inner">
<div class="kodza-result-quote__body">
<div class="kodza-result-quote__result">
<p class="kodza-result-quote__value">−42%</p>
<p class="kodza-result-quote__label"><span class="kodza-result-quote__label-text">Billing tickets, six weeks in</span></p>
</div>
<div class="kodza-result-quote__story">
<figure class="kodza-result-quote__figure">
<blockquote class="kodza-result-quote__quote"><p>Half our tickets asked where the invoice was. They built one page that answers it, and the billing queue shrank by almost half in six weeks.</p></blockquote>
<figcaption class="kodza-result-quote__who"><span class="kodza-result-quote__face" aria-hidden="true">KB</span><span class="kodza-result-quote__name">Karim Benali</span><span class="kodza-result-quote__role">Support lead, Halde · Rotterdam</span></figcaption>
</figure>
<a class="kodza-result-quote__link" href="#">Read the Halde case study<span class="kodza-result-quote__arrow" aria-hidden="true"><svg viewBox="0 0 16 16"><path class="kodza-result-quote__shaft" d="M2.5 8h10" pathLength="1" /><path class="kodza-result-quote__tip" d="M8.5 3.5 13 8l-4.5 4.5" /></svg></span></a>
</div>
</div>
</div>
</section>
/* Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license */
/* Kodza — Result Quote
A case study in one block: the result very large, and beside it the sentence of the person who
got it, who they are, and the link to the full story. Played once, as it comes into view, the
result first: its digits roll up to their value and the rule under it draws itself, then the
lines of the quote rise from behind their masks, then the person and the link. --flip puts the
result on the right (on a phone it always comes first). With reduced motion it is all there.
Everything is tuned with the --kz-result-quote-* variables. */
.kodza-result-quote {
--kz-result-quote-ink: #0a0a0a;
--kz-result-quote-dim: rgba(10, 10, 10, 0.64);
--kz-result-quote-rule: rgba(10, 10, 10, 0.22); /* the line under the result */
--kz-result-quote-face: #e6e6e3;
--kz-result-quote-bg: transparent;
--kz-result-quote-width: 1200px;
--kz-result-quote-measure: 680px; /* the longest line of the quote */
--kz-result-quote-result-col: 5fr; /* the two columns, from 860px of room */
--kz-result-quote-story-col: 7fr;
--kz-result-quote-hang: 0.4em; /* the opening quote mark hangs in the margin by its width */
--kz-result-quote-pad-y: clamp(64px, 8vw, 112px);
--kz-result-quote-gutter: clamp(16px, 4vw, 40px);
--kz-result-quote-mono: var(--kz-font-mono, "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace);
--kz-result-quote-ease: cubic-bezier(0.22, 1, 0.36, 1);
container: kodza-result-quote / inline-size;
box-sizing: border-box;
width: 100%;
padding-block: var(--kz-result-quote-pad-y);
padding-left: max(var(--kz-result-quote-gutter), env(safe-area-inset-left, 0px));
padding-right: max(var(--kz-result-quote-gutter), env(safe-area-inset-right, 0px));
background: var(--kz-result-quote-bg);
color: var(--kz-result-quote-ink);
}
.kodza-result-quote__inner {
max-width: var(--kz-result-quote-width);
margin: 0 auto;
}
/* The optional heading */
.kodza-result-quote__head {
margin-bottom: clamp(40px, 5vw, 72px);
}
.kodza-result-quote__eyebrow {
margin: 0 0 18px;
font-family: var(--kz-font-label, var(--kz-result-quote-mono));
font-size: var(--kz-font-label-size, 12.5px);
font-weight: var(--kz-font-label-weight, 500);
line-height: var(--kz-font-label-leading, inherit);
letter-spacing: var(--kz-font-label-tracking, 0.02em);
text-transform: var(--kz-font-label-case, inherit);
color: var(--kz-result-quote-dim);
}
.kodza-result-quote__title {
margin: 0;
font-family: var(--kz-font-display, inherit);
font-size: calc(clamp(32px, 4.6vw, 56px) * var(--kz-font-display-scale, 1));
font-weight: var(--kz-font-display-weight, 600);
line-height: 1.02;
letter-spacing: var(--kz-font-display-tracking, -0.045em);
text-transform: var(--kz-font-display-case, none);
text-wrap: balance;
color: inherit;
}
/* The result over the story; side by side once there is room */
.kodza-result-quote__body {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 36px;
}
@container kodza-result-quote (min-width: 860px) {
.kodza-result-quote__body {
grid-template-columns: minmax(0, var(--kz-result-quote-result-col)) minmax(0, var(--kz-result-quote-story-col));
column-gap: clamp(40px, 6cqi, 96px);
align-items: start;
}
.kodza-result-quote--flip .kodza-result-quote__body {
grid-template-columns: minmax(0, var(--kz-result-quote-story-col)) minmax(0, var(--kz-result-quote-result-col));
}
.kodza-result-quote--flip .kodza-result-quote__result {
order: 2;
}
}
.kodza-result-quote__result,
.kodza-result-quote__story {
min-width: 0;
}
/* The result: the figure, the rule, what it measures */
.kodza-result-quote__value {
display: flex;
margin: -0.142em 0 0; /* the top of the digits level with the top of the quote's first line */
font-family: var(--kz-font-display, inherit);
font-size: calc(clamp(72px, 15cqi, 184px) * var(--kz-font-display-scale, 1));
font-weight: var(--kz-font-display-weight, 600);
line-height: 1.1;
letter-spacing: var(--kz-font-display-tracking, -0.06em);
text-transform: var(--kz-font-display-case, none);
font-variant-numeric: tabular-nums;
white-space: nowrap;
color: inherit;
}
.kodza-result-quote__label {
position: relative;
margin: 18px 0 0;
padding-top: 16px;
overflow: hidden;
overflow: clip;
font-family: var(--kz-font-label, var(--kz-result-quote-mono));
font-size: var(--kz-font-label-size, 12.5px);
font-weight: var(--kz-font-label-weight, 400);
line-height: var(--kz-font-label-leading, 1.5);
letter-spacing: var(--kz-font-label-tracking, 0);
text-transform: var(--kz-font-label-case, inherit);
color: var(--kz-result-quote-dim);
}
.kodza-result-quote__label::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: var(--kz-result-quote-rule);
transform-origin: 0 50%;
}
.kodza-result-quote__label-text {
display: block;
}
/* The rolling figure (the engine of Counter): a column of digits per digit */
.kodza-result-quote__digit {
position: relative;
display: inline-block;
height: 1.1em;
overflow: hidden; /* the digit's ink sits inside its 1.1em slot: no clip margin, the neighbours stay out */
}
.kodza-result-quote__fit {
visibility: hidden;
}
.kodza-result-quote__strip {
position: absolute;
top: 0;
left: 50%;
translate: -50% 0;
text-align: center;
}
.kodza-result-quote__strip > span {
display: block;
height: 1.1em;
line-height: 1.1;
}
.kodza-result-quote__char {
white-space: pre;
}
/* The story: the quote, who said it, the link */
.kodza-result-quote__figure {
margin: 0;
}
.kodza-result-quote__quote {
max-width: var(--kz-result-quote-measure);
margin: 0;
padding: 0;
border: 0;
font-family: var(--kz-font-display, inherit);
font-size: calc(clamp(26px, 3.4vw, 40px) * var(--kz-font-display-scale, 1));
font-weight: var(--kz-font-display-weight, 500);
line-height: 1.2;
letter-spacing: var(--kz-font-display-tracking, -0.03em);
text-transform: var(--kz-font-display-case, none);
text-wrap: pretty;
color: inherit;
quotes: none;
}
.kodza-result-quote__quote p {
margin: 0;
}
.kodza-result-quote__quote p + p {
margin-top: 0.6em;
}
/* The quote marks, the opening one hung in the margin (the script sets them into the first and
last words once it splits the quote) */
.kodza-result-quote__quote p:first-child::before {
content: "\201C";
margin-left: calc(var(--kz-result-quote-hang) * -1);
}
.kodza-result-quote__quote p:last-child::after {
content: "\201D";
}
.kodza-result-quote.is-split .kodza-result-quote__quote p::before,
.kodza-result-quote.is-split .kodza-result-quote__quote p::after {
content: none;
}
/* Split by the script: each line a mask, the line rising into it */
.kodza-result-quote__lines {
display: flex;
flex-direction: column;
}
.kodza-result-quote__line {
display: block;
overflow: hidden;
overflow: clip;
padding: 0.1em 0.5em;
margin: -0.1em -0.5em;
}
.kodza-result-quote__lift {
display: block;
white-space: nowrap;
}
.kodza-result-quote__word {
display: inline-block;
}
.kodza-result-quote__mark {
margin-left: calc(var(--kz-result-quote-hang) * -1);
}
.kodza-result-quote__sr {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0 0 0 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
/* Who said it: the face on two lines, the name over the role */
.kodza-result-quote__who {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
grid-template-areas: "mark name" "mark role";
align-items: center;
column-gap: 14px;
row-gap: 4px;
margin-top: 32px;
}
.kodza-result-quote__face {
grid-area: mark;
display: grid;
place-items: center;
box-sizing: border-box;
width: 40px;
height: 40px;
border-radius: var(--kz-radius-pill, 999px);
background: var(--kz-result-quote-face);
color: var(--kz-result-quote-ink);
object-fit: cover;
font-size: 13px;
font-weight: 600;
line-height: 1;
}
.kodza-result-quote__name {
grid-area: name;
align-self: end;
min-width: 0;
font-size: 16px;
font-weight: 500;
line-height: 1.3;
}
.kodza-result-quote__role {
grid-area: role;
align-self: start;
min-width: 0;
font-family: var(--kz-font-label, var(--kz-result-quote-mono));
font-size: var(--kz-font-label-size, 12.5px);
font-weight: var(--kz-font-label-weight, 400);
line-height: var(--kz-font-label-leading, 1.4);
letter-spacing: var(--kz-font-label-tracking, 0);
text-transform: var(--kz-font-label-case, inherit);
color: var(--kz-result-quote-dim);
}
/* The link to the case study: the shaft of the arrow draws itself on hover */
.kodza-result-quote__link {
display: inline-flex;
align-items: center;
gap: 0.35em;
margin-top: 28px;
font-size: 15px;
font-weight: 500;
line-height: 1.4;
color: inherit;
text-decoration: none;
}
.kodza-result-quote__link:focus-visible {
outline: 2px solid currentColor;
outline-offset: 4px;
border-radius: calc(3px * var(--kz-radius-scale, 1));
}
.kodza-result-quote__arrow {
display: inline-block;
flex: none;
width: 0.82em;
height: 0.82em;
overflow: visible;
}
.kodza-result-quote__arrow svg {
display: block;
width: 100%;
height: 100%;
overflow: visible;
fill: none;
stroke: currentColor;
stroke-width: 1.7;
stroke-linecap: round;
stroke-linejoin: round;
}
.kodza-result-quote__tip {
transform: translateX(-3.5px);
transition: transform calc(0.45s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease);
}
.kodza-result-quote__shaft {
stroke-dasharray: 1;
stroke-dashoffset: 1;
transition: stroke-dashoffset calc(0.45s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease);
}
.kodza-result-quote__link:focus-visible .kodza-result-quote__tip {
transform: translateX(1.5px);
}
.kodza-result-quote__link:focus-visible .kodza-result-quote__shaft {
stroke-dashoffset: 0;
}
@media (hover: hover) {
.kodza-result-quote__link:hover .kodza-result-quote__tip {
transform: translateX(1.5px);
}
.kodza-result-quote__link:hover .kodza-result-quote__shaft {
stroke-dashoffset: 0;
}
}
/* The entrance. Before it: the rule not drawn, the words below their masks, the person and the
link a little lower and clear; the quote hidden until the script has cut it into lines */
.kodza-result-quote.is-armed:not(.is-split) .kodza-result-quote__quote {
visibility: hidden;
}
.kodza-result-quote.is-armed:not(.is-in) .kodza-result-quote__label::before {
transform: scaleX(0);
}
.kodza-result-quote.is-armed:not(.is-in) .kodza-result-quote__label-text,
.kodza-result-quote.is-armed:not(.is-in) .kodza-result-quote__lift {
transform: translateY(120%);
}
.kodza-result-quote.is-armed:not(.is-in) .kodza-result-quote__who,
.kodza-result-quote.is-armed:not(.is-in) .kodza-result-quote__link {
opacity: 0;
transform: translateY(14px);
}
/* Then, in this order: the rule, what it measures, each line of the quote, the person, the link
(--kz-result-quote-i: the line's rank, --kz-result-quote-n: the number of lines, both set by
the script). The fades are short and the rises long: all of it is readable within a second */
.kodza-result-quote.is-in .kodza-result-quote__label::before {
transition: transform calc(0.9s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease);
}
.kodza-result-quote.is-in .kodza-result-quote__label-text {
transition: transform calc(0.75s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease) calc(0.15s * var(--kz-motion-scale, 1));
}
.kodza-result-quote.is-in .kodza-result-quote__lift {
transition: transform calc(0.8s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease) calc((0.35s + var(--kz-result-quote-i, 0) * 0.07s) * var(--kz-motion-scale, 1));
}
/* The person after the fifth line at the latest: a long quote does not keep it waiting */
.kodza-result-quote.is-in .kodza-result-quote__who {
transition:
opacity calc(0.3s * var(--kz-motion-scale, 1)) ease calc((0.35s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1)),
transform calc(0.8s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease) calc((0.35s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1));
}
.kodza-result-quote.is-in .kodza-result-quote__link {
transition:
opacity calc(0.3s * var(--kz-motion-scale, 1)) ease calc((0.45s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1)),
transform calc(0.8s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease) calc((0.45s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1));
}
@media (prefers-reduced-motion: reduce) {
.kodza-result-quote *,
.kodza-result-quote *::before,
.kodza-result-quote *::after {
transition-duration: 0.01ms !important;
transition-delay: 0s !important;
animation-duration: 0.01ms !important;
}
}
/* kodza-guard fbc5cfd3732a — generated by Kodza, do not edit.
Theme guard: keeps a site's own CSS (WordPress themes, Bootstrap, CSS resets…) off this
component. :not(#_) is always true and weighs as much as an id, so these lines win over
theme rules made of classes and tags. Customise the component through its --kz-* variables. */
/* What the browser gives, where the component sets it only in some states: at the lowest weight, so its own rules below put it back */
:where(.kodza-result-quote__eyebrow):not(#_),
:where(.kodza-result-quote__title):not(#_),
:where(.kodza-result-quote__value):not(#_),
:where(.kodza-result-quote__label):not(#_),
:where(.kodza-result-quote__figure):not(#_),
:where(.kodza-result-quote__quote):not(#_),
:where(.kodza-result-quote__quote p:where(:is(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))):not(.kodza-result-quote__quote :not(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))) *))):not(#_),
:where(.kodza-result-quote__arrow svg:where(:not([class*="kodza-"]))):not(#_) {
transition-duration: revert;
transition-delay: revert;
}
:where(.kodza-result-quote__who):not(#_) {
transition: revert;
}
:where(.kodza-result-quote__link):not(#_) {
border-radius: revert;
outline: revert;
transition: revert;
outline-offset: revert;
}
/* What the browser gives, on everything the component leaves to it */
.kodza-result-quote__inner:not(#_),
.kodza-result-quote__head:not(#_),
.kodza-result-quote__body:not(#_),
.kodza-result-quote__result:not(#_),
.kodza-result-quote__digit:not(#_),
.kodza-result-quote__fit:not(#_),
.kodza-result-quote__strip:not(#_),
.kodza-result-quote__char:not(#_),
.kodza-result-quote__sr:not(#_),
.kodza-result-quote__label-text:not(#_),
.kodza-result-quote__story:not(#_),
.kodza-result-quote__lines:not(#_),
.kodza-result-quote__line:not(#_),
.kodza-result-quote__lift:not(#_),
.kodza-result-quote__word:not(#_),
.kodza-result-quote__mark:not(#_),
.kodza-result-quote__name:not(#_),
.kodza-result-quote__role:not(#_),
.kodza-result-quote__arrow:not(#_),
.kodza-result-quote__shaft:not(#_),
.kodza-result-quote__tip:not(#_),
.kodza-result-quote__strip span:where(:not([class*="kodza-"])):not(#_) {
box-sizing: revert;
}
.kodza-result-quote__eyebrow:not(#_),
.kodza-result-quote__title:not(#_),
.kodza-result-quote__value:not(#_) {
border: revert;
padding: revert;
border-radius: revert;
outline: revert;
text-decoration: revert;
list-style: revert;
box-sizing: revert;
float: revert;
position: revert;
background-color: revert;
background-image: revert;
box-shadow: revert;
outline-offset: revert;
appearance: revert;
max-width: revert;
max-height: revert;
font-style: revert;
text-underline-offset: revert;
text-align: revert;
text-indent: revert;
text-shadow: revert;
vertical-align: revert;
transition-property: revert;
transition-timing-function: revert;
}
.kodza-result-quote__label:not(#_) {
border: revert;
border-radius: revert;
outline: revert;
text-decoration: revert;
list-style: revert;
box-sizing: revert;
float: revert;
padding-right: revert;
padding-bottom: revert;
padding-left: revert;
background-color: revert;
background-image: revert;
box-shadow: revert;
outline-offset: revert;
appearance: revert;
max-width: revert;
max-height: revert;
font-style: revert;
text-underline-offset: revert;
text-align: revert;
text-indent: revert;
text-shadow: revert;
vertical-align: revert;
transition-property: revert;
transition-timing-function: revert;
}
.kodza-result-quote__figure:not(#_),
.kodza-result-quote__quote p:where(:is(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))):not(.kodza-result-quote__quote :not(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))) *)):not(#_) {
border: revert;
padding: revert;
border-radius: revert;
outline: revert;
text-decoration: revert;
list-style: revert;
box-sizing: revert;
float: revert;
position: revert;
background-color: revert;
background-image: revert;
box-shadow: revert;
outline-offset: revert;
appearance: revert;
max-width: revert;
max-height: revert;
color: revert;
font-family: revert;
font-size: revert;
font-weight: revert;
font-style: revert;
line-height: revert;
letter-spacing: revert;
text-transform: revert;
text-underline-offset: revert;
text-align: revert;
text-indent: revert;
text-shadow: revert;
vertical-align: revert;
transition-property: revert;
transition-timing-function: revert;
}
.kodza-result-quote__quote:not(#_) {
border-radius: revert;
outline: revert;
text-decoration: revert;
list-style: revert;
box-sizing: revert;
float: revert;
position: revert;
background-color: revert;
background-image: revert;
box-shadow: revert;
outline-offset: revert;
appearance: revert;
max-height: revert;
font-style: revert;
text-underline-offset: revert;
text-align: revert;
text-indent: revert;
text-shadow: revert;
vertical-align: revert;
transition-property: revert;
transition-timing-function: revert;
}
.kodza-result-quote__who:not(#_) {
border: revert;
padding: revert;
border-radius: revert;
outline: revert;
text-decoration: revert;
list-style: revert;
box-sizing: revert;
float: revert;
position: revert;
margin-right: revert;
margin-bottom: revert;
margin-left: revert;
background-color: revert;
background-image: revert;
box-shadow: revert;
outline-offset: revert;
appearance: revert;
max-width: revert;
max-height: revert;
color: revert;
font-family: revert;
font-size: revert;
font-weight: revert;
font-style: revert;
line-height: revert;
letter-spacing: revert;
text-transform: revert;
text-underline-offset: revert;
text-align: revert;
text-indent: revert;
text-shadow: revert;
vertical-align: revert;
}
.kodza-result-quote__link:not(#_) {
border: revert;
padding: revert;
list-style: revert;
box-sizing: revert;
float: revert;
position: revert;
margin-right: revert;
margin-bottom: revert;
margin-left: revert;
background-color: revert;
background-image: revert;
box-shadow: revert;
appearance: revert;
max-width: revert;
max-height: revert;
font-family: revert;
font-style: revert;
letter-spacing: revert;
text-transform: revert;
text-underline-offset: revert;
text-align: revert;
text-indent: revert;
text-shadow: revert;
vertical-align: revert;
}
.kodza-result-quote__arrow svg:where(:not([class*="kodza-"])):not(#_) {
border: revert;
margin: revert;
padding: revert;
border-radius: revert;
outline: revert;
text-decoration: revert;
list-style: revert;
box-sizing: revert;
float: revert;
position: revert;
background-color: revert;
background-image: revert;
box-shadow: revert;
outline-offset: revert;
appearance: revert;
max-width: revert;
max-height: revert;
color: revert;
font-family: revert;
font-size: revert;
font-weight: revert;
font-style: revert;
line-height: revert;
letter-spacing: revert;
text-transform: revert;
text-underline-offset: revert;
text-align: revert;
text-indent: revert;
text-shadow: revert;
vertical-align: revert;
transition-property: revert;
transition-timing-function: revert;
}
.kodza-result-quote__eyebrow:not(#_):where(:not([hidden])),
.kodza-result-quote__title:not(#_):where(:not([hidden])),
.kodza-result-quote__label:not(#_):where(:not([hidden])),
.kodza-result-quote__figure:not(#_):where(:not([hidden])),
.kodza-result-quote__quote:not(#_):where(:not([hidden])),
.kodza-result-quote__quote p:where(:is(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))):not(.kodza-result-quote__quote :not(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))) *)):not(#_):where(:not([hidden])) {
display: revert;
}
.kodza-result-quote__eyebrow:not(#_):where([hidden]),
.kodza-result-quote__title:not(#_):where([hidden]),
.kodza-result-quote__label:not(#_):where([hidden]),
.kodza-result-quote__figure:not(#_):where([hidden]),
.kodza-result-quote__quote:not(#_):where([hidden]),
.kodza-result-quote__quote p:where(:is(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))):not(.kodza-result-quote__quote :not(:not([class]), [class=""], [class^="is-"]:not([class*="kodza-"]):not([class*=" "]:not([class*=" is-"]))) *)):not(#_):where([hidden]) {
display: none;
}
.kodza-result-quote__label:not(#_)::before {
box-sizing: revert;
}
/* The component's own rules, one step stronger: real buttons and fields, what it sets on tags themes style (links, lists, headings, images…), and the root width (a theme may narrow it, never widen it) */
.kodza-result-quote__eyebrow:not(#_) {
margin: 0 0 18px;
font-family: var(--kz-font-label, var(--kz-result-quote-mono));
font-size: var(--kz-font-label-size, 12.5px);
font-weight: var(--kz-font-label-weight, 500);
line-height: var(--kz-font-label-leading, inherit);
letter-spacing: var(--kz-font-label-tracking, 0.02em);
text-transform: var(--kz-font-label-case, inherit);
color: var(--kz-result-quote-dim);
}
.kodza-result-quote__title:not(#_) {
margin: 0;
font-family: var(--kz-font-display, inherit);
font-size: calc(clamp(32px, 4.6vw, 56px) * var(--kz-font-display-scale, 1));
font-weight: var(--kz-font-display-weight, 600);
line-height: 1.02;
letter-spacing: var(--kz-font-display-tracking, -0.045em);
text-transform: var(--kz-font-display-case, none);
color: inherit;
}
.kodza-result-quote__value:not(#_) {
display: flex;
margin: -0.142em 0 0;
font-family: var(--kz-font-display, inherit);
font-size: calc(clamp(72px, 15cqi, 184px) * var(--kz-font-display-scale, 1));
font-weight: var(--kz-font-display-weight, 600);
line-height: 1.1;
letter-spacing: var(--kz-font-display-tracking, -0.06em);
text-transform: var(--kz-font-display-case, none);
color: inherit;
}
.kodza-result-quote__label:not(#_) {
position: relative;
margin: 18px 0 0;
padding-top: 16px;
font-family: var(--kz-font-label, var(--kz-result-quote-mono));
font-size: var(--kz-font-label-size, 12.5px);
font-weight: var(--kz-font-label-weight, 400);
line-height: var(--kz-font-label-leading, 1.5);
letter-spacing: var(--kz-font-label-tracking, 0);
text-transform: var(--kz-font-label-case, inherit);
color: var(--kz-result-quote-dim);
}
.kodza-result-quote__figure:not(#_) {
margin: 0;
}
.kodza-result-quote__quote:not(#_) {
max-width: var(--kz-result-quote-measure);
margin: 0;
padding: 0;
border: 0;
font-family: var(--kz-font-display, inherit);
font-size: calc(clamp(26px, 3.4vw, 40px) * var(--kz-font-display-scale, 1));
font-weight: var(--kz-font-display-weight, 500);
line-height: 1.2;
letter-spacing: var(--kz-font-display-tracking, -0.03em);
text-transform: var(--kz-font-display-case, none);
color: inherit;
}
.kodza-result-quote__quote p:not(#_) {
margin: 0;
}
.kodza-result-quote__who:not(#_) {
display: grid;
margin-top: 32px;
}
.kodza-result-quote__link:not(#_) {
display: inline-flex;
margin-top: 28px;
font-size: 15px;
font-weight: 500;
line-height: 1.4;
color: inherit;
text-decoration: none;
}
.kodza-result-quote__link:focus-visible:not(#_) {
outline: 2px solid currentColor;
outline-offset: 4px;
border-radius: calc(3px * var(--kz-radius-scale, 1));
}
.kodza-result-quote__arrow svg:not(#_) {
display: block;
}
.kodza-result-quote.is-in .kodza-result-quote__who:not(#_) {
transition: opacity calc(0.3s * var(--kz-motion-scale, 1)) ease calc((0.35s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1)),
transform calc(0.8s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease) calc((0.35s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1));
}
.kodza-result-quote.is-in .kodza-result-quote__link:not(#_) {
transition: opacity calc(0.3s * var(--kz-motion-scale, 1)) ease calc((0.45s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1)),
transform calc(0.8s * var(--kz-motion-scale, 1)) var(--kz-result-quote-ease) calc((0.45s + min(var(--kz-result-quote-n, 4), 5) * 0.07s) * var(--kz-motion-scale, 1));
}
@media (prefers-reduced-motion: reduce) {
.kodza-result-quote *:where(p, h2, figure, blockquote, figcaption, a, svg):not(#_) {
transition-duration: 0.01ms !important;
transition-delay: 0s !important;
}
}
// Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license
// Kodza — Result Quote
// A case study in one block, played once as it comes into view, the result first: the digits of
// the figure roll up to their value ("3.2×", "−42%": only the digits move), then the lines of the
// quote rise from behind their masks, then the person and the link (the order and the delays are
// in the CSS). The settings: the constants below and the --kz-result-quote-* variables.
// "kodza:replay" on the element plays the entrance again.
(() => {
const SELECTOR = '.kodza-result-quote';
const THRESHOLD = 0.35; // share of the result in view before the section plays
const ROLL = 1400; // ms for the first digit to land
const ROLL_STEP = 160; // ms more for each next digit
const ROLL_EASE = 'cubic-bezier(0.16, 1, 0.3, 1)';
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
// The site's pace, --kz-motion-scale (set on :root, read on the instance): every duration of the
// script times it, and 0 moves nothing, like reduced motion
const paceOf = (el) => {
const pace = parseFloat(getComputedStyle(el).getPropertyValue('--kz-motion-scale'));
return pace >= 0 ? pace : 1;
};
const make = (tag, className, text) => Object.assign(document.createElement(tag), className ? { className } : {}, text != null ? { textContent: text } : {});
const spaced = (els) => els.flatMap((el, k) => (k ? [' ', el] : [el]));
// One instance. Everything it starts is tied to `signal`, so kodza:destroy stops it all
function mount(root, signal) {
const pace = paceOf(root);
// The still path, no motion asked by the visitor or the site: the section stays as written
if (reduceMotion || !pace || !('IntersectionObserver' in window)) return;
const result = root.querySelector('.kodza-result-quote__result') || root;
const quote = root.querySelector('.kodza-result-quote__quote');
// The figure: a column of spinning digits per digit (screen readers keep the plain text)
const strips = [];
root.querySelectorAll('.kodza-result-quote__value').forEach((value) => {
const text = value.textContent.trim();
const count = (text.match(/\d/g) || []).length;
let rank = 0;
value.setAttribute('aria-hidden', 'true');
value.after(make('span', 'kodza-result-quote__sr', text));
value.replaceChildren(...[...text].map((char) => {
if (!/\d/.test(char)) return make('span', 'kodza-result-quote__char', char);
// The digits on the right spin more: one turn on the left, up to three on the right
const turns = 1 + Math.round((rank / Math.max(1, count - 1)) * 2);
const column = make('span', 'kodza-result-quote__digit');
const strip = make('span', 'kodza-result-quote__strip');
for (let i = 0; i < (turns + 1) * 10; i++) strip.append(make('span', '', i % 10));
column.append(make('span', 'kodza-result-quote__fit', char), strip);
strips.push({ strip, stop: turns * 10 + Number(char), rank: rank++ });
return column;
}));
});
const roll = () => strips.forEach(({ strip, stop, rank }) => {
strip.getAnimations().forEach((animation) => animation.cancel());
strip.animate([{ transform: 'translateY(0)' }, { transform: `translateY(${-stop * 1.1}em)` }], {
duration: (ROLL + rank * ROLL_STEP) * pace,
easing: ROLL_EASE,
fill: 'forwards',
});
});
// The quote: one mask per line, the line rising into it. The blocks are its paragraphs (or the
// quote itself); the opening mark hangs before the first word, the closing one ends the last
const blocks = !quote ? [] : quote.querySelector(':scope > p') ? [...quote.querySelectorAll(':scope > p')] : [quote];
const texts = new Map();
const split = () => {
root.classList.add('is-split');
// Writes: the words
const words = blocks.map((block, b) => {
if (!texts.has(block)) texts.set(block, block.textContent.replace(/\s+/g, ' ').trim());
const list = texts.get(block).split(' ').filter(Boolean).map((text) => make('span', 'kodza-result-quote__word', text));
if (b === 0 && list.length) list[0].prepend(make('span', 'kodza-result-quote__mark', '“'));
if (b === blocks.length - 1 && list.length) list[list.length - 1].append('”');
block.replaceChildren(make('span', 'kodza-result-quote__sr', texts.get(block)), ...spaced(list));
return list;
});
// Reads: where each word falls
const rows = words.map((list) => {
const lines = [];
let top = -Infinity;
list.forEach((word) => {
if (word.offsetTop > top + 2) {
lines.push([]);
top = word.offsetTop;
}
lines[lines.length - 1].push(word);
});
return lines;
});
// Writes: the masks, each line with its rank for the CSS delays
let rank = 0;
blocks.forEach((block, b) => {
const box = make('span', 'kodza-result-quote__lines');
box.setAttribute('aria-hidden', 'true');
rows[b].forEach((row) => {
const line = make('span', 'kodza-result-quote__line');
const lift = make('span', 'kodza-result-quote__lift');
lift.style.setProperty('--kz-result-quote-i', rank++);
lift.append(...spaced(row));
line.append(lift);
box.append(line);
});
block.replaceChildren(block.firstChild, box);
});
root.style.setProperty('--kz-result-quote-n', rank);
};
// The entrance: armed (the CSS hides what comes in), then played once the result is in view
let ready = false;
const enter = () => {
root.classList.add('is-in');
roll();
};
root.classList.add('is-armed');
const io = new IntersectionObserver((entries) => {
if (!entries.some((entry) => entry.isIntersecting)) return;
io.disconnect();
enter();
}, { threshold: THRESHOLD });
root.addEventListener('kodza:replay', () => {
if (!ready) return;
io.disconnect();
root.classList.remove('is-in');
void root.offsetWidth; // hidden again for one frame, so it all plays from the start
enter();
}, { signal });
// A new width (or a new font size) puts the words on new lines: split again, mid-entrance or not
let key = '';
let pending = 0;
const keyOf = () => `${quote.clientWidth} ${parseFloat(getComputedStyle(quote).fontSize)}`;
const resized = new ResizeObserver(() => {
if (!ready || keyOf() === key) return;
key = keyOf();
cancelAnimationFrame(pending);
pending = requestAnimationFrame(split);
});
signal.addEventListener('abort', () => {
io.disconnect();
resized.disconnect();
cancelAnimationFrame(pending);
strips.forEach(({ strip }) => strip.getAnimations().forEach((animation) => animation.cancel()));
}, { once: true });
// Lines are measured in the real font; the section waits for them before it can play
Promise.resolve(document.fonts?.ready).then(() => {
if (signal.aborted) return;
if (quote) {
split();
key = keyOf();
resized.observe(quote);
}
ready = true;
io.observe(result);
});
}
// Kodza lifecycle, the same in every component: `kodza:init` starts the instances inside
// event.detail.root (the whole page by default), `kodza:destroy` stops them and puts their
// markup back. For themes and apps that swap content without a page load. Each running root
// keeps its markup as written under KODZA, shared by every Kodza script on the page: a Kodza
// component inside another one is saved as written, not half-started, and stopped with it. Two
// components on one root (a reveal on a stat card) both start, and stop together.
const KODZA = Symbol.for('kodza');
const RUNNING = Symbol.for(`kodza ${SELECTOR}`); // a root this component runs on, for every copy of this script
const instances = new WeakMap();
const find = (scope = document) => [scope, ...scope.querySelectorAll(SELECTOR)].filter((el) => el.matches?.(SELECTOR));
const attrsOf = (el) => [...el.attributes].map((a) => [a.name, a.value]);
const put = (el, saved) => {
[...el.attributes].forEach((a) => el.removeAttribute(a.name));
saved.attrs.forEach(([name, value]) => el.setAttribute(name, value));
el.innerHTML = saved.html;
};
// The markup inside a root as written: Kodza components already running in it give back their own
const written = (root) => {
const all = [...root.querySelectorAll('*')];
if (!all.some((el) => el[KODZA])) return root.innerHTML;
const copy = root.cloneNode(true);
const twins = copy.querySelectorAll('*');
let last = null;
all.forEach((el, i) => {
if (!el[KODZA] || last?.contains(el)) return;
last = el;
put(twins[i], el[KODZA]);
});
return copy.innerHTML;
};
const init = (scope) => find(scope).forEach((root) => {
// Already running, maybe from another copy of this script. Marked is-ready with no Kodza component
// running on it, a root is a copy of a started one (a cloned slide): it is left as it is
if (root[RUNNING] || (root.classList.contains('is-ready') && !root[KODZA])) return;
// Rendered by React (data-kodza-manual): React starts it, with an init aimed at that markup once
// it has hydrated it. Any earlier start would change markup React has not taken over yet
const owner = root.closest('[data-kodza-manual]');
if (owner && !(scope && owner.contains(scope))) return;
const controller = new AbortController();
// Another Kodza component already running on this root: its markup as written is kept, and the
// two stop together
const before = root[KODZA];
const saved = { html: before ? before.html : written(root), attrs: before ? before.attrs : attrsOf(root), stop: () => destroy(root) };
if (before) before.above = saved;
instances.set(root, { controller, saved, before });
root[KODZA] = saved;
root[RUNNING] = true;
mount(root, controller.signal);
root.classList.add('is-ready');
});
const destroy = (scope) => find(scope).forEach((root) => {
const instance = instances.get(root);
if (!instance) return;
instances.delete(root);
instance.saved.above?.stop(); // a Kodza component started after it on the same root stops first
// The Kodza components running inside it stop first: once its markup is put back, their own
// script could not find them any more
root.querySelectorAll('*').forEach((el) => el[KODZA]?.stop());
instance.controller.abort();
delete root[RUNNING];
// Started on top of another one: that one stops next, and puts the markup back
if (instance.before) {
delete instance.before.above;
root[KODZA] = instance.before;
return instance.before.stop();
}
delete root[KODZA];
put(root, instance.saved);
});
document.addEventListener('kodza:init', (event) => init(event.detail?.root));
document.addEventListener('kodza:destroy', (event) => destroy(event.detail?.root));
init();
// Loaded in <head>, the script runs before the markup exists: once more when it is parsed
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', () => init(), { once: true });
})();
'use client';
// Kodza — Result Quote, for React. From https://kodza.dev/components/result-quote/
// Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license
// Next to this file: result-quote.css and result-quote.js, the component's CSS and JS from Kodza, as they are.
// Yours to edit: the markup is plain JSX below.
// The script changes this markup once React has rendered it (it adds layers, splits text, moves
// nodes), so React must not patch it afterwards. When a prop changes, the key gives React a fresh
// element: kodza:destroy stops the script on the old one, kodza:init starts it on the new one.
// data-kodza-manual keeps the script from starting it on its own: the effect below does, once
// React has hydrated the markup (on a page that streams in, the script can load first).
// Built from your data (tabs, rows, options)? Put what the markup is made of in the key, as plain
// values (ids, text, numbers): a change starts the script again on fresh markup. What the visitor
// changes (the open tab, the sort, what they type) is the script's: keep it out of the key, follow
// it with onClick or onInput on the root, and change it from your code as a visitor would (click
// the tab; set the field's value, then dispatch a bubbling input event).
import { useRef, useEffect, type ComponentPropsWithoutRef, type ComponentRef, type CSSProperties } from 'react';
import './result-quote.css';
type Variant = "flip";
export type ResultQuoteProps = Omit<ComponentPropsWithoutRef<'section'>, "children" | "variant" | "vars" | "kodzaResultQuote"> & {
/** Modifier class(es): .kodza-result-quote--flip */
variant?: Variant | Variant[];
/** data-kodza-result-quote on the root */
kodzaResultQuote?: string;
/** Settings, as CSS variables on the root */
vars?: {
/** default: #0a0a0a */
"--kz-result-quote-ink"?: string | number;
/** default: rgba(10, 10, 10, 0.64) */
"--kz-result-quote-dim"?: string | number;
/** the line under the result — default: rgba(10, 10, 10, 0.22) */
"--kz-result-quote-rule"?: string | number;
/** default: #e6e6e3 */
"--kz-result-quote-face"?: string | number;
/** default: transparent */
"--kz-result-quote-bg"?: string | number;
/** default: 1200px */
"--kz-result-quote-width"?: string | number;
/** the longest line of the quote — default: 680px */
"--kz-result-quote-measure"?: string | number;
/** the two columns, from 860px of room — default: 5fr */
"--kz-result-quote-result-col"?: string | number;
/** default: 7fr */
"--kz-result-quote-story-col"?: string | number;
/** the opening quote mark hangs in the margin by its width — default: 0.4em */
"--kz-result-quote-hang"?: string | number;
/** default: clamp(64px, 8vw, 112px) */
"--kz-result-quote-pad-y"?: string | number;
/** default: clamp(16px, 4vw, 40px) */
"--kz-result-quote-gutter"?: string | number;
/** default: var(--kz-font-mono, "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace) */
"--kz-result-quote-mono"?: string | number;
/** default: cubic-bezier(0.22, 1, 0.36, 1) */
"--kz-result-quote-ease"?: string | number;
};
className?: string;
};
export function ResultQuote({ variant, kodzaResultQuote, vars, className, style, ...rest }: ResultQuoteProps) {
const ref = useRef<ComponentRef<'section'>>(null);
const classes = ["kodza-result-quote", ...([] as string[]).concat(variant ?? []).map((v) => `kodza-result-quote--${v}`), className].filter(Boolean).join(' ');
// Everything the markup is made of: when it changes, React gets a fresh element (see the top)
const key = JSON.stringify([classes, kodzaResultQuote, vars, style, rest]);
// Starts the script on this element once React has rendered it, stops it when it goes
useEffect(() => {
const root = ref.current;
let live = true;
// @ts-ignore: a plain script, no types to find
import('./result-quote.js').then(() => {
if (live) document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root } }));
});
return () => {
live = false;
document.dispatchEvent(new CustomEvent('kodza:destroy', { detail: { root } }));
};
}, [key]);
return (
<section aria-label="Case study: Fjordly" key={key} {...rest} className={classes} data-kodza-manual data-kodza-result-quote={kodzaResultQuote} style={{ ...vars, ...style } as CSSProperties} ref={ref}>
<div className="kodza-result-quote__inner">
<div className="kodza-result-quote__head">
<p className="kodza-result-quote__eyebrow">Case studies</p>
<h2 className="kodza-result-quote__title">Results, not adjectives.</h2>
</div>
<div className="kodza-result-quote__body">
<div className="kodza-result-quote__result">
<p className="kodza-result-quote__value">3.2×</p>
<p className="kodza-result-quote__label">
<span className="kodza-result-quote__label-text">Demo requests, first quarter after launch</span>
</p>
</div>
<div className="kodza-result-quote__story">
<figure className="kodza-result-quote__figure">
<blockquote className="kodza-result-quote__quote">
<p>They cut our homepage from nine sections to four and put the real load time where the slogan used to be. Demo requests more than tripled in one quarter.</p>
</blockquote>
<figcaption className="kodza-result-quote__who">
<span className="kodza-result-quote__face" aria-hidden="true">IS</span>
<span className="kodza-result-quote__name">Ingrid Solberg</span>
<span className="kodza-result-quote__role">Head of growth, Fjordly · Bergen</span>
</figcaption>
</figure>
<a className="kodza-result-quote__link" href="#">Read the Fjordly case study<span className="kodza-result-quote__arrow" aria-hidden="true"> <svg viewBox="0 0 16 16"> <path className="kodza-result-quote__shaft" d="M2.5 8h10" pathLength="1" /> <path className="kodza-result-quote__tip" d="M8.5 3.5 13 8l-4.5 4.5" /> </svg> </span></a>
</div>
</div>
</div>
</section>
);
}
Checked
Robots poked at it before you did. Every component goes through the same checks, and again each time it changes.