Go to file
2024-11-19 11:32:32 +01:00
assets_shared@b513d1ea6f Chore: Update git submodule web-assets to v2.0.0-alpha.46 2024-11-04 12:55:02 +01:00
dist Version: Bump from 1.1.3 to 1.2.0 2024-11-19 11:32:32 +01:00
js Fix: Increase style utility z-index for devfund-website 2024-01-04 10:48:07 +01:00
sass Chore: Add style variable re-assignment helper container-width 2024-11-19 11:29:44 +01:00
.gitignore Config: Create .gitignore 2023-11-20 11:36:51 +01:00
.gitmodules UI: Devfund-donation-box Web Assets v2 upgrade 2024-11-04 12:49:38 +01:00
build.sh Version: Bump from 1.1.3 to 1.2.0 2024-11-19 11:32:32 +01:00
embed-test.js Deploy: Bump from 1.0.9 to 1.0.10 2024-02-15 12:43:36 +01:00
index-message.html Remove mention of gift in donation box 2024-01-03 12:57:47 +01:00
index.html Remove mention of gift in donation box 2024-01-03 12:57:47 +01:00
main-donation-box-message.html Cleanup: Remove donation box message img badge 30 years 2024-11-19 11:12:06 +01:00
main-donation-box.html UI: Devfund-donation-box Web Assets v2 upgrade 2024-11-04 12:49:38 +01:00
package-lock.json UI: Devfund-donation-box Web Assets v2 upgrade 2024-11-04 12:49:38 +01:00
package.json UI: Devfund-donation-box Web Assets v2 upgrade 2024-11-04 12:49:38 +01:00
postcss.config.js UI: Add style overrides, resets and bg glossy dark mode 2023-12-01 16:51:19 +01:00
README.md Deploy: Bump from 1.0.9 to 1.0.10 2024-02-15 12:43:36 +01:00

Devfund Donation Box

Devfund Donation Box is a component to initialize donations to Blender Development Fund on internal and external websites.

Installation

Cloud

You can include Devfund Donation Box component directly from Blender's web infrastructure in your project.

  • Include the following JavaScript plugin in your markup before the closing <body> tag: <script src="https://fund.blender.org/static/fetch-donation-box.js"></script>

Self-hosting

Alternatively, you can self-host the Devfund Donation Box component. Initialize the library as a Git submodule in your project, following these steps:

  1. Run the following command to add the library as a submodule to the root directory of your project: git submodule add https://projects.blender.org/infrastructure/devfund-donation-box.git
  2. Run the following command to add the library as a submodule: git submodule init
  3. Include the following JavaScript plugin in your markup before the closing <body> tag: <script src="devfund-donation-box/dist/fetch-donation-box.js"></script>

Usage

Use the component in your project, following these steps:

  1. Call the following function by passing in the options object with required settings as an argument in your JavaScript:
fetchDonationBox({
  jsUrl: 'https://fund.blender.org/static/js/donation-box.js',
  selector: '#js-donation-box',
  url: 'https://fund.blender.org/static/donation-box.html'
});
  1. Add the following HTML code in your markup with the custom selector where you want the component to appear. For example, within .col-6:
<div class="col-6">
  <div id="js-donation-box"></div>
</div>

Options

Customize the component's display and settings with the following options:

Name Type Description Others
bgGlossy boolean Sets the component background to glossy, applying a 'frosted glass' effect. optional
darkMode boolean Sets the component colours to dark mode. optional
jsOnly boolean Activates JavaScript-only mode appending the component to the <body> tag. Useful for environments, where injecting scripts is only possible in <head>, or template markup is not editable. If jsOnly is true, selector option is ignored. optional
jsUrl string Sets the donation-box.js file path accordingly to installation type. required
selector string Sets the item's selector to append the component to. optional
url string Sets the component's file path accordingly to installation type. Valid component options are donation-box.html and donation-box-message.html. required

Build

Devfund Donation Box uses npm scripts to build component styles, and a Bash script to package styles, markup and JavaScript to a single HTML component as its build system.

  • Work on the sass/custom.css, main-donation-box.html, main-donation-box-message.html, and js/app.js source files respectively.
  • Install npm scripts by running npm install in the submodule root directory. Build styles with npm run-script css or npm run-script watch.
  • Build the HTML component donation boxes, and collect static assets by running ./build.sh in the submodule root directory.

Deploy

TODO: optionally add instructions on Devfund Donation Box's deployment to Blender's web infrastructure

Roadmap

  • Update README

Version

1.0.10