From 04a32da348311c6c6c966482574e5cd36dbfdb06 Mon Sep 17 00:00:00 2001 From: serapath Date: Mon, 22 Apr 2019 06:58:06 +0100 Subject: [PATCH] UPDATE theme --- bundle.js | 48 +++++++++++++++++++++++++++++++++++++++++++++--- demo/demo.js | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 5 deletions(-) diff --git a/bundle.js b/bundle.js index 2f59494..93ad632 100644 --- a/bundle.js +++ b/bundle.js @@ -1,12 +1,54 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i { // const element = await skilltree(dag_data) const element = await skilltree() - document.body.appendChild(element) + const { innerHeight, innerWidht } = window + const scale = innerHeight / (1.5*480) + const id = setInterval(() => { + var svg = element.children[0] + if (!svg) return + svg.style.transform = `scale(${scale})` + clearInterval(id) + }) + document.body.appendChild(bel`
+

solidity skilltree

+ ${element} +
`) }, 0) - +const css = csjs` +.skilltreepage { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + height: 100vh; + width: 100vw; + color: white; + background-color: #21252b; + margin: 0; +} +.title { + color: white; + background-color: rgba(30, 30, 30, 0.6); + font-size: 50px; + font-family: mono; + font-weight: 900; + padding: 10px; +} +` const dag_data = [ { id: '0', @@ -75,7 +117,7 @@ const dag_data = [ }, ] -},{"../":1111}],2:[function(require,module,exports){ +},{"../":1111,"bel":3,"csjs-inject":6}],2:[function(require,module,exports){ var trailingNewlineRegex = /\n[\s]+$/ var leadingNewlineRegex = /^\n[\s]+/ var trailingSpaceRegex = /[\s]+$/ diff --git a/demo/demo.js b/demo/demo.js index e19fe68..8cf8e95 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1,11 +1,53 @@ const skilltree = require('../') +const bel = require('bel') +const csjs = require('csjs-inject') + +document.title = 'play skilltree' + +const style = document.createElement('style') +style.textContent = [ + '*, *:before, *:after { box-sizing: inherit; }', + 'body { margin: 0; height: 100vh; min-height: 100vh; }', +].join('\n') +document.head.appendChild(style) setTimeout(async () => { // const element = await skilltree(dag_data) const element = await skilltree() - document.body.appendChild(element) + const { innerHeight, innerWidht } = window + const scale = innerHeight / (1.5*480) + const id = setInterval(() => { + var svg = element.children[0] + if (!svg) return + svg.style.transform = `scale(${scale})` + clearInterval(id) + }) + document.body.appendChild(bel`
+

solidity skilltree

+ ${element} +
`) }, 0) - +const css = csjs` +.skilltreepage { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + height: 100vh; + width: 100vw; + color: white; + background-color: #21252b; + margin: 0; +} +.title { + color: white; + background-color: rgba(30, 30, 30, 0.6); + font-size: 50px; + font-family: mono; + font-weight: 900; + padding: 10px; +} +` const dag_data = [ { id: '0',