Skip to content

Commit

Permalink
Merge branch 'dev' into stg
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoomREI committed Nov 21, 2024
2 parents bbb58bd + 884a119 commit 75b0b00
Show file tree
Hide file tree
Showing 21 changed files with 876 additions and 234 deletions.
1 change: 1 addition & 0 deletions wp-content/plugins/chris-buys-blocks/chris-buys-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function chris_buys_blocks_chris_buys_blocks_block_init()
's2-form-nhp',
's2-as-seen-on-carousel',

'cw-hero-v2',
'lead-form',
];

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions wp-content/plugins/chris-buys-blocks/src/cw-hero-v2/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chris-buys/cw-hero",
"version": "0.1.0",
"title": "cw Hero",
"category": "widgets",
"icon": "superhero-alt",
"description": "The Hero Section of the cw landing-page.",
"supports": {
"html": false
},
"textdomain": "chris-buys-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"render": "file:./render.php",
"viewScript": "file:./view.js",
"attributes": {
"selectedMarket": {
"type": "string",
"default": "St. Louis"
}
}
}
48 changes: 48 additions & 0 deletions wp-content/plugins/chris-buys-blocks/src/cw-hero-v2/edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { __ } from "@wordpress/i18n";
import {
InnerBlocks,
useBlockProps,
InspectorControls,
} from "@wordpress/block-editor";
import {
PanelBody,
SelectControl,
} from "@wordpress/components";
import "./editor.css";

// The edit function, which renders the block in the Gutenberg editor
export default function Edit({ attributes, setAttributes }) {
const { selectedMarket } = attributes;

const onChangeMarket = (newMarket) => {
setAttributes({ selectedMarket: newMarket });
};

return (
<div {...useBlockProps()}>
<InspectorControls>
<PanelBody title={__("Select Market", "chris-buys-blocks")}>
<SelectControl
label={__("Choose a Market", "chris-buys-blocks")}
value={selectedMarket}
options={[
{ label: "St. Louis", value: "St. Louis, Missouri" },
{ label: "San Francisco", value: "the Bay Area" },
{ label: "Kansas City", value: "Kansas City" },
{ label: "Detroit", value: "Metro Detroit" },
{ label: "Cleveland", value: "Cleveland" },
{ label: "Indianapolis", value: "Indianapolis" },
]}
onChange={onChangeMarket}
/>
</PanelBody>
</InspectorControls>

{/* Block Content */}
<div>
<h3>{__("CW Hero Placeholder", "chris-buys-blocks")}</h3>
<InnerBlocks />
</div>
</div>
);
}
10 changes: 10 additions & 0 deletions wp-content/plugins/chris-buys-blocks/src/cw-hero-v2/editor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.wp-block-chris-buys-cw-hero {
padding-block: 1.5rem !important;
background-color: #004c8d;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
color: white;
margin-block: 1rem !important;
}
10 changes: 10 additions & 0 deletions wp-content/plugins/chris-buys-blocks/src/cw-hero-v2/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { registerBlockType } from "@wordpress/blocks";
import "./style.css";
import Edit from "./edit";
import save from "./save";
import metadata from "./block.json";

registerBlockType(metadata.name, {
edit: Edit,
save: save,
});
88 changes: 88 additions & 0 deletions wp-content/plugins/chris-buys-blocks/src/cw-hero-v2/render.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php
// $formId = isset($attributes['formId']) ? esc_html($attributes['formId']) : '1';
$selectedMarket = isset($attributes['selectedMarket']) ? esc_html($attributes['selectedMarket']) : 'St. Louis, Missouri';

// Determine the name based on the selected market
if ($selectedMarket === "the Bay Area") {
$selectedName = "John";
} else {
$selectedName = "Chris";
}
?>

<section class="cw-hero-wrapper" style="
--background-image-small: url('<?php echo get_image_url('cw-hero/life-changes-hero-background', 768); ?>');
--background-image-medium: url('<?php echo get_image_url('cw-hero/life-changes-hero-background', 1024); ?>');
--background-image-large: url('<?php echo get_image_url('cw-hero/life-changes-hero-background', 2048); ?>');
">
<div class="cw-hero__content">
<div class="cw-hero__reviews">
<div class="cw-hero__reviews-stars-wrapper">
<?php for ($i = 0; $i < 5; $i++): ?>
<span class="cw-hero__star"><?php echo get_responsive_image('cw-hero/star', 'star'); ?></span>
<?php endfor; ?>
</div>
<div class="cw-hero__reviews-text">
<p>Rated <strong>4.7/5</strong> | Based on <strong>100+</strong> reviews</p>
</div>
</div>
<h1 class="cw-hero__title">We Buy ANY House In <span>ANY Condition, On YOUR Timeline</span></h1>
<div id="cw-form" class="cw-hero__form">
<div class="cw-hero__form-title">
<span>Get Your Offer In Record Time</span>
</div>
<div class="cw-hero__form-subtitle">
<span>Fill out the form. We’ll contact you ASAP.</span>
</div>
<?php echo $content; ?>

<div class="lead-form__disclaimer">
<p>Your Information is safe & secure</p>
</div>
</div>
<h3 class="cw-hero__subtitle">House to sell in <?php echo esc_html($selectedMarket); ?>? <strong>Get a cash offer in just 7 minutes</strong>, and get the sale closed as soon as you want to.</h3>
<ul class="cw-hero__bullet-points">
<li class="cw-hero__bullet-point"><?php echo get_responsive_image('cw-hero/check-circle', 'checkmark'); ?>
<span><strong>No need for you to clean</strong> or make repairs</span>
</li>
<li class="cw-hero__bullet-point"><?php echo get_responsive_image('cw-hero/check-circle', 'checkmark'); ?>
<span>No realtors, <strong>fees, banks, commissions,</strong> or inspectors</span>
</li>
<li class="cw-hero__bullet-point"><?php echo get_responsive_image('cw-hero/check-circle', 'checkmark'); ?>
<span>We pay all closing costs - <strong>you pay nothing</strong></span>
</li>
</ul>
<div class="cw-hero__content--footer">
<div class="cw-fresh-start__testimonial">
<?php echo get_responsive_image('cw-hero/hero-testimoniels', 'Leigh Williams', 'cw-fresh-start__testimonee'); ?>
<div class="cw-fresh-start__testimonial--content">
<blockquote>
<p>"We are very grateful for <?php echo esc_html($selectedName); ?> and his team's work. They were always professional and reliable, <?php echo esc_html($selectedName); ?> answered my first call right away and kept me updated throughout the whole selling process.”</p>
<cite>
<span>Liv Skyler</span>
<div class="cw-hero__reviews-stars-wrapper">
<?php for ($i = 0; $i < 5; $i++): ?>
<span class="cw-hero__star"><?php echo get_responsive_image('cw-hero/star', 'star'); ?></span>
<?php endfor; ?>
</div>
</cite>
</blockquote>
</div>
</div>
<ul class="cw-hero__statistic--list">
<li class="cw-hero__statistic--item">
<div class="cw-hero__statistic--amunt">36M+</div>
<div class="cw-hero__statistic--text">Saved <span>Fees</span></div>
</li>
<li class="cw-hero__statistic--item">
<div class="cw-hero__statistic--amunt">1,500+</div>
<div class="cw-hero__statistic--text">HOUSES <span>BOUGHT</span></div>
</li>
<li class="cw-hero__statistic--item">
<div class="cw-hero__statistic--amunt">96%</div>
<div class="cw-hero__statistic--text">SATISFIED <span>CUSTOMERS</span></div>
</li>
</ul>
</div>
</div>
</section>
5 changes: 5 additions & 0 deletions wp-content/plugins/chris-buys-blocks/src/cw-hero-v2/save.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { InnerBlocks } from "@wordpress/block-editor";

export default function save() {
return <InnerBlocks.Content />;
}
Loading

0 comments on commit 75b0b00

Please sign in to comment.