The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Decovar Random

TODO: Pull subtitle into page object

the quick brown fox

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Decovar Random

-- p
-- id: alfa

the quick brown fox

-- script

const els = {}

const axes = [
    'BLDA',
    'BLDB',
    // 'WMX2',
    'SKLA',
    'SKLB',
    'SKLD',
    'TRMA',
    'TRMB',
    'TRMC',
    'TRMD',
    'TRME',
    'TRMF',
    'TRMG',
    'TRMK',
    'TRML',
]

const getRandomObjectKey = (inputObj) => {
    const keys = Object.keys(inputObj)
    const randomKey = keys[Math.floor(Math.random() * keys.length)]
    return randomKey
}

let adjustments = new Map()
let direction = 'up'

const getString = () => {
    const assembler = []
    const axesValues = {}

    for (const axis of axes) {
        axesValues[axis] = 0
    }

    let randomAxis = null

    // try not to use the same axis twice, but
    // back off after 20 runs since that should
    // hit most stuff
    for (let i = 1; i < 20; i++) {
        randomAxis = axes[Math.floor(Math.random() * axes.length)]
        if (!adjustments.has(randomAxis)) {
            break
        }
    }

    const randomValue = Math.floor(Math.random() * (1000 - 350 + 1) + 300)

    if (direction === 'up') {
        if (adjustments.size <= 5) {
            adjustments.set(randomAxis, randomValue)
        } else {
            adjustments.set(randomAxis, randomValue)
            direction = 'down'
        }
    } else {
        const axisToRemove = Array.from(adjustments.keys())[0]
        adjustments.delete(axisToRemove)
        if (adjustments.size === 0) {
            adjustments.set(randomAxis, randomValue)
            direction = 'up'
        }
    }

    adjustments.forEach((value, key) => {
        axesValues[key] = value
    })

    for (const axis in axesValues) {
        assembler.push(`"${axis}" ${axesValues[axis]}`)
    }

    return assembler.join(',')
}

let theTimeout = null

const update = () => {
    if (theTimeout) {
        clearTimeout(theTimeout)
    }
    theTimeout = setTimeout(() => {
        const updateValues = getString()
        els.btn.style.fontVariationSettings = updateValues
        update()
    }, 1400)
}

document.addEventListener('DOMContentLoaded', () => {
    els.btn = document.getElementById('alfa')
    update()
})


-- css

@font-face {
  font-family: 'Decovar';
  src: url('/assets/fonts/Decovar.ttf') format('opentype');
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html,
body {
  height: 100%;
}
body {
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
}
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}
input,
button,
textarea,
select {
  font: inherit;
}
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
#root,
#__next {
  isolation: isolate;
}

html {
  height: 100%;
}

body {
  background-color: #211717;
  color: #dfddc7;
  font-family: 'Decovar';
  height: 100%;
}

#wrapper {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 100%;
}

a {
  color: #a34a28;
  text-decoration: none;
}

footer {
  text-align: center;
  padding-bottom: 10px;
  font-size: 0.75rem;
}

#alfa {
  font-size: 4.6rem;
  font-variation-settings: 'BLDA' 0, 'BLDB' 0, 'SKLA' 0, 'SKLB' 0, 'SKLD' 0,
    'TRMA' 0, 'TRMB' 0, 'TRMC' 0, 'TRMD' 0, 'TRME' 0, 'TRMF' 0, 'TRMG' 0,
    'TRMK' 0, 'TRML' 0;
}

#alfa {
  text-align: center;
  transition: font-variation-settings 1.4s;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.details {
  padding-top: 30px;
  text-align: left;
  max-width: 550px;
  margin: auto;
}


-- categories
-- Miscellaneous

-- metadata
-- date: 2023-07-08 22:58:24
-- id: 2sjjjk8w
-- site: aws
-- type: post 
-- status: published