Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace SolidAffiliate\Views\AffiliatePortal;
- use SolidAffiliate\Controllers\AffiliatePortalController;
- use SolidAffiliate\Lib\Formatters;
- use SolidAffiliate\Lib\FormBuilder;
- use SolidAffiliate\Lib\GlobalTypes;
- use SolidAffiliate\Lib\Settings;
- use SolidAffiliate\Lib\VO\AffiliatePortalViewInterface;
- use SolidAffiliate\Models\Affiliate;
- use SolidAffiliate\Models\AffiliatePortal;
- use SolidAffiliate\Models\Creative;
- use SolidAffiliate\Views\AffiliatePortal\AffiliatePortalTabsView;
- use SolidAffiliate\Views\Shared\SimpleTableView;
- // wp_enquue_script
- // -> wp_enqueue_style for frontend things (not admin)
- // patterns woocommerce uses.
- // - you use a shortcode
- // - you also define which page is your checkout page (in woocomerce admin settings)
- // this way they can load special shit on their checkout pages like css and js
- /**
- * @psalm-import-type PaginationArgs from \SolidAffiliate\Lib\GlobalTypes
- */
- class DashboardView
- {
- /**
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- public static function render($i)
- {
- $should_show_logout_link_on_affiliate_portal = (bool)Settings::get(Settings::KEY_IS_LOGOUT_LINK_ON_AFFILIATE_PORTAL);
- if ($i->affiliate->status != 'approved' && (bool)Settings::get(Settings::KEY_IS_HIDE_AFFILIATE_PORTAL_FROM_UNAPPROVED_AFFILIATES)) {
- return (string)Settings::get(Settings::KEY_UNAPPROVED_AFFILIATES_CONTENT);
- }
- $maybe_perma_link = get_permalink();
- $logout_url = $maybe_perma_link ? wp_logout_url($maybe_perma_link) : '/logout';
- //Get the active tab from the $_GET param
- $default_tab = null;
- $current_tab = isset($_GET['tab']) ? (string)$_GET['tab'] : $default_tab;
- ob_start();
- ?>
- <?php echo (self::render_js($i)) ?>
- <?php echo (self::render_css()) ?>
- <div id='<?php echo (GlobalTypes::AFFILIATE_PORTAL_HTML_ID) ?>'>
- <div class="sld-ap-grid_container">
- <div class="sld-ap-header">
- <div class="sld-ap-heading">
- <h2>Affiliate Portal</h2>
- </div>
- <div class="sld-ap-login">
- <?php echo get_avatar(wp_get_current_user()->ID) ?>
- <div class="sld-ap-login-user">
- <span>Logged in as</span>
- <div class="sld-ap-login-user_name">
- <?php echo (wp_get_current_user()->user_nicename) ?>
- </div>
- </div>
- <?php if ($should_show_logout_link_on_affiliate_portal) { ?>
- <a href="<?php echo ($logout_url) ?>" class="sld-ap-login-user_logout">
- <svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M1.75 2.875C1.75 2.25368 2.25366 1.75 2.875 1.75H12.875C13.4963 1.75 14 2.25368 14 2.875V3.875H15.75V2.875C15.75 1.28719 14.4628 0 12.875 0H2.875C1.28723 0 0 1.28719 0 2.875V13.875C0 15.4628 1.28723 16.75 2.875 16.75H12.875C14.4628 16.75 15.75 15.4628 15.75 13.875V11.875H14V13.875C14 14.4963 13.4963 15 12.875 15H2.875C2.25366 15 1.75 14.4963 1.75 13.875V2.875Z" />
- <path d="M1.75 2.875C1.75 2.25368 2.25366 1.75 2.875 1.75H12.875C13.4963 1.75 14 2.25368 14 2.875V3.875H15.75V2.875C15.75 1.28719 14.4628 0 12.875 0H2.875C1.28723 0 0 1.28719 0 2.875V13.875C0 15.4628 1.28723 16.75 2.875 16.75H12.875C14.4628 16.75 15.75 15.4628 15.75 13.875V11.875H14V13.875C14 14.4963 13.4963 15 12.875 15H2.875C2.25366 15 1.75 14.4963 1.75 13.875V2.875Z" />
- <path d="M10.4713 3.875L9.21301 5.16071L11.5135 7.51155H3.875V9.32982H11.4242L9.21313 11.5893L10.4713 12.875L14.875 8.375L10.4713 3.875Z" />
- <path d="M10.4713 3.875L9.21301 5.16071L11.5135 7.51155H3.875V9.32982H11.4242L9.21313 11.5893L10.4713 12.875L14.875 8.375L10.4713 3.875Z" />
- </svg>
- </a>
- <?php }; ?>
- </div>
- </div>
- <div class="sld-ap-info">
- <div class="sld-ap-info_col">
- <div class="sld-ap-info-box sld-ap-mr20">
- <span class="sld-ap-info-box-top">
- Affiliate Status
- </span>
- <p class="sld-ap-info-box-bottom sld-ap-affiliate-status-<?php echo ($i->affiliate->status) ?>">
- <?php echo (ucfirst((string)$i->affiliate->status)) ?>
- </p>
- </div>
- <div class="sld-ap-info-box sld-ap-mr20">
- <span class="sld-ap-info-box-top">
- Payment email
- </span>
- <p class="sld-ap-info-box-bottom">
- <?php echo ($i->affiliate->payment_email) ?>
- <!-- <a class="sld-ap-info-box_edit">
- <a href="edit-email.html" class="sld-ap-info-box_edit">
- <svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M0.666992 8.8125L7.12012 2.35938L9.30762 4.54688L2.85449 11H0.666992V8.8125ZM11.0029 2.85156L9.93652 3.91797L7.74902 1.73047L8.81543 0.664062C8.9248 0.554688 9.06152 0.5 9.22559 0.5C9.38965 0.5 9.52637 0.554688 9.63574 0.664062L11.0029 2.03125C11.1123 2.14062 11.167 2.27734 11.167 2.44141C11.167 2.60547 11.1123 2.74219 11.0029 2.85156Z" fill="#757575" />
- </svg>
- </a>
- </a> -->
- </p>
- </div>
- <div class="sld-ap-info-box">
- <span class="sld-ap-info-box-top">
- Account Email
- </span>
- <p class="sld-ap-info-box-bottom">
- <?php echo ($i->account_email) ?>
- </p>
- </div>
- </div>
- <div class="sld-ap-info_col">
- <div class="sld-ap-info-box sld-ap-mr20">
- <span class="sld-ap-info-box-top">
- Affiliate ID
- </span>
- <p class="sld-ap-info-box-bottom">
- <?php echo ($i->affiliate->id) ?>
- </p>
- </div>
- <div class="sld-ap-info-box">
- <span class="sld-ap-info-box-top">
- Your Affiliate Link
- </span>
- <p class="sld-ap-info-box-bottom sld-ap-affiliate-link"><a href="<?php echo ($i->affiliate_link) ?>"><?php echo ($i->affiliate_link) ?></a></p>
- </div>
- </div>
- </div>
- <?php echo AffiliatePortalTabsView::render(
- [
- ['referrals', 'Referrals'],
- ['visits', 'Visits'],
- ['payouts', 'Payouts'],
- ['coupons', 'Coupons'],
- ['creatives', 'Creatives'],
- ['urls', 'Affiliate Links'],
- ['settings', 'Settings'],
- ],
- $current_tab,
- GlobalTypes::AFFILIATE_PORTAL_HTML_ID
- ); ?>
- <div class="sld-ap-main sld-ap-main_<?php echo ($current_tab) ?>">
- <?php switch ($current_tab):
- case 'settings':
- echo self::render_account_settings($i);
- break;
- case 'referrals':
- echo self::render_referrals($i);
- break;
- case 'payouts':
- echo self::render_payouts($i);
- break;
- case 'visits':
- echo self::render_visits($i);
- break;
- case 'coupons':
- echo self::render_coupons($i);
- break;
- case 'urls':
- echo self::render_urls($i);
- break;
- case 'creatives':
- echo self::render_creatives($i);
- break;
- default:
- echo self::render_referrals($i);
- break;
- endswitch; ?>
- </div>
- <!-- <div class="sld-ap-footer">
- <div class="sld-ap-footer_notice">If you have any questions or concerns, please <a href="#">Contact us</a>.</div>
- </div> -->
- </div>
- </div>
- <?php
- $res = ob_get_clean();
- if ($res) {
- return $res;
- } else {
- return "Error rendering Affiliate Portal Dashboard.";
- }
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_account_settings_old($i)
- {
- ob_start();
- ?>
- <div class='solid-affiliate-affiliate-portal_account_settings'>
- <h5>Account Settings</h5>
- <?php
- $form_id = 'solid-affiliate-affiliate-portal_update_settings';
- $schema = AffiliatePortal::affiliate_settings_schema();
- $nonce = AffiliatePortalController::NONCE_SUBMIT_UPDATE_SETTINGS;
- $submit_action = AffiliatePortalController::POST_PARAM_SUBMIT_UPDATE_SETTINGS;
- $item = (object)$i->affiliate->attributes;
- ?>
- <form action="/" method="post" id="<?php echo $form_id ?>">
- <table class="form-table">
- <tbody>
- <?php echo FormBuilder::build_form($schema, 'edit', $item) ?>
- </tbody>
- </table>
- <input type="hidden" name="field_id" value="<?php echo (string)$item->id; ?>">
- <?php wp_nonce_field($nonce); ?>
- <?php submit_button(__("Update Settings", 'solid-affiliate'), 'primary', $submit_action); ?>
- </form>
- </div>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_account_settings($i)
- {
- $form_id = 'solid-affiliate-affiliate-portal_update_settings';
- $nonce = AffiliatePortalController::NONCE_SUBMIT_UPDATE_SETTINGS;
- $submit_action = AffiliatePortalController::POST_PARAM_SUBMIT_UPDATE_SETTINGS;
- $item = (object)$i->affiliate->attributes;
- ob_start();
- ?>
- <div class='solid-affiliate-affiliate-portal_account_settings'>
- <h3 class="sld-ap-title">
- Payment email
- </h3>
- <p class="sld-ap-description">Update your payment email.</p>
- <div class="sld-ap-edit-email">
- <form action="/" method="post" id="<?php echo $form_id ?>">
- <input type="text" name="payment_email" id="payment_email" class="regular-text" placeholder="Payment Email" value="" required="">
- <input type="hidden" name="field_id" value="<?php echo (string)$item->id; ?>">
- <?php wp_nonce_field($nonce); ?>
- <input type="submit" name="<?php echo ($submit_action) ?>" id="<?php echo ($submit_action) ?>" class="sld-ap-edit-email_button" value="Update Settings">
- </form>
- </div>
- </div>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_referrals($i)
- {
- // Referrals data
- // $referrals_table_headers = ['ID', 'Date', 'Source', 'Amount', 'Description', 'Status'];
- $referrals_table_headers = ['ID', 'Date', 'Source', 'Amount', 'Status'];
- $referrals_table_rows = array_map(
- /** @param \SolidAffiliate\Models\Referral $referral */
- function ($referral) {
- $formatted_date = date('F j, Y', strtotime($referral->created_at));
- $formatted_commission_amount = Formatters::money($referral->commission_amount);
- $formatted_status = Formatters::status($referral->status);
- $formatted_referral_source = ucfirst((string)$referral->referral_source);
- // return [$referral->id, $formatted_date, $formatted_referral_source, $formatted_commission_amount, $referral->description, $formatted_status];
- return [$referral->id, $formatted_date, $formatted_referral_source, $formatted_commission_amount, $formatted_status];
- },
- $i->referrals
- );
- ob_start();
- ?>
- <h3 class="sld-ap-title">
- Referrals
- </h3>
- <p class="sld-ap-description">Purchases or conversions that have been attributed back to your links and coupons.</p>
- <?php echo (SimpleTableView::render($referrals_table_headers, $referrals_table_rows, ['total_count' => $i->referrals_count], 'No data to display.', 'sld-ap-table')) ?>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_payouts($i)
- {
- // Payouts data
- $payouts_table_headers = ['ID', 'Date', 'Amount', 'Status'];
- $payouts_table_rows = array_map(
- function ($payout) {
- $formatted_date = date('F j, Y', strtotime($payout->created_at));
- $formatted_amount = Formatters::money($payout->amount);
- $formatted_status = Formatters::status($payout->status);
- return [$payout->id, $formatted_date, $formatted_amount, $formatted_status];
- },
- $i->payouts
- );
- ob_start();
- ?>
- <h3 class="sld-ap-title">
- Payouts
- </h3>
- <p class="sld-ap-description">Payouts which have been paid to you.</p>
- <?php echo (SimpleTableView::render($payouts_table_headers, $payouts_table_rows, ['total_count' => $i->payouts_count], 'No data to display.', 'sld-ap-table')) ?>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_visits($i)
- {
- // Visits data
- $visits_table_headers = ['ID', 'Date', 'Referral ID', 'Referring Page', 'Landing URL'];
- $visits_table_rows = array_map(
- function ($visit) {
- $formatted_date = date('F j, Y', strtotime($visit->created_at));
- return [$visit->id, $formatted_date, $visit->referral_id, $visit->http_referrer, $visit->landing_url];
- },
- $i->visits
- );
- ob_start();
- ?>
- <h3 class="sld-ap-title">
- Visits
- </h3>
- <p class="sld-ap-description">Visits which you've sent using your links.</p>
- <?php echo (SimpleTableView::render($visits_table_headers, $visits_table_rows, ['total_count' => $i->visits_count], 'No data to display.', 'sld-ap-table')) ?>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_coupons($i)
- {
- // Coupons data
- $coupons_table_headers = ['Code', 'Type', '# of Referrals'];
- $coupons_table_rows = $i->coupon_data;
- ob_start();
- ?>
- <h3 class="sld-ap-title">
- Coupons
- </h3>
- <p class="sld-ap-description">Coupons which have been linked to your account. You'll receive a referral for any purchases that use these coupons</p>
- <?php echo (SimpleTableView::render($coupons_table_headers, $coupons_table_rows, null, 'No data to display.', 'sld-ap-table')) ?>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_creatives($i)
- {
- ob_start();
- ?>
- <h3 class="sld-ap-title">
- Creatives
- </h3>
- <p class="sld-ap-description">Use these creatives on your site or social media to generate Referrals.</p>
- <div class="sld-ap-creatives_wrapper">
- <?php
- foreach ($i->creatives as $creative) {
- echo Creative::render_affiliate_portal_creative($creative, $i->affiliate->id);
- }
- ?>
- </div>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_account_details($i)
- {
- ob_start();
- ?>
- <div class='solid-affiliate-affiliate-portal_account_details'>
- <h5>Account Details</h5>
- <p>Account Email: <strong><?php echo ($i->account_email) ?></strong></p>
- <p>Payments Email: <strong><?php echo ($i->affiliate->payment_email) ?></strong></p>
- <p>Affiliate Status: <strong><?php echo ($i->affiliate->status) ?></strong></p>
- </div>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- *
- * @return string
- */
- private static function render_urls($i)
- {
- ob_start();
- ?>
- <div class='solid-affiliate-affiliate-portal_urls'>
- <h3 class="sld-ap-title">Affiliate Links</h3>
- <p class="sld-ap-description">To create an affiliate link to any page on this site, simply add <mark><strong>?<?php echo (string)Settings::get(Settings::KEY_REFERRAL_VARIABLE); ?>=<?php echo $i->affiliate->id ?></strong></mark> to the url. You can also use the URL generator below.</p>
- <hr>
- <p class="sld-ap-description">1) Enter any page URL from our site</p>
- <input style="width: 100%" id="sld-ap-page_url" name="page_url" type="text" value="<?php echo get_home_url() ?>">
- <br/><br/>
- <p class="sld-ap-description">2) Use your generated affiliate link</p>
- <mark>
- <span id="sld-ap-generated_affiliate_url"><?php echo ($i->affiliate_link) ?></span>
- </mark>
- <br/><br/>
- <p class="sld-ap-description">3) Use your QR</p>
- <mark>
- <span id="sld-ap-generated_affiliate_qr"><img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=<?php echo ($i->affiliate_link) ?>"/></span>
- </mark>
- </div>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @param AffiliatePortalViewInterface $i
- * @return string
- */
- private static function render_js($i)
- {
- ob_start();
- ?>
- <script>
- window.sldShowCreativeModal = function(creative_id) {
- var modal = document.getElementById("sld-ap-modal-" + creative_id);
- modal.style.display = "block";
- }
- window.sldHideCreativeModal = function(creative_id) {
- var modal = document.getElementById("sld-ap-modal-" + creative_id);
- modal.style.display = "none";
- }
- /**
- * Add a URL parameter (or changing it if it already exists)
- * @param {search} string this is typically document.location.search
- * @param {key} string the key to set
- * @param {val} string value
- */
- window.sldAddUrlParam = function(search, key, val) {
- try {
- var url = new URL(search);
- url.searchParams.append(key, val);
- return url;
- } catch (e) {
- return '<small>Invalid URL. Be sure to include the <code>https://</code> prefix.</small>';
- }
- };
- window.sldGenerateURLForCurrentAffiliate = function(search) {
- return window.sldAddUrlParam(search, <?php echo json_encode((string)Settings::get(Settings::KEY_REFERRAL_VARIABLE)) ?>, <?php echo ($i->affiliate->id) ?>);
- };
- window.sldMountURLGeneratorEvents = function() {
- const source = document.getElementById('sld-ap-page_url');
- const target = document.getElementById('sld-ap-generated_affiliate_url');
- const inputHandler = function(e) {
- const val = e.target.value;
- const generatedAffiliateURL = window.sldGenerateURLForCurrentAffiliate(val);
- target.innerHTML = generatedAffiliateURL;
- }
- source.addEventListener('input', inputHandler);
- };
- window.addEventListener('load',
- function() {
- window.sldMountURLGeneratorEvents();
- }, false);
- </script>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- /**
- * Undocumented function
- *
- * @return string
- */
- private static function render_css()
- {
- ob_start();
- ?>
- <style>
- :root {
- /* Global container color */
- --sld-ap-background: #fff;
- /* Shading background : Used for hovers and tables */
- --sld-ap-shading: #fafafa;
- /* Color scheme */
- --sld-ap-primary-color: #474747;
- --sld-ap-secondary-color: #757575;
- --sld-ap-accent-color: #4285F4;
- --sld-ap-border-color: #DADCE0;
- --sld-ap-border-radius: 10px;
- --sld-ap-font-size: 14px;
- --sld-ap-font-family: inherit;
- /* Font sizes */
- --sld-ap-font-size-xs: 12px;
- --sld-ap-font-size-m: 14px;
- --sld-ap-font-size-l: 20px;
- --sld-ap-font-size-xl: 22px;
- }
- /* Global layout/grid */
- .sld-ap {
- width: 100%;
- margin-left: auto;
- margin-right: auto;
- font-size: 1rem;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
- }
- .sld-ap-header {
- grid-area: header;
- }
- .sld-ap-info {
- grid-area: subheader;
- }
- .sld-ap-nav {
- grid-area: menu;
- }
- .sld-ap-main {
- grid-area: main;
- }
- .sld-ap-footer {
- grid-area: footer;
- }
- .sld-ap-grid_container {
- display: grid;
- grid-template-areas: 'header header header header header header''subheader subheader subheader subheader subheader subheader''menu main main main main main''menu footer footer footer footer footer';
- grid-gap: 0;
- background: var(--sld-ap-background);
- border: 1px solid var(--sld-ap-border-color);
- border-radius: var(--sld-ap-border-radius);
- }
- /* Menu Styling */
- ul.sld-ap-nav_menu {
- padding-top: 20px;
- text-align: left;
- }
- .sld-ap-nav ul {
- list-style: none;
- margin: 10px 0;
- padding-left: 0px;
- }
- ul.sld-ap-nav_menu>li a {
- display: block;
- font-size: var(--sld-ap-font-size-m);
- color: var(--sld-ap-primary-color);
- padding: 15px 25px;
- text-decoration: none !important;
- background: transparent;
- border-radius: 0 50px 50px 0;
- border-width: 1px 1px 1px 0;
- border-style: solid;
- border-color: transparent;
- }
- ul.sld-ap-nav_menu>li a:hover {
- background: var(--sld-ap-shading);
- }
- ul.sld-ap-nav_menu>li a.active {
- color: var(--sld-ap-accent-color);
- border-color: var(--sld-ap-border-color);
- }
- svg.sld-ap-nav_menu-icon {
- display: inline-block;
- width: 1.5em;
- height: 1.5em;
- vertical-align: middle;
- margin-right: 20px;
- color: var(--sld-ap-secondary-color);
- }
- ul.sld-ap-nav_menu>li a svg.sld-ap-nav_menu-icon {
- fill: var(--sld-ap-secondary-color);
- }
- ul.sld-ap-nav_menu>li a.active svg.sld-ap-nav_menu-icon {
- fill: var(--sld-ap-accent-color);
- }
- @media screen and (max-width: 760px) {
- ul.sld-ap-nav_menu>li span.sld-ap-nav_menu-title {
- display: none
- }
- svg.sld-ap-nav_menu-icon {
- margin-right: 0;
- }
- }
- /* Main Area styling */
- .sld-ap-main {
- padding: 20px;
- }
- h3.sld-ap-title {
- font-size: var(--sld-ap-font-size-l);
- font-weight: 600;
- margin-bottom: 10px;
- }
- p.sld-ap-description {
- color: var(--sld-ap-secondary-color);
- font-size: var(--sld-ap-font-size-m);
- }
- table.sld-ap-table {
- width: 100%;
- margin-top: 20px;
- font-size: var(--sld-ap-font-size-m);
- }
- table.sld-ap-table th {
- color: var(--sld-ap-secondary-color);
- text-transform: capitalize;
- }
- table.sld-ap-table td {
- color: var(--sld-ap-primary-color);
- max-width: 150px;
- min-width: 50px;
- word-wrap: break-word;
- }
- table.sld-ap-table td,
- table.sld-ap-table th {
- border: 1px solid var(--sld-ap-border-color);
- text-align: left;
- padding: 10px;
- }
- table.sld-ap-table tr:nth-child(even) {
- background: var(--sld-ap-shading);
- }
- .sld-ap-creatives_wrapper {
- margin-top: 20px;
- display: flex;
- flex-wrap: wrap;
- gap: 20px;
- }
- .sld-ap-creative_wrapper-card {
- flex-grow: 1;
- justify-content: space-between;
- width: 45%;
- }
- @media screen and (max-width: 760px) {
- .sld-ap-creative_wrapper-card {
- width: 100%
- }
- }
- .sld-ap-creative_wrapper-card_box {
- border: 1px solid var(--sld-ap-border-color);
- }
- .sld-ap-creative_wrapper-card_box img {
- height: 160px;
- width: 100%;
- margin: 0;
- object-fit: cover;
- object-position: right bottom;
- }
- .sld-ap-creative_wrapper-card_box-text {
- padding: 20px;
- word-wrap: break-word;
- }
- .sld-ap-creative_wrapper-card_box-text span {
- font-size: var(--sld-ap-font-size-xs);
- color: var(--sld-ap-secondary-color);
- }
- .sld-ap-creative_wrapper-card_box-text p {
- font-size: var(--sld-ap-font-size-m);
- color: var(--sld-ap-primary-color);
- margin-top: 4px;
- font-weight: 600
- }
- a.sld-ap-creative_wrapper-card_box-copy {
- background: var(--sld-ap-accent-color);
- text-decoration: none;
- color: #fff;
- width: auto;
- text-align: center;
- display: block;
- padding: 15px 20px;
- margin-top: 20px;
- font-size: var(--sld-ap-font-size-m);
- }
- .sld-ap-edit-email {
- margin-top: 20px;
- }
- .sld-ap-edit-email input {
- padding: 10px;
- border: 1px solid var(--sld-ap-border-color);
- }
- .sld-ap-edit-email input[type=text] {
- width: 50%;
- display: inline-block;
- }
- .sld-ap-edit-email .sld-ap-edit-email_button {
- background: var(--sld-ap-accent-color);
- border: transparent;
- color: #fff;
- }
- /* Subheader Styling */
- .sld-ap-info {
- border-color: var(--sld-ap-border-color);
- border-width: 1px 0 1px 0;
- border-style: solid;
- padding: 15px 20px;
- display: flex;
- flex-flow: row wrap;
- justify-content: space-between;
- }
- .sld-ap-info_col {
- display: flex;
- flex-flow: row wrap;
- }
- .sld-ap-mr20 {
- margin-right: 20px;
- }
- @media screen and (max-width: 800px) {
- .sld-ap-info {
- justify-content: start
- }
- .sld-ap-info_col {
- flex-direction: column;
- }
- .sld-ap-mr20 {
- margin-right: 30px;
- margin-bottom: 10px;
- }
- }
- span.sld-ap-info-box-top {
- font-size: var(--sld-ap-font-size-xs);
- display: block;
- margin-bottom: 5px;
- color: var(--sld-ap-secondary-color);
- }
- p.sld-ap-info-box-bottom,
- .sld-ap-info-box-bottom a {
- font-size: var(--sld-ap-font-size-m);
- color: var(--sld-ap-primary-color);
- font-weight: 600;
- text-decoration: none;
- }
- /* Header styling */
- .sld-ap-header {
- padding: 15px 20px;
- display: flex;
- flex-flow: row wrap;
- justify-content: space-between;
- align-items: center;
- }
- .sld-ap-header h2 {
- font-size: var(--sld-ap-font-size-xl);
- font-weight: 600;
- }
- .sld-ap-header .sld-ap-login {
- display: flex;
- align-items: center;
- }
- .sld-ap-header .sld-ap-login img {
- width: 35px;
- height: 35px;
- display: inline-block;
- vertical-align: top;
- border-radius: 50%;
- }
- .sld-ap-header .sld-ap-login-user {
- display: inline-block;
- vertical-align: middle;
- margin-left: 10px;
- }
- .sld-ap-header .sld-ap-login-user span {
- font-size: var(--sld-ap-font-size-xs);
- color: var(--sld-ap-secondary-color);
- }
- .sld-ap-header .sld-ap-login-user .sld-ap-login-user_name {
- margin-top: 3px;
- font-size: var(--sld-ap-font-size-m);
- color: var(--sld-ap-primary-color);
- font-weight: 600;
- }
- a.sld-ap-login-user_logout {
- display: inline-block;
- margin-top: 5px;
- color: var(--sld-ap-accent-color);
- }
- .sld-ap-login-user_logout svg {
- fill: var(--sld-ap-primary-color);
- margin-left: 10px;
- }
- /* Footer styling */
- .sld-ap-footer {
- padding: 12px 20px;
- border: 1px solid var(--sld-ap-border-color);
- margin: 0 20px 20px;
- height: 15px;
- }
- .sld-ap-footer_notice {
- font-size: var(--sld-ap-font-size-xs);
- }
- .sld-ap-affiliate-status-approved {
- color: #0F9D58 !important;
- }
- .sld-ap .sld_pagination {
- margin-top: 20px;
- font-size: --sld-ap-font-size-xs;
- }
- /* Modal styling */
- /* The Modal (background) */
- .sld-ap-modal {
- display: none;
- /* Hidden by default */
- position: fixed;
- /* Stay in place */
- z-index: 1;
- /* Sit on top */
- padding-top: 100px;
- /* Location of the box */
- left: 0;
- top: 0;
- width: 100%;
- /* Full width */
- height: 100%;
- /* Full height */
- overflow: auto;
- /* Enable scroll if needed */
- background-color: rgb(0, 0, 0);
- /* Fallback color */
- background-color: rgba(0, 0, 0, 0.4);
- /* Black w/ opacity */
- }
- /* Modal Content */
- .sld-ap-modal-content {
- background-color: #fefefe;
- margin: auto;
- padding: 20px;
- border: 1px solid #888;
- width: 80%;
- }
- /* The Close Button */
- .sld-ap-close-modal {
- color: #aaaaaa;
- float: right;
- font-size: 28px;
- font-weight: bold;
- }
- .sld-ap-close-modal:hover,
- .sld-ap-close-modal:focus {
- color: #000;
- text-decoration: none;
- cursor: pointer;
- }
- </style>
- <?php
- $res = ob_get_clean();
- return $res;
- }
- }
Add Comment
Please, Sign In to add comment