'meta' styling

This commit is contained in:
nadrad 2022-09-09 21:35:23 +02:00
parent e4b4f9aaf3
commit 603dfbcdde

35
h-m-m
View file

@ -10,7 +10,7 @@ $mm['line_spacing'] = 1;
$mm['center_lock'] = false;
$mm['focus_lock'] = false;
$mm['initial_depth'] = 1;
$mm['show_logo'] = 1;
$mm['show_logo'] = 0;
$mm['active_node_color'] = "\033[38;5;0m\033[48;5;172m\033[1m";
$mm['message_color'] = "\033[38;5;0m\033[48;5;141m\033[1m";
@ -207,6 +207,7 @@ function debug($nodes)
.substr($data['title'],0,70)
."\n"
;
echo " id pr x w y yo h lh clh title\n";
}
@ -1404,21 +1405,26 @@ function export_html(&$mm)
(
$file
,'<!DOCTYPE html>'
.'<html>'
.'<html lang=en>'
.'<head>'
.'<title>'
.$mm['nodes'][ $mm['root'] ]['title']
.'</title>'
.'<meta charset="UTF-8">'
.'<meta name=viewport content="width=device-width,initial-scale=1,user-scalable=yes">'
.'<style>'
.'body { background-color: #222; color: #ddd; font-family: monospace; padding: 0; font-size: 16px; }'
.'#root {margin:10px 0}'
.'p:before { content: "━ "; }'
.'p, summary { padding: 8px; margin: 0; }'
.'details, p { padding-left: 29px; border-left: 3px solid #444; }'
.'p, summary { padding: 8px; margin: 0; font-size: 16px; }'
.'details, p { padding-left: 29px; border-left: 3px solid #444; font-size:16px; }'
.'summary { margin-left: -10px; cursor: pointer; }'
.'summary:hover, p:hover { color: #fbc531; }'
.'details:hover, p:hover { border-color: #e1b12c; }'
.'#source { position: absolute; bottom: 0; left: 0; padding: 5px 15px 8px 15px; margin: 100px 0 0 0; }'
.'#source { background-color: #333; border: none; box-sizing: border-box;}'
.'#source > summary { list-style: none; }'
.'#source[open] { position: static; margin: 100px 0 0 0; }'
.'#source[open] { position: static; margin: 100px 0 0 0; font-size: 16px; }'
.'#map { margin: 40px 30px; }'
.'</style>'
.'</head>'
@ -2208,6 +2214,24 @@ function display(&$mm, $force_center = false)
)
;
// dimming {meta}s
$line =
str_replace
(
'{'
,dim_on.'{'
,$line
);
$line =
str_replace
(
'}'
,'}'.dim_off
,$line
);
// adding the logo
if ($mm['show_logo']>0)
@ -2342,6 +2366,7 @@ load_settings($mm);
clear();
load_file($mm);
collapse_all($mm);
collapse_level($mm, $mm['initial_depth'], true);
build_map($mm);