Initial commit: New MoreminiMore website with fresh design

This commit is contained in:
MoreminiMore
2026-04-22 01:59:05 +07:00
commit 76409638cc
14010 changed files with 2052041 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import { type AdobeProviderOptions, type GoogleFamilyOptions, type GoogleiconsFamilyOptions, type NpmProviderOptions, type NpmFamilyOptions } from 'unifont';
import type { FontProvider } from '../types.js';
import { type LocalFamilyOptions } from './local.js';
/** [Adobe](https://docs.astro.build/en/reference/font-provider-reference/#adobe) */
declare function adobe(config: AdobeProviderOptions): FontProvider;
/** [Bunny](https://docs.astro.build/en/reference/font-provider-reference/#bunny) */
declare function bunny(): FontProvider;
/** [Fontshare](https://docs.astro.build/en/reference/font-provider-reference/#fontshare) */
declare function fontshare(): FontProvider;
/** [Fontsource](https://docs.astro.build/en/reference/font-provider-reference/#fontsource) */
declare function fontsource(): FontProvider;
/** [Google](https://docs.astro.build/en/reference/font-provider-reference/#google) */
declare function google(): FontProvider<GoogleFamilyOptions | undefined>;
/** [Google Icons](https://docs.astro.build/en/reference/font-provider-reference/#google-icons) */
declare function googleicons(): FontProvider<GoogleiconsFamilyOptions | undefined>;
/** [Local](https://docs.astro.build/en/reference/font-provider-reference/#local) */
declare function local(): FontProvider<LocalFamilyOptions>;
/** [NPM](https://docs.astro.build/en/reference/font-provider-reference/#npm) */
declare function npm(options?: Omit<NpmProviderOptions, 'root' | 'readFile'>): FontProvider<NpmFamilyOptions | undefined>;
/**
* Astro exports a few built-in providers:
* - [Adobe](https://docs.astro.build/en/reference/font-provider-reference/#adobe)
* - [Bunny](https://docs.astro.build/en/reference/font-provider-reference/#bunny)
* - [Fontshare](https://docs.astro.build/en/reference/font-provider-reference/#fontshare)
* - [Fontsource](https://docs.astro.build/en/reference/font-provider-reference/#fontsource)
* - [Google](https://docs.astro.build/en/reference/font-provider-reference/#google)
* - [Google Icons](https://docs.astro.build/en/reference/font-provider-reference/#google-icons)
* - [Local](https://docs.astro.build/en/reference/font-provider-reference/#local)
* - [NPM](TODO:)
*/
export declare const fontProviders: {
adobe: typeof adobe;
bunny: typeof bunny;
fontshare: typeof fontshare;
fontsource: typeof fontsource;
google: typeof google;
googleicons: typeof googleicons;
local: typeof local;
npm: typeof npm;
};
export {};

141
node_modules/astro/dist/assets/fonts/providers/index.js generated vendored Normal file
View File

@@ -0,0 +1,141 @@
import {
providers
} from "unifont";
import { FontaceFontFileReader } from "../infra/fontace-font-file-reader.js";
import { LocalFontProvider } from "./local.js";
import { fileURLToPath } from "node:url";
import { readFile } from "node:fs/promises";
function adobe(config) {
const provider = providers.adobe(config);
let initializedProvider;
return {
name: provider._name,
config,
async init(context) {
initializedProvider = await provider(context);
},
async resolveFont({ familyName, ...rest }) {
return await initializedProvider?.resolveFont(familyName, rest);
},
async listFonts() {
return await initializedProvider?.listFonts?.();
}
};
}
function bunny() {
const provider = providers.bunny();
let initializedProvider;
return {
name: provider._name,
async init(context) {
initializedProvider = await provider(context);
},
async resolveFont({ familyName, ...rest }) {
return await initializedProvider?.resolveFont(familyName, rest);
},
async listFonts() {
return await initializedProvider?.listFonts?.();
}
};
}
function fontshare() {
const provider = providers.fontshare();
let initializedProvider;
return {
name: provider._name,
async init(context) {
initializedProvider = await provider(context);
},
async resolveFont({ familyName, ...rest }) {
return await initializedProvider?.resolveFont(familyName, rest);
},
async listFonts() {
return await initializedProvider?.listFonts?.();
}
};
}
function fontsource() {
const provider = providers.fontsource();
let initializedProvider;
return {
name: provider._name,
async init(context) {
initializedProvider = await provider(context);
},
async resolveFont({ familyName, ...rest }) {
return await initializedProvider?.resolveFont(familyName, rest);
},
async listFonts() {
return await initializedProvider?.listFonts?.();
}
};
}
function google() {
const provider = providers.google();
let initializedProvider;
return {
name: provider._name,
async init(context) {
initializedProvider = await provider(context);
},
async resolveFont({ familyName, ...rest }) {
return await initializedProvider?.resolveFont(familyName, rest);
},
async listFonts() {
return await initializedProvider?.listFonts?.();
}
};
}
function googleicons() {
const provider = providers.googleicons();
let initializedProvider;
return {
name: provider._name,
async init(context) {
initializedProvider = await provider(context);
},
async resolveFont({ familyName, ...rest }) {
return await initializedProvider?.resolveFont(familyName, rest);
},
async listFonts() {
return await initializedProvider?.listFonts?.();
}
};
}
function local() {
return new LocalFontProvider({
fontFileReader: new FontaceFontFileReader()
});
}
function npm(options) {
let initializedProvider;
return {
name: providers.npm()._name,
async init(context) {
initializedProvider = await providers.npm({
...options,
root: fileURLToPath(context.root),
readFile: (path) => readFile(path, "utf-8").catch(() => null)
})(context);
},
async resolveFont({ familyName, ...rest }) {
return await initializedProvider?.resolveFont(familyName, rest);
},
async listFonts() {
return await initializedProvider?.listFonts?.();
}
};
}
const fontProviders = {
adobe,
bunny,
fontshare,
fontsource,
google,
googleicons,
local,
npm
};
export {
fontProviders
};

View File

@@ -0,0 +1,57 @@
import type * as unifont from 'unifont';
import type { FontFileReader } from '../definitions.js';
import type { FamilyProperties, FontProvider, FontProviderInitContext, ResolveFontOptions, Style, Weight } from '../types.js';
type RawSource = string | URL | {
url: string | URL;
tech?: string | undefined;
};
interface Variant extends FamilyProperties {
/**
* Font [sources](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src). It can be a path relative to the root, a package import, or a URL. URLs are particularly useful if you inject local fonts through an integration.
*
* We recommend not putting your font files in [the `public/` directory](/en/reference/configuration-reference/#publicdir). Since Astro will copy these files into that folder at build time, this will result in duplicated files
* in your build output. Instead, store them somewhere else in your project, such as in `src/`.
*
* You can also specify a [tech](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src#tech) by providing objects:
*
* ```js
* src: [{ url:"./src/assets/fonts/MyFont.woff2", tech: "color-COLRv1" }]
* ```
*/
src: [RawSource, ...Array<RawSource>];
/**
* A [font weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight). If the associated font is a [variable font](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/Variable_fonts_guide), you can specify a range of weights:
*
* ```js
* weight: "100 900"
* ```
*
* When the value is not set, by default Astro will try to infer the value based on the first source.
*/
weight?: Weight | undefined;
/**
* A [font style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style).
*
* When the value is not set, by default Astro will try to infer the value based on the first source.
*/
style?: Style | undefined;
}
export interface LocalFamilyOptions {
/**
* The `options.variants` property is required. Each variant represents a [`@font-face` declaration](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/) and requires a `src`.
*/
variants: [Variant, ...Array<Variant>];
}
export declare class LocalFontProvider implements FontProvider<LocalFamilyOptions> {
#private;
name: string;
config?: Record<string, any> | undefined;
constructor({ fontFileReader, }: {
fontFileReader: FontFileReader;
});
init(context: Pick<FontProviderInitContext, 'root'>): void;
resolveFont(options: ResolveFontOptions<LocalFamilyOptions>): {
fonts: Array<unifont.FontFaceData>;
};
}
export {};

View File

@@ -0,0 +1,69 @@
import { createRequire } from "node:module";
import { fileURLToPath, pathToFileURL } from "node:url";
class LocalFontProvider {
name = "local";
config;
#fontFileReader;
#root;
constructor({
fontFileReader
}) {
this.config = void 0;
this.#fontFileReader = fontFileReader;
this.#root = void 0;
}
init(context) {
this.#root = context.root;
}
#resolveEntrypoint(root, entrypoint) {
const require2 = createRequire(root);
try {
return pathToFileURL(require2.resolve(entrypoint));
} catch {
return new URL(entrypoint, root);
}
}
#normalizeSource(value) {
const isValue = typeof value === "string" || value instanceof URL;
const url = (isValue ? value : value.url).toString();
const tech = isValue ? void 0 : value.tech;
return {
url: fileURLToPath(this.#resolveEntrypoint(this.#root ?? new URL(import.meta.url), url)),
tech
};
}
resolveFont(options) {
return {
fonts: options.options?.variants.map((variant) => {
const shouldInfer = variant.weight === void 0 || variant.style === void 0;
const data = {
// If it should be inferred, we don't want to set the value
weight: variant.weight,
style: variant.style,
src: [],
unicodeRange: variant.unicodeRange,
display: variant.display,
stretch: variant.stretch,
featureSettings: variant.featureSettings,
variationSettings: variant.variationSettings
};
data.src = variant.src.map((rawSource, index) => {
const source = this.#normalizeSource(rawSource);
if (shouldInfer && index === 0) {
const result = this.#fontFileReader.extract({
family: options.familyName,
url: source.url
});
if (variant.weight === void 0) data.weight = result.weight;
if (variant.style === void 0) data.style = result.style;
}
return source;
});
return data;
}) ?? []
};
}
}
export {
LocalFontProvider
};