Skip to content

Instantly share code, notes, and snippets.

@BlitzdUK
Created July 19, 2023 03:15
Show Gist options
  • Select an option

  • Save BlitzdUK/3e8a27f030590ab5c26fad29d6e7fcb9 to your computer and use it in GitHub Desktop.

Select an option

Save BlitzdUK/3e8a27f030590ab5c26fad29d6e7fcb9 to your computer and use it in GitHub Desktop.
Simple text glitch
section.portfolio-experiment
.experiment-title(contenteditable="true") This is cray
$font: "Roboto", monospace;
.portfolio-experiment {
background: #00ffa5;
color: #203e86;
$steps: 50;
.experiment-title {
outline: none;
font-size: 10vw;
text-align: center;
font-family: $font;
min-height: 10vw;
max-width: 80vw;
min-width: 10vw;
&,
* {
animation: cray 6s infinite steps($steps);
display: inline-block;
}
}
@keyframes cray {
@for $i from 1 to $steps {
$per: 100% / $steps * $i;
$weight: (
100,
200,
300,
400,
500,
600,
700
);
$style: (
normal,
italic,
normal,
normal
);
$decor: (
none,
none,
line-through,
underline,
none,
none,
none
);
$trans: (
none,
none,
uppercase,
lowercase,
capitalize,
none,
none,
none,
none,
none,
none
);
$arrayW: random(7);
$arrayS: random(4);
$arrayD: random(7);
$arrayT: random(11);
#{$per} {
font-weight: nth($weight, $arrayW);
font-style: nth($style, $arrayS);
text-decoration: nth($decor, $arrayD);
text-transform: nth($trans, $arrayT);
}
}
}
}
<link href="https://codepen.io/lukemeyrick/pen/YeexWB.scss" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment