mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-16 02:05:36 +00:00
experimental cute CTA
This commit is contained in:
@@ -146,6 +146,9 @@ const puterInit = (function () {
|
||||
// debug flag
|
||||
debugMode = false;
|
||||
|
||||
// Whether to suppress the developer CTA in the console
|
||||
quiet = false;
|
||||
|
||||
/**
|
||||
* Puter.js Modules
|
||||
*
|
||||
@@ -499,6 +502,9 @@ const puterInit = (function () {
|
||||
// Handle the error here
|
||||
console.error('Error accessing localStorage:', error);
|
||||
}
|
||||
|
||||
// Print a CTA for developers to publish their app on the Puter App Store
|
||||
this.printDevCTA();
|
||||
} else if ( this.env === 'web-worker' || this.env === 'service-worker' || this.env === 'nodejs' ) {
|
||||
this.initSubmodules();
|
||||
}
|
||||
@@ -876,6 +882,32 @@ const puterInit = (function () {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Prints a styled CTA in the browser console encouraging developers
|
||||
* to publish their app on the Puter App Store.
|
||||
* @private
|
||||
*/
|
||||
printDevCTA = function () {
|
||||
if ( this.quiet || globalThis.PUTER_QUIET ) return;
|
||||
console.log(
|
||||
'%c╔═╗╦ ╦╔╦╗╔═╗╦═╗ ╦╔═╗\n' +
|
||||
'╠═╝║ ║ ║ ║╣ ╠╦╝ ║╚═╗\n' +
|
||||
'╩ ╚═╝ ╩ ╚═╝╩╚═ ╚╝╚═╝',
|
||||
'color: #000fd8; font-weight: bold; font-size: 16px; font-family: monospace;'
|
||||
);
|
||||
console.log(
|
||||
'%cSubmit your web app to the Puter App Store:\n' +
|
||||
'%chttps://apps.puter.com/',
|
||||
'color:rgb(0, 57, 137); font-size: 18px; font-weight: bold;',
|
||||
'color: #3b82f6; font-size: 18px; font-weight: bold; text-decoration: underline;'
|
||||
);
|
||||
console.log(
|
||||
'%c🔇 To disable this message: %cputer.quiet = true',
|
||||
'color: #94a3b8; font-size: 11px;',
|
||||
'color: #94a3b8; font-size: 11px; font-style: italic;'
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks and updates the GUI FS cache for most-commonly used paths
|
||||
* @private
|
||||
|
||||
Reference in New Issue
Block a user