Sha256: 582392f2832fe528f450e9def162496e251a2d4c8d8f2917a98785b6c1e3be84

Contents?: true

Size: 1020 Bytes

Versions: 6

Compression:

Stored size: 1020 Bytes

Contents

@import "modular-scale";

// centralize spiral steps.
@function ratio-spiral-i($i) {
  @return (($i * 2) + 1);
}

@function ratio-spiral($depth: 5, $ratio: golden(), $invert: false) {

  // write the middle most column, a little out of step from the other columns.
  $list: ms(ratio-spiral-i(-$depth) + 1, 100, $ratio);

  // flip the direction the order columns are written in.
  @if $invert == false {
    @for $i from -($depth - 1) to 0 {
      // if the number is even
      @if $i/2 == round($i/2) {
        // append after the list
        $list: append($list, ms(ratio-spiral-i($i), 100, $ratio));
      }
      @else {
        // append before the list
        $list: append(ms(ratio-spiral-i($i), 100, $ratio), $list);
      }
    }
  }

  @else {
    @for $i from -($depth - 1) to 0 {
      @if $i/2 == round($i/2) {
        $list: append(ms(ratio-spiral-i($i), 100, $ratio), $list);
      }
      @else {
        $list: append($list, ms(ratio-spiral-i($i), 100, $ratio));
      }
    }
  }

  @return $list;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
singularity-extras-1.0.0.alpha.3 stylesheets/singularity-extras/generators/_ratio-spiral.scss
singularity-extras-1.0.0.alpha.2 stylesheets/singularity-extras/generators/_ratio-spiral.scss
singularity-extras-1.0.0.alpha.1 stylesheets/singularity-extras/generators/_ratio-spiral.scss
singularity-extras-0.0.3 stylesheets/singularity-extras/generators/_ratio-spiral.scss
singularity-extras-0.0.2 stylesheets/singularity-extras/generators/_ratio-spiral.scss
singularity-extras-0.0.1 stylesheets/singularity-extras/generators/_ratio-spiral.scss