Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitcc7824a0ee168e8d4e0291ccc838bb3039cc0365 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-09-14 21:48:40 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-10-01 21:26:55 +0300
Files3c64a41e8fb24bf07557391948adc5dfba2f8c36
syndamia.com-cc7824a0ee168e8d4e0291ccc838bb3039cc0365.tar
syndamia.com-cc7824a0ee168e8d4e0291ccc838bb3039cc0365.tar.gz
syndamia.com-cc7824a0ee168e8d4e0291ccc838bb3039cc0365.zip
Parenta8172d879909c6d4eb8d26eaa770c60dcb786d37 (diff)
(Presentation) Implemented width ftag
3 files changed, 44 insertions, 3 deletions
-rw-r--r--awk-edits/Presentation.awk16
-rw-r--r--src/presentation.css29
-rw-r--r--src/styles.css2
diff --git a/awk-edits/Presentation.awk b/awk-edits/Presentation.awk
index e54e313..ca75327 100644
--- a/awk-edits/Presentation.awk
+++ b/awk-edits/Presentation.awk
@@ -50,6 +50,11 @@
# multiple elements into one table cell.
# &&/cont Ends (the last started) &&cont
#
+# &&widthPER Sets the element's width to be PER percentage. Primarily made
+# for images, since perfect scaling is impossible.
+# Available values for PER: 5, 10, 15, 20, ..., 90, 95
+# &&/width Text between &&widthPER and &&/width is sized accordingly
+#
# -- Surroundings --
#
# As stated, there can only be one presentation per page.
@@ -151,8 +156,16 @@ BEGIN {
ended[24] = 1
names[25] = "cont"
ended[25] = 1
+ names[26] = "&#47;width"
+ ended[26] = 0
+
+ nameslength = 26 # POSIX compatibility: length(names) isn't valid
- nameslength = 25 # POSIX compatibility: length(names) isn't valid
+ for (i = 5; i <= 95; i += 5) {
+ nameslength++
+ names[nameslength] = "width" i
+ ended[nameslength] = 0
+ }
pres = ORS \
"<nav id=\"presentCont\">" ORS \
@@ -186,6 +199,7 @@ BEGIN {
rep[ 5] = "<div class=\"layout-table fixed-layout\"><div class=\"layout-row\">" # <table><tr> (layout-row > * is td)
rep[ 6] = "</div><div class=\"layout-row\">" # </tr><tr>
rep[ 7] = "</div>" # &&/font
+ rep[26] = "</div>" # &&/width
presInsideCode = 0
slideIndex = 0
diff --git a/src/presentation.css b/src/presentation.css
index 9e9db8b..411f16b 100644
--- a/src/presentation.css
+++ b/src/presentation.css
@@ -66,7 +66,13 @@ article { overflow: hidden; }
.clide { display: flex; flex-direction: column; }
.clide > * { flex: 1; }
- .centered { text-align: center; }
+ .centered,
+ .centered .width5, .centered .width10, .centered .width15, .centered .width20,
+ .centered .width25, .centered .width30, .centered .width35, .centered .width40,
+ .centered .width45, .centered .width50, .centered .width55, .centered .width60,
+ .centered .width65, .centered .width70, .centered .width75, .centered .width80,
+ .centered .width85, .centered .width90, .centered .width95
+ { margin-left: auto; margin-right: auto; text-align: center; }
.fright { float: right; text-align: right; }
* + .fright { margin-left: 1em; }
@@ -85,6 +91,7 @@ article { overflow: hidden; }
padding: 0.1em;
vertical-align: middle;
}
+ .layout-row li { margin-left: 30px; }
.fixed-layout { table-layout: fixed; }
.font18 { font-size: 18px; }
@@ -104,6 +111,26 @@ article { overflow: hidden; }
.lineb8 { padding: 4.0em; }
.lineb9 { padding: 4.5em; }
+ .width5 { width: 5%; }
+ .width10 { width: 10%; }
+ .width15 { width: 15%; }
+ .width20 { width: 20%; }
+ .width25 { width: 25%; }
+ .width30 { width: 30%; }
+ .width35 { width: 35%; }
+ .width40 { width: 40%; }
+ .width45 { width: 45%; }
+ .width50 { width: 50%; }
+ .width55 { width: 55%; }
+ .width60 { width: 60%; }
+ .width65 { width: 65%; }
+ .width70 { width: 70%; }
+ .width75 { width: 75%; }
+ .width80 { width: 80%; }
+ .width85 { width: 85%; }
+ .width90 { width: 90%; }
+ .width95 { width: 95%; }
+
/* Presenting mode
absolute-slide {...} */
diff --git a/src/styles.css b/src/styles.css
index ac91267..57b1af9 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -384,7 +384,7 @@ dt, dd {
overflow: auto;
padding: 0 1em;
}
- article, .centered {
+ article {
margin-left: auto;
margin-right: auto;
}