Handwritten notebook style template for Polylux
0
fork

Configure Feed

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

Merge branch 'main' of github.com:polylux-typ/jotter

+87 -53
+6
README.md
··· 20 20 [Fantastque Sans Mono](https://github.com/belluzj/fantasque-sans/releases). 21 21 Either make sure you have them installed or specify other fonts in the template. 22 22 23 + This is an opinionated template on purpose. 24 + However, if you like the overall handwritten asthetic but prefer not to have the 25 + spiral binding to the left and/or the dots in the background, you can disable 26 + them by setting the `binding` and `dots` keyword arguments to `false` in the 27 + `setup` function. 28 + 23 29 ![thumbnail](thumbnail.png) 24 30 25 31
+70 -52
lib.typ
··· 4 4 5 5 #let highlight-color-state = state("jotter-highlight-color", red) 6 6 7 - #let setup(header: none, highlight-color: red, body) = { 7 + #let setup( 8 + header: none, 9 + highlight-color: red, 10 + binding: true, 11 + dots: true, 12 + body, 13 + ) = { 8 14 highlight-color-state.update(highlight-color) 9 15 set page( 10 16 paper: "presentation-16-9", 11 17 margin: (left: 2.3cm, top: 1cm, rest: 1cm), 12 - fill: tiling( 13 - spacing: (5mm, 5mm), 14 - { 15 - place(square(width: 6mm, stroke: none, fill: white)) 16 - circle(radius: 1pt, fill: white.darken(10%)) 17 - }, 18 - ), 19 - background: { 18 + fill: if dots { 19 + tiling( 20 + spacing: (5mm, 5mm), 21 + { 22 + place(square(width: 6mm, stroke: none, fill: white)) 23 + circle(radius: 1pt, fill: white.darken(10%)) 24 + }, 25 + ) 26 + }, 27 + background: if binding { 20 28 set align(top + left) 21 29 let gap = 1.5cm 22 30 let color = rgb("8aa") ··· 47 55 context box( 48 56 curve( 49 57 stroke: (thickness: .05em, cap: "round", paint: text.fill), 50 - curve.move((0em, 0em)), 51 58 curve.quad((.8em, -.9em), (1em, -2em)), 52 59 ), 53 60 ) ··· 62 69 let w = measure(header).width 63 70 curve( 64 71 stroke: (thickness: .05em, cap: "round", paint: text.fill), 65 - curve.move((0em, 0em)), 66 72 curve.quad((.25 * w, -.3em), (1.2 * w, 0em)), 67 73 ) 68 74 } ··· 86 92 move( 87 93 dy: -.8em, 88 94 curve( 89 - stroke: (thickness: .05em, cap: "round", paint: text.fill), 90 - curve.move((0em, 0em)), 95 + stroke: (thickness: .04em, cap: "round", paint: text.fill), 96 + fill: text.fill, 91 97 curve.quad((.75 * w, -.5em), (w, 0em)), 98 + curve.quad((w + .05em, .03em), (w, .06em)), 99 + curve.quad((.75 * w, -.495em), (0em, 0em)), 92 100 ), 93 101 ) 94 102 }) ··· 129 137 130 138 #let len2int(l) = int.from-bytes(l.pt().to-bytes()) 131 139 #let hasher(acc, val) = acc.bit-xor(val) 140 + #let hashed-position() = { 141 + let (x, y) = here().position() 142 + let n = counter("logical-slide").get() 143 + (len2int(x), len2int(y), ..n).reduce(hasher) 144 + } 132 145 133 146 #let framed-block( 134 147 body, ··· 148 161 let (width: w, height: h) = measure(..sz, blocked-body) 149 162 let deflect = sloppiness * (w + h) / 2 150 163 151 - let pos = here().position() 152 - let hash-components = ( 153 - pos.page, 154 - len2int(pos.x), 155 - len2int(pos.y), 156 - len2int(w), 157 - len2int(h), 158 - ) 159 - let hash = hash-components.reduce(hasher) 164 + let hash = (hashed-position(), len2int(w), len2int(h)).reduce(hasher) 160 165 let rng = suiji.gen-rng-f(hash) 161 166 let (rng, c1) = suiji.random-f(rng) 162 167 let (rng, c2) = suiji.random-f(rng) ··· 169 174 170 175 let c(p) = curve( 171 176 stroke: stroke(thickness: .1em, cap: "round", paint: p), 172 - curve.move((0pt, 0pt)), 173 177 curve.quad((c1 * w, s1 * deflect), (w + deflect / 3, 0pt)), 174 178 curve.move((w - deflect / 3, -deflect / 3)), 175 179 curve.quad((w + s2 * deflect, c2 * h), (w - deflect / 3, h + deflect / 3)), ··· 182 186 blocked-body 183 187 }) 184 188 185 - #let post-it(body, fill: rgb("#FDE85F"), angle: -10deg) = rotate( 186 - angle, 187 - reflow: true, 188 - { 189 - place( 190 - dx: .0em, 191 - dy: .0em, 192 - umbra.shadow-path( 193 - (1cm, 1cm), 194 - (1cm, 5cm), 195 - (5cm, 5cm), 196 - (5cm, 4.9cm), 197 - (4cm, 1cm), 198 - correction: 10deg, 199 - closed: false, 200 - ), 201 - ) 202 - place( 203 - curve( 204 - fill: fill, 205 - curve.line((5cm, 0cm)), 206 - curve.quad((5cm, 2.5cm), (5.2cm, 5cm)), 207 - curve.quad((2.5cm, 5.2cm), (.1cm, 5cm)), 208 - curve.quad((0cm, 2.5cm), (0cm, 0cm)), 209 - ), 210 - ) 211 - box(inset: .5em, width: 5cm, height: 5cm, clip: true, body) 212 - }, 213 - ) 189 + #let post-it( 190 + body, 191 + fill: rgb("#FDE85F"), 192 + angle: -10deg, 193 + sloppiness: .2, 194 + ) = context { 195 + let hash = hashed-position() 196 + let rng = suiji.gen-rng-f(hash) 197 + let (rng, angle-deviation) = suiji.uniform-f(rng, low: -1, high: 1) 198 + let angle = (1 + sloppiness * angle-deviation) * angle 199 + let (rng, color-deviation) = suiji.uniform-f(rng, low: -1, high: 1) 200 + let fill = fill.darken(sloppiness * color-deviation * 40%) 201 + 202 + rotate( 203 + angle, 204 + reflow: false, 205 + { 206 + place( 207 + dx: .0em, 208 + dy: .0em, 209 + umbra.shadow-path( 210 + (1cm, 1cm), 211 + (1cm, 5cm), 212 + (5cm, 5cm), 213 + (5cm, 4.9cm), 214 + (4cm, 1cm), 215 + correction: 10deg, 216 + closed: false, 217 + ), 218 + ) 219 + place( 220 + curve( 221 + fill: fill, 222 + curve.line((5cm, 0cm)), 223 + curve.quad((5cm, 2.5cm), (5.2cm, 5cm)), 224 + curve.quad((2.5cm, 5.2cm), (.1cm, 5cm)), 225 + curve.quad((0cm, 2.5cm), (0cm, 0cm)), 226 + ), 227 + ) 228 + box(inset: .5em, width: 5cm, height: 5cm, clip: true, body) 229 + }, 230 + ) 231 + }
+11 -1
template/slides.typ
··· 16 16 17 17 #show raw: set text(font: "Fantasque Sans Mono") 18 18 19 - #show: setup.with(header: [A short title], highlight-color: red) 19 + #show: setup.with( 20 + header: [A short title], 21 + highlight-color: red, 22 + binding: true, 23 + dots: true, 24 + ) 20 25 21 26 #title-slide[My interesting title][ 22 27 A subtitle ··· 71 76 72 77 #slide[ 73 78 = Highlighting content 79 + 80 + // #framed-block and #post-it accept a sloppiness parameter that determine how 81 + // randomized they are. 82 + // #framed-block also accepts inset, width, and height like the standard 83 + // #block. 74 84 75 85 #toolbox.side-by-side[ 76 86 #grid(
thumbnail.png

This is a binary file and will not be displayed.