This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.from(document.querySelectorAll('text')).forEach((text) => { | |
| Array.from(text.querySelectorAll('textPath')).forEach((textPath) => { | |
| let textContent = textPath.textContent.replace(/\n[ ]*/g, ' ').replace(/^[\n ]/, ''); | |
| const g = document.createElementNS('http://www.w3.org/2000/svg', 'g'); | |
| const computedStyle = getComputedStyle(textPath); | |
| g.setAttribute('fill', computedStyle.fill); | |
| g.setAttribute('font-size', computedStyle.fontSize); | |
| g.setAttribute('font-family', computedStyle.fontFamily); | |
| g.setAttribute('font-weight', computedStyle.fontWeight); | |
| g.setAttribute('font-style', computedStyle.fontStyle); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const rules = []; | |
| function collectRules(rule) { | |
| if(rule instanceof CSSMediaRule && window.matchMedia(rule.conditionText).matches) { | |
| rule.rules.forEach(collectRules); | |
| } else if(rule instanceof CSSSupportsRule) { | |
| try { | |
| if(CSS.supports(rule.conditionText)) { | |
| rule.cssRules.forEach(collectRules); | |
| } | |
| } catch(e) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Dice</title> | |
| </head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Graph Plotter</title> | |
| <script> | |
| let f = (x) => { | |
| return x * x; | |
| } |