diff --git a/app.py b/app.py index 9b7bd0d..96c61d5 100644 --- a/app.py +++ b/app.py @@ -21,12 +21,9 @@ prefix = 'cobbled-pad-' collection = { 'stroke': { 'ascii': ' | ' , 'fonts': [] }, - 'script': { 'ascii': ' _/' , 'fonts': [] }, 'block': { 'ascii': '|_|' , 'fonts': [] }, - 'outline': { 'ascii': '/ /' , 'fonts': [] }, - 'effect': { 'ascii': ': :' , 'fonts': [] }, + 'open': { 'ascii': '/ /' , 'fonts': [] }, 'pattern': { 'ascii': '(((' , 'fonts': [] }, - 'fill': { 'ascii': '###' , 'fonts': [] }, '3d': { 'ascii': '_|/' , 'fonts': [] }, @@ -85,7 +82,7 @@ def text2figlet(text, figfont): return answer -def ascii2svg(ascii, weight='3', scale='1'): +def ascii2svg(ascii, weight='2', scale='1'): if ascii: print('--- SVGBOB SUBPROCESS') svgbob = subprocess.run([ @@ -98,6 +95,12 @@ def ascii2svg(ascii, weight='3', scale='1'): else: return "ERROR: etherpad request failed" +def styleSVG(svg): + with open('static/css/svg.css', 'r') as svg_css: + css = svg_css.read() + svg = svg.replace(' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/db/contributed/fill/3x5.svg b/static/db/contributed/fill/3x5.svg index 00347e1..206a684 100644 --- a/static/db/contributed/fill/3x5.svg +++ b/static/db/contributed/fill/3x5.svg @@ -1,5 +1,22 @@ - -
  • FIGfont make
  • FIGfont catalogue
  • +
  • gallery
  • diff --git a/templates/catalogue.html b/templates/catalogue.html index 1a0654e..4039f36 100644 --- a/templates/catalogue.html +++ b/templates/catalogue.html @@ -6,11 +6,11 @@
    - swan.flf + script.flf
    {% for type, type_data in collection.items()%} -
    - {{type}} {{type_data['ascii']}} +
    + {{type}}
    {% for database in databases.keys() %} @@ -37,28 +37,27 @@
    - + + - - - - - - + class="body-class-check" value="check-fix"/> --> + + +
    @@ -71,37 +70,27 @@ let new_url = new URL(svg_iframe.src); - function updateGET(frame, param, value){ - // object from GET parameters - let [base_src, params_src] = frame.src.split("?"); - let params = new URLSearchParams(params_src); - // update param - params.set(param, value); - // reconstituate URL - let new_src = base_src + "?" + params.toString(); - // set and refresh - frame.src = new_src; - } - // --- change current figfont for(let figfont of figfonts){ figfont.addEventListener('click', function(){ let encoded_path = figfont.dataset.path.split('/').join('$'); let figname = figfont.dataset.name; - let svg_src = svg_iframe.src; - svg_src = svg_src.split('/'); + let url = new URL(svg_iframe.src); + svg_src = url.pathname.split('/'); svg_src[svg_src.length-1] = encoded_path; svg_src = svg_src.join('/'); + url.pathname = svg_src; + console.log(url) current.innerHTML = figname; - new_url = new URL(svg_src); - document.getElementById('main').classList.add("reload"); document.getElementById('collection-menu').removeAttribute("open"); - svg_iframe.src = svg_src; + + new_url = url; + svg_iframe.src = new_url; }); } @@ -151,6 +140,18 @@ svg_iframe.addEventListener("load", function() { document.getElementById('main').classList.remove("reload"); }); + + let categories = document.getElementsByClassName('category'); + for(let category of categories){ + category.addEventListener('click', function(){ + console.log('closing') + for(let other of categories){ + if(other != category){ + other.removeAttribute('open'); + } + } + }) + } {% endblock %} diff --git a/templates/drawing.html b/templates/drawing.html index 3e89930..84c5289 100644 --- a/templates/drawing.html +++ b/templates/drawing.html @@ -5,6 +5,7 @@ + @@ -13,9 +14,9 @@
    - + title="display the remaining text and markers in the svg output in red"> + preview +
    diff --git a/templates/font.html b/templates/font.html index ba11935..5c3b95f 100644 --- a/templates/font.html +++ b/templates/font.html @@ -11,14 +11,13 @@
    - + + - - diff --git a/templates/gallery.html b/templates/gallery.html new file mode 100644 index 0000000..2cd4e43 --- /dev/null +++ b/templates/gallery.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} + +{% block body %} + + + +{% endblock %} + diff --git a/templates/index.html b/templates/index.html index bcd3f0d..0e2b822 100644 --- a/templates/index.html +++ b/templates/index.html @@ -27,18 +27,28 @@

    - + + - default + default - FIGlet font - Catalogue + FIGlet font + Catalogue @@ -48,7 +58,7 @@ - contributed + contributed @@ -58,7 +68,7 @@ - JAVe + JAVe @@ -68,7 +78,7 @@ - FIGlet font + FIGlet font @@ -79,15 +89,15 @@ - Etherpad + Etherpad - Free Ascii - drawing - + Free Ascii + drawing + asciiart.eu @@ -99,9 +109,9 @@ - FIGlet font - making - + FIGlet font + making + FIGfont Specs @@ -113,81 +123,81 @@ - ASCII + ASCII - /export/txt + /export/txt - /export/txt + /export/txt - FIGlet       + FIGlet       - SVG + SVG - svgbob.rs + svgbob.rs - svgbob specs + svgbob specs - HPGL + HPGL - vpype + vpype - SVG - simplified - & joined + SVG + simplified + & joined - vpype + vpype -
    +

    Like cobbled paths, none of those technologies are new, and we've been walking on them for years. Like cobbled paths, it is a reminder of the permeability between the discrete and the continuous, and how regular stones can form tortuous paths. -

    -
    +

    +
    {% endblock %} diff --git a/templates/writing.html b/templates/writing.html index f9def79..ab8b4ee 100644 --- a/templates/writing.html +++ b/templates/writing.html @@ -5,6 +5,7 @@ + @@ -15,8 +16,8 @@
    - + preview +