Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h2>Above and Below</h2>

<blockquote>
  <p>“That every living thing stands in a fixed relationship to ‘above’ and ‘below’ and must without question remain that way, is a fact true also of the BP [Basic Plane] which, as such, is also a living thing. This can be partly explained as association or as transference of one’s own observations to the BP.</p>

  <p>The ‘above’ gives the impression of a great looseness, a feeling of lightness, of emancipation and, finally, of freedom. […] The effect of ‘below’ is completely contrary: condensation, heaviness, constraint.</p>

  <p>These characteristics of the upper and lower horizontal […] can be strengthened in a natural way for the purpose of ‘dramatization’ by means of a certain accumulation of heavier forms below and lighter ones above. Thereby the pressure, or, as the case may be, the tension, becomes considerably increased in both directions. </p>

  <p>Vice versa, these characteristics can be partially equalized or, at least, modified – and, of course, through the use of the opposite means: heavier forms above, lighter ones below […].</p>

  <p>These possibilities can be represented, purely schematically, as follows:”</p>

</blockquote>

<figure class="kandinsky">
  <canvas class="basic-plane"></canvas>
  <input type="range" id="inputRange" min="0.5" max="3.5" step="0.1" value="2">
  <label for="inputRange">
    <p>“Dramatization”</p>
    <p>“Balance”</p>
    <p>“Restraint”</p>
  </label>
  <figcaption>An implemention of Kandinsky’s algorithm – sound is added to emphasize the “characteristics of the upper and lower horizontal” </figcaption>
</figure>

<blockquote>“It can be assumed that in time, perhaps, means will be found of accomplishing measurements in the above sense with more or less exactness. At all events, the formula which I have just roughly outlined could be corrected in such a way that the relative nature of ‘balance’ would stand out with clarity. The means of measurement available to us are, however, exceedingly primitive. It is at present almost impossible for us to imagine how, for example, the weight of a scarcely visible point could be expressed by an exact number. The reason for this is that the concept ‘weight’ does not represent a material weight but is, rather, the expression of an inner force or, in our case, an inner tension.”</blockquote>

<hr>

<a href="https://monoskop.org/Wassily_Kandinsky#Publications">Kandinsky, W. (1947 [1926]). Point and line to plane. Contribution to the analysis of the pictorial elements. New York: Solomon R. Guggenheim Foundation, p. 116–117.</a>
              
            
!

CSS

              
                .kandinsky {
  align-items: center;
  background: black;
  color: white;
  display: flex;
  font-family: sans-serif;
  justify-content: center;
  padding: 5rem 0 6rem;
}

.kandinsky .basic-plane {
  background: white;
  border: 1px solid black;
}

.kandinsky figcaption {
  margin-left: 2rem;
  width: 20%;
}

.kandinsky input[type=range] {
  transform: rotate(90deg);
  width: 116px;
  margin-left: -25px;
  margin-right: -35px;
}

.kandinsky label {
  color: grey;
  display: flex;
  flex-direction: column;
}
              
            
!

JS

              
                const Canvas = document.querySelector(".kandinsky .basic-plane");
Canvas.width = 222 * 1;
Canvas.height = 222 * 1.41;

const BasicPlane = Canvas.getContext("2d");
const InputRange = document.querySelector(".kandinsky input[type=range]");

// weight of form "below" -- is fixed!
var w0 = Canvas.width * 0.13;
var h0 = w0;
// center horizontally
var x0 = Canvas.width / 2;
// put at lower third vertically
var y0 = 2 * (Canvas.height / 3);

// set up sound
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();

const osc0 = audioCtx.createOscillator("sine");
osc0.frequency.setValueAtTime(391, audioCtx.currentTime, 0.01);
const osc1 = audioCtx.createOscillator("triangle");

const gainNode = audioCtx.createGain();
osc0.connect(gainNode);
osc1.connect(gainNode);
gainNode.connect(audioCtx.destination);
gainNode.gain.value = 0.35;

var oscStarted = false;

// slider change …

InputRange.addEventListener("change", function (e) {
  
  BasicPlane.clearRect(0, 0, Canvas.width, Canvas.height);

  var dramaRatio = this.value;
  
  var w1 = w0 * Math.sqrt(dramaRatio);
  var h1 = w1;
  // center horizontally
  var x1 = Canvas.width / 2;
  // put at upper quarter vertically
  var y1 = Canvas.height / 4;

  BasicPlane.filter = "blur(3px)";
  BasicPlane.beginPath();
  BasicPlane.arc(x0, y0 + w0 / 2, w0, 0, 2 * Math.PI);
  BasicPlane.arc(x1, y1 + w1 / 2, w1, 0, 2 * Math.PI);
  BasicPlane.fillStyle = "#333";
  BasicPlane.fill();
  
  if (oscStarted === false && e.isTrusted === true) {
    osc0.start();
    osc1.start();
    oscStarted = true;
  }  
  
  osc1.frequency.setValueAtTime(391 * (2 - dramaRatio / 2), audioCtx.currentTime, 0.01);  
  gainNode.gain.cancelScheduledValues(audioCtx.currentTime);
  gainNode.gain.exponentialRampToValueAtTime(0.25, audioCtx.currentTime+1, 0.01);  
  gainNode.gain.exponentialRampToValueAtTime(0.001,audioCtx.currentTime + 4, 0.01);

});

// trigger silder event once, so that elements appear on canvas
const e = new Event("change");
InputRange.dispatchEvent(e);

function stopSound() {
  InputRange.dispatchEvent(e);
}

              
            
!
999px

Console