My undergraduate thesis on a capability based security system for a data-centric operating system.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 135 lines 2.5 kB view raw
1#import "@preview/valkyrie:0.2.2" as z 2 3#let base_colors_schema = z.dictionary(( 4 bgcolor1: z.color(), 5 bgcolor2: z.color(), 6 textcolor1: z.color(), 7 textcolor2: z.color(), 8)) 9 10#let poster_section( 11 title, 12 body, 13 base_colors: none, 14 title_style: none, 15 fill: false, 16) = { 17 assert( 18 base_colors != none, 19 message: "Must provide base colors for the poster section!", 20 ) 21 assert( 22 title_style != none, 23 message: "Must provide title style for the poster section!", 24 ) 25 26 base_colors = z.parse(base_colors, base_colors_schema) 27 28 assert( 29 type(title_style) == function, 30 message: "title_style must be a partial application of text()", 31 ) 32 33 let fill_color = if fill { base_colors.bgcolor2 } else { none } 34 35 block( 36 width: 100%, 37 fill: fill_color, 38 inset: 20pt, 39 radius: 10pt, 40 stack( 41 align(center)[ 42 #(title_style)[#title] 43 #v(0.4em) 44 ], 45 v(0.4em), 46 line( 47 length: 100%, 48 stroke: ( 49 paint: base_colors.bgcolor1, 50 thickness: 3pt, 51 cap: "round", 52 ), 53 ), 54 v(0.6em), 55 text(fill: base_colors.textcolor1)[#body], 56 v(0.3em), 57 ), 58 ) 59} 60 61#let poster_header( 62 title, 63 author, 64 subtitle, 65 logo1, 66 logo2, 67 base_colors, 68) = { 69 set text(fill: base_colors.textcolor2) 70 set align(center + horizon) 71 72 stack( 73 dir: ttb, 74 block( 75 fill: base_colors.bgcolor1, 76 width: 100%, 77 height: 100%, 78 grid( 79 //SOME bs scaling for the baskin engineering logo 80 columns: (0.5fr, 4fr, 0.5fr), 81 if logo1 != none { logo1 } else [], 82 align(center + horizon)[ 83 #stack( 84 spacing: 45pt, 85 title, 86 author, 87 subtitle, 88 ) ], 89 // [], 90 //NOTE: there has to be a better way to do this 91 if logo2 != none { logo2 } else [], 92 ), 93 ), 94 ) 95} 96 97#let poster_footer(base_colors) = { 98 stack( 99 dir: ttb, 100 block( 101 fill: base_colors.bgcolor1, 102 width: 100%, 103 height: 100%, 104 ), 105 ) 106} 107 108 109#let poster( 110 title: "", 111 author: "", 112 base_colors: none, 113 subtitle: none, 114 logo1: none, 115 logo2: none, 116 doc, 117) = { 118 assert(base_colors != none, message: "Base Colors must be provided") 119 base_colors = z.parse(base_colors, base_colors_schema) 120 121 grid( 122 columns: 1, 123 rows: (13%, 83%, 4%), 124 poster_header( 125 title, 126 author, 127 subtitle, 128 logo1, 129 logo2, 130 base_colors, 131 ), 132 doc, 133 poster_footer(base_colors), 134 ) 135}