承接 bnomei/kirby3-fontselector 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bnomei/kirby3-fontselector

Composer 安装命令:

composer require bnomei/kirby3-fontselector

包简介

Kirby Section to select font family and font weight with two synced fields

README 文档

README

Kirby 5 Release Discord Buymecoffee

Kirby Plugin to select font family and font weight with two synced fields

Installation

  • unzip master.zip as folder site/plugins/kirby3-fontselector or
  • git submodule add https://github.com/bnomei/kirby3-fontselector.git site/plugins/kirby3-fontselector or
  • composer require bnomei/kirby3-fontselector

Screenshot

fontselector

Fonts

Set the fonts you want to use with a config value. You could use a custom JSON file or return a php array.

assets/fonts.json

{
  "fonts": [
    {
      "font": "Merriweather",
      "weight": [
        600,
        700
      ]
    },
    {
      "font": "Montserrat",
      "weight": [
        300,
        400,
        500
      ]
    }
  ]
}
<?php

return [
    'bnomei.fontselector.fonts' => function() {
        return Json::read(kirby()->roots()->assets() . '/fonts.json');
        // return ['fonts' => [...]];
    },
    // other options
];

Usage

Add the fields to your page blueprint.

site/blueprints/default.yml

fields:
  headlinefont:
    type: fontfamily
    default: Merriweather
    required: true
    # reload: true # optional reload on save  
    
  headlineh1weight:
    type: fontweight
    watchField: headlinefont
    default: 700
    required: true
    
  headlineh2weight:
    type: fontweight
    watchField: headlinefont
    default: 600
    required: true

  copytextfont:
    type: fontfamily
    default: Montserrat
    required: true

  copytextweight:
    type: fontweight
    watchField: copytextfont
    default: 400
    required: true

Warning

This plugin has by default a 1 minute cache.

Settings

bnomei.fontselector. Default Description
fonts function(){...} callback to return the fonts array
expire 1 cache will expire n-minutes

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

统计信息

  • 总下载量: 93
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固