Fantasy Empire Intercom.io Example

Size
6,606 Kb
Views
20,240

How do I make an fantasy empire intercom.io example?

This pen uses Babel to interpret ES6. It is a demo if intercom.io services. Author: Joshua Michael Waggoner. What is a fantasy empire intercom.io example? How do you make a fantasy empire intercom.io example? This script and codes were developed by Joshua Michael Waggoner on 11 October 2022, Tuesday.

Fantasy Empire Intercom.io Example Previews

Fantasy Empire Intercom.io Example - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Fantasy Empire Intercom.io Example</title> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Oswald|Lato|Roboto' rel='stylesheet' type='text/css'> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body> <div class="jumbotron"> <h1>Fantasy Empire &copy;</h1> <h2>The Best Place to Play Fantasy Sports</h2> </div> <h3 class="subheader">Customer Service Example</h3> <br/><br/> <!-- React components here --> <div id="login"></div> <!-- place above the closing body tag --> <script> var intercomSettings = { app_id: 'q9hk78xp' }; (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/q9hk78xp'; var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})() </script>
</body> <script src='http://cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Fantasy Empire Intercom.io Example - Script Codes CSS Codes

/*Style irrelevant but*/
body { font-family: 'Oswald'; margin: 25px; background-image: url("http://img0.gtsstatic.com/wallpapers/66d0b644e6f5590232aa0e64376bab97_large.jpeg"); background-repeat: no-repeat; background-attachment: fixed; background-position: bottom;
}
.jumbotron { text-align: center; padding: 20px; border-radius: 5px; background-color: rgba(34, 34, 34, 0.6); color: white;
}
h2 { font-family: 'Lato';
}
.subheader { margin-top: -10px; float: left; color: white;
}
#login button { width: 100px; float: left; background: #1c5cd4; color: white; border: none; font-size: 1.5em;
}
#login h4 { display: inline; float: left; color: yellow; margin-left: 20px;
}

Fantasy Empire Intercom.io Example - Script Codes JS Codes

'use strict';
// The app id (temporary)
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var app_id = 'q9hk78xp';
// Fill in the following info for team demo:
// These are the 'Customer Service' settings
// that get passed into the script
var id = '20';
var email = '[email protected]';
var name = 'rf';
/** * React self-updating login area */
var LoginArea = function (_React$Component) { _inherits(LoginArea, _React$Component); // Constructor function LoginArea() { _classCallCheck(this, LoginArea); var _this = _possibleConstructorReturn(this, _React$Component.call(this)); _this.state = { txt: 'out', btn: 'Login', loggedIn: false }; _this.handleClick = _this.handleClick.bind(_this); return _this; } // Function is bound to react // button's onClick event LoginArea.prototype.handleClick = function handleClick(e) { // Set state accordingly var loggedIn = !this.state.loggedIn; var txt = loggedIn ? 'in' : 'out'; var btntxt = loggedIn ? 'Logout' : 'Login'; this.setState({ loggedIn: loggedIn, txt: txt, btn: btntxt }); // Update the intercom service when user logs in updateIntercomServices(loggedIn); }; // Render LoginArea.prototype.render = function render() { return React.createElement( 'div', { 'class': 'loginarea' }, React.createElement(LoginButton, { txt: this.state.btn, toggle: this.handleClick }), React.createElement(LoginStatus, { txt: this.state.txt }) ); }; return LoginArea;
}(React.Component);
/** * LoginButton stateless component */
var LoginButton = function LoginButton(props) { return React.createElement( 'button', { className: 'btn btn-default', type: 'text', onClick: props.toggle }, props.txt );
};
/** * LoginStatus stateless component */
var LoginStatus = function LoginStatus(props) { return React.createElement( 'h4', null, 'You are logged ', props.txt );
};
/** * Updates the intercom.io interface */
var updateIntercomServices = function updateIntercomServices(loggedIn) { console.log("Logged in: " + loggedIn); if (loggedIn) { var settings = { // App id app_id: app_id, // The user email email: email != '' ? email : '[email protected]', // Optional unique id user_id: id != '' ? id : '1000', // Replace with Unix timestamp created_at: 1234567890, // Optional name name: name != '' ? name : 'John Doe' }; } // Re-run the script with settings runIntercomScript(settings);
};
// Render the react component
React.render(React.createElement(LoginArea, null), document.getElementById('login'));
/* * Run the intercom.io script */
var runIntercomScript = function runIntercomScript(settings) { var intercomSettings = settings; (function () { var w = window;var ic = w.Intercom;if (typeof ic === "function") { ic('reattach_activator');ic('update', intercomSettings); } else { var l = function l() { var s = d.createElement('script');s.type = 'text/javascript';s.async = true;s.src = 'https://widget.intercom.io/widget/q9hk78xp';var x = d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x); }; var d = document;var i = function i() { i.c(arguments); };i.q = [];i.c = function (args) { i.q.push(args); };w.Intercom = i;if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
};
/* * Ad blocker stuff * http://security.stackexchange.com/questions/36716/how-do-some-sites-detect-adblock-plus */
var amIHere = document.createElement("div");
amIHere.setAttribute("id", "amIHere");
document.body.appendChild(amIHere);
if (document.getElementById('amIHere')) { //alert("You're Alright");
} else { alert("You're using AdBlock Plus"); }
Fantasy Empire Intercom.io Example - Script Codes
Fantasy Empire Intercom.io Example - Script Codes
Home Page Home
Developer Joshua Michael Waggoner
Username rabbitfighter81
Uploaded October 11, 2022
Rating 3
Size 6,606 Kb
Views 20,240
Do you need developer help for Fantasy Empire Intercom.io Example?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Joshua Michael Waggoner (rabbitfighter81) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!