const STYLESHEET = ` * { box-sizing: border-box; } body, html { margin: 0; padding: 0; width: 100%; height: 100% } html { background-size: auto 100%; background-size: cover; background-position: center center; background-repeat: repeat-y; } body { display: flex; background-color: transparent; font-family: 'Open Sans', Arial, sans-serif; color: white; } h1 { font-size: 4.5vh; font-weight: 700; } h2 { font-size: 2.2vh; font-weight: normal; font-style: italic; opacity: 0.8; } h3 { font-size: 2.2vh; } h1, h2, h3, p, label { margin: 0; text-shadow: 0 0 1vh rgba(0, 0, 0, 0.15); } p { font-size: 1.75vh; } ul { font-size: 1.75vh; margin: 0; margin-top: 1vh; padding-left: 3vh; } a { color: green } a.install-link { text-decoration: none } .install-button { border: 0; outline: 0; color: white; background: #8A5AAB; padding: 1.2vh 3.5vh; margin: auto; text-align: center; font-family: 'Open Sans', Arial, sans-serif; font-size: 2.2vh; font-weight: 600; cursor: pointer; display: block; box-shadow: 0 0.5vh 1vh rgba(0, 0, 0, 0.2); transition: box-shadow 0.1s ease-in-out; } .install-button:hover { box-shadow: none; } .install-button:active { box-shadow: 0 0 0 0.5vh white inset; } #addon { width: 90vh; margin: auto; padding-left: 10%; padding-right: 10%; background: rgba(0, 0, 0, 0.60); } .logo { height: 14vh; width: 14vh; margin: auto; margin-bottom: 3vh; } .logo img { width: 100%; } .name, .version { display: inline-block; vertical-align: top; } .name { line-height: 5vh; } .version { position: absolute; line-height: 5vh; margin-left: 1vh; opacity: 0.8; } .contact { left: 0; bottom: 4vh; width: 100%; margin-top: 1vh; text-align: center; } .contact a { font-size: 1.4vh; font-style: italic; } .separator { margin-bottom: 4vh; } .label { font-size: 2.2vh; font-weight: 600; padding: 0; line-height: inherit; } .btn-group, .multiselect-container { width: 100%; } .btn { text-align: left; } .multiselect-container { border: 0; border-radius: 0; } .input, .btn { width: 100%; margin: auto; margin-bottom: 10px; padding: 6px 12px; border: 0; border-radius: 0; outline: 0; color: #333; background-color: rgb(255, 255, 255); box-shadow: 0 0.5vh 1vh rgba(0, 0, 0, 0.2); } .input:focus, .btn:focus { outline: none; box-shadow: 0 0 0 2pt rgb(30, 144, 255, 0.7); } `; import { Providers, QualityFilter, SizeFilter } from './filter.js'; import { SortOptions } from './sort.js'; import { LanguageOptions } from './languages.js'; import { DebridOptions } from '../moch/options.js'; import { MochOptions } from '../moch/moch.js'; import { PreConfigurations } from './configuration.js'; export default function landingTemplate(manifest, config = {}) { const providers = config[Providers.key] || Providers.options.map(provider => provider.key); const sort = config[SortOptions.key] || SortOptions.options.qualitySeeders.key; const languages = config[LanguageOptions.key] || []; const qualityFilters = config[QualityFilter.key] || []; const sizeFilter = (config[SizeFilter.key] || []).join(','); const limit = config.limit || ''; const debridProvider = Object.keys(MochOptions).find(mochKey => config[mochKey]); const debridOptions = config[DebridOptions.key] || []; const realDebridApiKey = config[MochOptions.realdebrid.key] || ''; const premiumizeApiKey = config[MochOptions.premiumize.key] || ''; const allDebridApiKey = config[MochOptions.alldebrid.key] || ''; const debridLinkApiKey = config[MochOptions.debridlink.key] || ''; const offcloudApiKey = config[MochOptions.offcloud.key] || ''; const putioKey = config[MochOptions.putio.key] || ''; const putioClientId = putioKey.replace(/@.*/, ''); const putioToken = putioKey.replace(/.*@/, ''); const background = manifest.background || 'https://dl.strem.io/addon-background.jpg'; const logo = manifest.logo || 'https://dl.strem.io/addon-logo.png'; const providersHTML = Providers.options .map(provider => ``) .join('\n'); const sortOptionsHTML = Object.values(SortOptions.options) .map((option, i) => ``) .join('\n'); const languagesOptionsHTML = LanguageOptions.options .map((option, i) => ``) .join('\n'); const qualityFiltersHTML = Object.values(QualityFilter.options) .map(option => ``) .join('\n'); const debridProvidersHTML = Object.values(MochOptions) .map(moch => ``) .join('\n'); const debridOptionsHTML = Object.values(DebridOptions.options) .map(option => ``) .join('\n'); const stylizedTypes = manifest.types .map(t => t[0].toUpperCase() + t.slice(1) + (t !== 'series' ? 's' : '')); const preConfigurationObject = Object.entries(PreConfigurations) .map(([key, config]) => `${key}: '${config.serialized}'`) .join(','); return ` ${manifest.name} - Stremio Addon

${manifest.name}

${manifest.version || '0.0.0'}

${manifest.description || ''}

This addon has more :

Or paste into Stremio search bar after clicking install

` }