Also push up the ttf font
This commit is contained in:
parent
d058278cb2
commit
3a9e6f0fc4
3 changed files with 20 additions and 11 deletions
|
@ -1,9 +1,10 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>FluentUI Emoji</title>
|
||||
<link rel="stylesheet" href="/css/SegoeUIEmoji.css">
|
||||
<link rel="stylesheet" id="emoji-css" href="/css/animated.css">
|
||||
<style>
|
||||
body {display: flex; flex-flow: row wrap; justify-content:space-evenly; gap: 20px; background-color: #fff; color: #000; font-size: 18px; font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}
|
||||
body {display: flex; flex-flow: row wrap; justify-content:space-evenly; gap: 20px; background-color: #fff; color: #000; font-size: 18px; font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, SegoeUIEmoji, 'Segoe UI Emoji';}
|
||||
body{ --fluentui-high-contrast-color:#0088FF; }
|
||||
figure {text-align: center;}
|
||||
figure>:not(figcaption) { width: 256px; height: 256px; display:block; }
|
||||
|
|
28
index.ts
28
index.ts
|
@ -10,9 +10,10 @@ const cssDir = distDir + '/css'
|
|||
if(!await exists(cssDir)) await mkdir(cssDir)
|
||||
|
||||
// setup input dirs
|
||||
const fluentDir = (process.env.FLUENTUI_EMOJI_DIR || './sources/fluentui-emoji') + '/assets'
|
||||
const sourcesDir = (process.env.SOURCES_DIR || './sources')
|
||||
const fluentDir = (process.env.FLUENTUI_EMOJI_DIR || sourcesDir + '/fluentui-emoji') + '/assets'
|
||||
const fluentList = await readdir(fluentDir)
|
||||
const animatedDir = (process.env.ANIMATED_FLUENT_EMOJIS_DIR || './sources/Animated-Fluent-Emojis') + '/Emojis'
|
||||
const animatedDir = (process.env.ANIMATED_FLUENT_EMOJIS_DIR || sourcesDir + '/Animated-Fluent-Emojis') + '/Emojis'
|
||||
const animatedCatList = await readdir(animatedDir)
|
||||
|
||||
// generate a list of all the animated emojis,
|
||||
|
@ -86,7 +87,7 @@ await Promise.all(fluentList.map(async (folder) => {
|
|||
case 'keycap #': imgAnimPath = animatedList.get("keycap number sign"); break;
|
||||
case 'keycap *': imgAnimPath = animatedList.get("keycap asterisk"); break;
|
||||
case 'pouting face': imgAnimPath = animatedList.get("enraged face"); break;
|
||||
case 'melting face': imgAnimPath = './sources/melting-face_1fae0.png'; break;
|
||||
case 'melting face': imgAnimPath = sourcesDir + '/melting-face_1fae0.png'; break;
|
||||
default: console.warn(`could not find animated ${metadata.glyph} ${inAnim}. Defaulting to 3D version: ${img3DPath}`)
|
||||
}
|
||||
}
|
||||
|
@ -120,12 +121,12 @@ await Promise.all(fluentList.map(async (folder) => {
|
|||
}))
|
||||
|
||||
// create file references for the css files
|
||||
const cssAnim = Bun.file(path.join(cssDir, 'animated.css'))
|
||||
const css3d = Bun.file(path.join(cssDir, '3d.css'))
|
||||
const cssColor = Bun.file(path.join(cssDir, 'color.css'))
|
||||
const cssFlat = Bun.file(path.join(cssDir, 'flat.css'))
|
||||
const cssHighContrast = Bun.file(path.join(cssDir, 'high-contrast.css'))
|
||||
const cssHighContrastMask = Bun.file(path.join(cssDir, 'high-contrast-mask.css'))
|
||||
const cssAnim = Bun.file(cssDir + '/animated.css')
|
||||
const css3d = Bun.file(cssDir + '/3d.css')
|
||||
const cssColor = Bun.file(cssDir + '/color.css')
|
||||
const cssFlat = Bun.file(cssDir + '/flat.css')
|
||||
const cssHighContrast = Bun.file(cssDir + '/high-contrast.css')
|
||||
const cssHighContrastMask = Bun.file(cssDir + '/high-contrast-mask.css')
|
||||
|
||||
// output the css files
|
||||
await Bun.write(cssAnim, cssRules.animated.join('\n'))
|
||||
|
@ -135,8 +136,15 @@ await Bun.write(cssFlat, cssRules.flat.join('\n'))
|
|||
await Bun.write(cssHighContrast, cssRules.highContrast.join('\n'))
|
||||
await Bun.write(cssHighContrastMask, `:root{--fluentui-high-contrast-color:#212121}\n${cssRules.highContrastMask.join('\n')}`)
|
||||
|
||||
// do the same for the font
|
||||
const fontSrc = Bun.file(sourcesDir + '/seguiemj.ttf')
|
||||
const fontDst = Bun.file(distDir + '/seguiemj.ttf')
|
||||
const cssFont = Bun.file(cssDir + '/SegoeUIEmoji.css')
|
||||
await Bun.write(fontDst, fontSrc)
|
||||
await Bun.write(cssFont, /*css*/`@font-face{font-family:SegoeUIEmoji;src:url(/seguiemj.ttf);}`)
|
||||
|
||||
const templateHtml = Bun.file('./index.html')
|
||||
const html = (await templateHtml.text()).replace('{{content}}', htmlTags.join('\n '))
|
||||
|
||||
const htmlFile = Bun.file(path.join(distDir, 'index.html'))
|
||||
const htmlFile = Bun.file(distDir + '/index.html')
|
||||
await Bun.write(htmlFile, html)
|
BIN
sources/seguiemj.ttf
Normal file
BIN
sources/seguiemj.ttf
Normal file
Binary file not shown.
Loading…
Reference in a new issue