Skip to content

Instantly share code, notes, and snippets.

@trknhr
Created December 1, 2016 15:00
Show Gist options
  • Save trknhr/8fb7ba5d9467ac7f2605c1d9f640d814 to your computer and use it in GitHub Desktop.
Save trknhr/8fb7ba5d9467ac7f2605c1d9f640d814 to your computer and use it in GitHub Desktop.
PPAP SCSS
<div class="ppap">
</div>
body {
padding: 3rem;
font-size: 16px;
background: whitesmoke;
}
body > div {
background: white;
padding: 2rem;
}
$content: "";
$pen: "✏️";
$pineaple: "🍍";
$apple: "🍎";
$array: $pen, $apple, $pineaple;
$init: "";
$p: $pen;
$pp: $pen + $pineaple;
$ppa: $pen + $pineaple + $apple;
$ppap: $pen + $pineaple + $apple + $pen;
$state: $init;
@function createState($nextState, $t, $c){
@if $c == $t {
@return $nextState;
} @else {
@return $init;
}
}
@while $state != $ppap {
$c: nth($array, random(3));
$content: append($content, $c);
@if $state == $init{
$state: createState($p, $pen, $c);
} @elseif $state == $p {
$state: createState($pp, $pineaple, $c);
} @elseif $state == $pp {
$state: createState($ppa, $apple, $c);
} @elseif $state == $ppa {
$state: createState($ppap, $pen, $c);
} @else {
$state: $init;
}
}
$comment: "";
@if $state == $ppap{
$comment: "\A Pen Pineapple Apple Pen!!";
} @else {
$comment: "\A NOT FOUND PPAP !!";
}
.ppap{
&:before {
content: $content;
}
&:after {
white-space: pre ;
content: $comment;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment