Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.58 KB | None | 0 0
  1. <!doctype html>
  2.  
  3. <html lang="en">
  4.  
  5. <head>
  6. <script src="https://cc.cdn.civiccomputing.com/8/cookieControl-8.2.1.min.js" integrity="sha384-5hK4cBe/+/7kp5VvBY+YbZl8L38bgcJwxfFcc+VrIPnPeMUoI6dcnyPSo4J9zeg4" crossorigin="anonymous"></script>
  7. <script>
  8. // Establish GA object but don't send anything yet
  9. window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
  10. ga('create', 'UA-98374795-9', 'auto');
  11. ga('send', 'pageview');
  12.  
  13.  
  14. var config = {
  15. apiKey: '7b97678ca6446369bc2be9786d7f73d5b9666768',
  16. product: 'PRO_MULTISITE',
  17. initialState: 'open',
  18. position: 'left',
  19. closeStyle: 'icon',
  20. statement : {
  21. description: 'Our Cookie Policy and Cookie preference management have changed. If you accept our recommended settings all Cookies, including analytics and marketing cookies will be enabled. For more information see our ',
  22. name : 'Cookies Policy',
  23. url: 'https://www.bestforbritain.org/cookies',
  24. updated : '06/09/2019'
  25. },
  26. text : {
  27. thirdPartyTitle : 'Warning: Some cookies require your attention',
  28. thirdPartyDescription : 'Consent for some third party cookies can not be automatically revoked. Please follow the link below if you want to opt out of them.',
  29. closeLabel: 'Save and close'
  30. },
  31. branding : {
  32. fontFamily: 'Roboto, Arial, Sans',
  33. removeAbout: true
  34. },
  35. optionalCookies: [
  36. {
  37. name : 'analytics',
  38. label: 'Analytics Cookies',
  39. recommendedState: true,
  40. description: 'We use Google Analytics to collect and report information on how visitors use this site so we can make it better.',
  41. cookies: ['_ga', '_gid', '_gat', '__utma', '__utmt', '__utmb', '__utmc', '__utmz', '__utmv'],
  42. onAccept : function(){
  43. var s = document.createElement('script');
  44. s.setAttribute('src', 'https://www.google-analytics.com/analytics.js');
  45. document.body.appendChild(s);
  46. },
  47. onRevoke: function(){
  48. // Disable Google Analytics
  49. window['ga-disable-UA-98374795-9'] = true;
  50. // End Google Analytics
  51. }
  52. },
  53. {
  54. name : 'marketing',
  55. label: 'Marketing Cookies',
  56. recommendedState: true,
  57. description: 'We use marketing cookies to help us improve the performance of advertising campaigns we run.',
  58. cookies: ['fr'],
  59. onAccept : function(){
  60. // Add Facebook Pixel
  61. !function(f,b,e,v,n,t,s)
  62. {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  63. n.callMethod.apply(n,arguments):n.queue.push(arguments)};
  64. if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
  65. n.queue=[];t=b.createElement(e);t.async=!0;
  66. t.src=v;s=b.getElementsByTagName(e)[0];
  67. s.parentNode.insertBefore(t,s)}(window,document,'script',
  68. 'https://connect.facebook.net/en_US/fbevents.js');
  69. fbq('init', '1871418283117093');
  70. fbq('track', 'PageView');
  71. fbq('consent', 'grant');
  72. // End Facebook Pixel
  73. },
  74. onRevoke: function() {
  75. fbq('consent', 'revoke');
  76. }
  77. },
  78. ]
  79. };
  80. CookieControl.load( config );
  81. </script>
  82. <meta charset="utf-8">
  83. <meta name="viewport" content="width=device-width, initial-scale=1,
  84. minimum-scale=1, maximum-scale=1">
  85. <title>GetVoting, tactically - by Best for Britain</title>
  86. <meta name="description" content="GetVoting.org">
  87. <meta name="author" content="BestforBritain.org">
  88. <meta http-equiv="x-ua-compatible" content="ie=edge">
  89.  
  90.  
  91. <meta name="Title" content="GetVoting, tactically - by Best for Britain">
  92. <meta name="Description"
  93. content="Join Best for Britain's campaign to #GetVoting, tactically. Together, we can stop Brexit.">
  94. <meta property="og:title" content="GetVoting, tactically." />
  95. <meta property="og:url" content="https://getvoting.org">
  96. <meta property="og:description"
  97. content="Join Best for Britain's campaign to #GetVoting, tactically. Together, we can stop Brexit.">
  98. <meta property="og:type" content="article">
  99. <link rel="image_src" href="https://getvoting.org/tactical/gvsocial.jpg" />
  100. <meta property="og:image" content="https://getvoting.org/tactical/gvsocial.jpg" />
  101. <meta property="og:site_name" content="GetVoting by Best for Britain" />
  102.  
  103. <meta name="twitter:card" content="summary_large_image">
  104. <meta name="twitter:site" content="@BestForBritain">
  105. <meta name="twitter:title" content="GetVoting, tactically.">
  106. <meta name="twitter:description" content="Join Best for Britain's campaign to #GetVoting, tactically. Together, we can stop Brexit.">
  107. <meta name="twitter:creator" content="@BestForBritain">
  108.  
  109. <meta name="twitter:image:src" content="https://getvoting.org/tactical/gvsocial.jpg">
  110. <link rel="icon" type="image/x-icon" href="https://getvoting.org/fav_getvoting.png" />
  111.  
  112.  
  113. <!--Import Google Icon Font-->
  114. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  115. <script src="jquery-3.4.1.min.js"></script>
  116. <!--swiper start-->
  117. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/css/swiper.min.css">
  118. <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/js/swiper.min.js"></script>
  119. <!--swiper end-->
  120. <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  121. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
  122. <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
  123. <link href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap" rel="stylesheet">
  124.  
  125.  
  126. <style>
  127. html,
  128. body {
  129. position: relative;
  130. height: 100%;
  131. display: flex;
  132. min-height: 100vh;
  133. flex-direction: column;
  134. /* background: #eee; */
  135. font-family: 'Lato', sans-serif;
  136. font-size: 14px;
  137. color: #fff;
  138. margin: 0;
  139. padding: 0;
  140. }
  141. main {
  142. flex: 1 0 auto;
  143. }
  144.  
  145. .swiper-container {
  146. width: 100%;
  147. height: 100%;
  148. margin-left: auto;
  149. margin-right: auto;
  150. }
  151.  
  152. .swiper-slide {
  153. text-align: center;
  154. font-size: 18px;
  155. background: #fff;
  156. /* Center slide text vertically */
  157. display: -webkit-box;
  158. display: -ms-flexbox;
  159. display: -webkit-flex;
  160. display: flex;
  161. -webkit-box-pack: center;
  162. -ms-flex-pack: center;
  163. -webkit-justify-content: center;
  164. justify-content: center;
  165. -webkit-box-align: center;
  166. -ms-flex-align: center;
  167. -webkit-align-items: center;
  168. align-items: center;
  169. }
  170. .swiper-slide .row {
  171. margin-top:50px;
  172. }
  173.  
  174. .swiper-pagination-bullet-active {
  175. background-color: #fbba00;
  176. }
  177.  
  178. h4 {
  179. font-weight: 700;
  180.  
  181. }
  182.  
  183. .color-1 {
  184. background-color: #2365cc;
  185. color: white;
  186. }
  187.  
  188. .color-2 {
  189. background-color: #ffffff;
  190. color: black;
  191. }
  192.  
  193. .brand-logo {
  194. top: 3px;
  195. position: absolute !important;
  196. left: 60px !important;
  197. }
  198.  
  199. .sidenav {
  200. background-color: rgba(255, 255, 255, 0.9);
  201. width: 250px !important;
  202. }
  203.  
  204. .sidenav li>a {
  205. font-size: large;
  206. }
  207.  
  208. .sidenav li:first-child {
  209. background-color: #fbba00;
  210. margin-top: 30px;
  211. }
  212.  
  213. a {
  214. color: #fbba00;
  215. }
  216.  
  217. .input-field {
  218. background-color: white;
  219. border-radius: 15px;
  220. }
  221.  
  222. .input-field>label {
  223. color: grey !important;
  224. }
  225.  
  226. input[type=text]:not(.browser-default) {
  227. border-bottom: 1px solid #fbba00;
  228. }
  229.  
  230. input[type=text]:not(.browser-default):focus:not([readonly]) {
  231. border-bottom: 1px solid #fbba00;
  232. box-shadow: 0 1px 0 0 #ffffff;
  233. }
  234.  
  235. .input-field>label:not(.label-icon).active {
  236. visibility: hidden;
  237. }
  238.  
  239. input {
  240. color: black;
  241. }
  242.  
  243. p {
  244. font-size: 1em;
  245. }
  246. .footer-text{
  247. font-size:xx-small;
  248. }
  249. </style>
  250.  
  251. </head>
  252.  
  253. <body class="color-1">
  254. <div class="navbar-fixed">
  255. <nav style="background-color:#2365cc">
  256. <div class="nav-wrapper">
  257. <a href="/" class="brand-logo"><img src="getvoting.png" height=80px></a>
  258. <a href="#" data-target="mobile-demo" class="sidenav-trigger right"><i
  259. class="material-icons">menu</i></a>
  260. <ul class="right hide-on-med-and-down">
  261. <li><a href="/">Tactical Voting</a></li>
  262. <li><a href="why-getvoting-works.html">Why GetVoting Works</a></li>
  263. <li><a href="about.html">About Us</a></li>
  264. <li><a href="faq.html">FAQs</a></li>
  265. </ul>
  266. </div>
  267. </nav>
  268. </div>
  269. <ul class="sidenav" id="mobile-demo">
  270. <li><a href="/">Tactical Voting</a></li>
  271. <li><a href="why-getvoting-works.html">Why GetVoting Works</a></li>
  272. <li><a href="about.html">About Us</a></li>
  273. <li><a href="faq.html">FAQs</a></li>
  274. <div class="col s12" style="position:absolute;bottom:70px;right:0;color:black;font-size:smaller;padding:10px">
  275. <img src="bfbblack.png" width="60%"><br>
  276. <a href="https://www.bestforbritain.org/privacy_policy">Privacy Policy</a> | <a href="https://www.bestforbritain.org/terms_of_use">Terms of Use</a> | <a href="https://www.bestforbritain.org/cookies">Cookies Policy</a><br><br>
  277. Published and promoted by Rudi Shenk on behalf of Best for Britain, the campaign name of UK-EU OPEN POLICY LIMITED registered at International House, 24 Holborn Viaduct, London, EC1A 2BN. Best for Britain is registered with The Electoral Commission.</div>
  278. </ul>
  279.  
  280. <div id="intro" class="container valign-wrapper">
  281.  
  282. <div class="row " style="position: absolute;top:100px;margin-right:15px">
  283. <div class="col s12">
  284. <p style="font-size:large">Use your vote to stop Brexit: find out which candidate in your area is the best chance of getting a Pro-EU MP.<br><br> Stop Boris Johnson's Brexit plan to take away our rights, our NHS, and our future in Europe.</p>
  285. </div>
  286.  
  287. <div class="col s12">
  288. <p>Enter your postcode to get your voting recommendation</p>
  289. </div>
  290. <form>
  291. <div class="input-field col s12" style="max-width:250px;">
  292. <input id="postcode" name="postcode" required type="text" value="">
  293. <label class="" for="postcode">Click to enter your postcode</label>
  294. <span id="postcodemessage" class="helper-text" data-error="Postcode not valid"></span>
  295. </div>
  296. <div class="col s12">
  297. <p><a id="findreco" class="waves-effect waves-light btn-large white black-text proceed"
  298. style="border-radius:20px;left:-11px;"><i class="material-icons right">emoji_people</i>Continue</a></p>
  299. </div>
  300. <div class="col s12" style="font-size:x-small">For information on how your data will be processed, see our <a href="https://www.bestforbritain.org/privacy_policy">privacy policy</a></div>
  301. <div class="col s12" style="margin-top:100px;font-size:xx-small;bottom:0px">
  302. <img src="bfblogo.png" style="max-width:100px"><br>
  303. <p>Published and promoted by Rudi Shenk on behalf of Best for Britain, the campaign name of UK-EU OPEN POLICY LIMITED registered at International House, 24 Holborn Viaduct, London, EC1A 2BN. Best for Britain is registered with The Electoral Commission.</p>
  304. <p><a href="https://www.bestforbritain.org/privacy_policy">Privacy Policy</a> | <a href="https://www.bestforbritain.org/terms_of_use">Terms of use</a> | <a href="https://www.bestforbritain.org/cookies">Cookies</a></p></div>
  305. </div>
  306. </form>
  307.  
  308. </div>
  309. <!-- <div class="row" style="position:fixed;bottom:0px;margin-top:100px;">
  310. <div class="col s12">
  311. <p>Published and promoted by Rudi Shenk on behalf of Best for Britain, the campaign name of UK-EU OPEN POLICY LIMITED registered at International House, 24 Holborn Viaduct, London, EC1A 2BN. Best for Britain is registered with The Electoral Commission.</p>
  312. <p><a href="https://www.bestforbritain.org/privacy_policy">Privacy Policy</a> | <a href="https://www.bestforbritain.org/terms_of_use">Terms of use</a> | <a href="https://www.bestforbritain.org/cookies">Cookies</a></p></div>
  313. </div>
  314. </div> -->
  315. </div>
  316. <div id="sw" class="swiper-container hide">
  317. <div class="swiper-wrapper">
  318.  
  319. <!-- Form starts here -->
  320. <!-- Slide 1 -->
  321. <div class="swiper-slide color-1">
  322. <img src="map.png" height="50%" style="position:absolute;top:0px;margin-bottom:30px">
  323. <div class="row">
  324. <div style="position:relative;top:80px">
  325. <h4>Your constituency is<br><span id="parlyconst"></span></h4>
  326. </div>
  327. <div class="col s12 " style="margin-top:60px">
  328. <p><span class="s1l2">See how voting tactically can make a difference</span></p>
  329. </div>
  330. <div class="col s12" style="position:absolute;bottom:50px;right:0">
  331. <p>Get your recommendation<i class="material-icons"
  332. style="top:10px;position:relative;font-size:xx-large">keyboard_arrow_down</i></p>
  333. </div>
  334. </div>
  335. </div>
  336. <!-- Slide 2 -->
  337. <div class="swiper-slide color-2">
  338. <div class="row">
  339. <p style="position:relative;top:-50px;padding:10px" class="s2l1">Constituency Name</p>
  340. <div class="col s10 offset-s1" style="position:relative;top:-50px">
  341. <span class="s2l2">We recommend that you vote for </span>
  342. <!-- <h4><span class="parlyparty"></span></h4> -->
  343. </div>
  344. <img class="partylogo" src="labour.png" style="max-width:200px">
  345. <div class="col s12" style="position:absolute;bottom:50px;right:0">
  346. <p style="font-size:1em" class="s2l3">Will this stop Brexit? <i class="material-icons"
  347. style="top:10px;position:relative;font-size:xx-large">keyboard_arrow_down</i></p>
  348. </div>
  349. </div>
  350. </div>
  351.  
  352. <!-- Slide 3 -->
  353. <div class="swiper-slide color-1">
  354. <div class="row">
  355. <div class="col s10 offset-s1">
  356. <h4 style="position:relative;top:-50px">Vote tactically</h4>
  357. <p style="position:relative;top:-50px" class="s3l1">Voting for in your seat is the best chance of electing a pro-Europe candidate and
  358. stopping Johnson. We’ve cut out all the confusion and the noise so you can vote tactically
  359. and help stop Brexit.</p>
  360. <p style="position:relative;top:-50px" class="s3l2">Voting for in your seat is the best chance of electing a pro-Europe candidate and
  361. stopping Johnson. We’ve cut out all the confusion and the noise so you can vote tactically
  362. and help stop Brexit.</p>
  363. <div class="col s12" style="position:absolute;bottom:50px;right:0">
  364. <p style="font-size:1em" class="s3l3">Why vote tactical? <i class="material-icons"
  365. style="top:10px;position:relative;font-size:xx-large">keyboard_arrow_down</i></p>
  366. </div>
  367. </div>
  368. </div>
  369. </div>
  370. <!-- Chart Slide 1 -->
  371. <div class="swiper-slide color-2 mrp1">
  372. <div class="row">
  373. <div class="col s10 offset-s1">
  374. <img style="position:relative;top:-50px;" class="mrpchart1 responsive-img materialboxed" src="c1.png"></img>
  375.  
  376.  
  377. </div>
  378. </div>
  379. </div>
  380. <!-- Chart Slide 2 -->
  381. <div class="swiper-slide color-2 mrp2">
  382. <div class="row">
  383. <div class="col s10 offset-s1">
  384. <img style="position:relative;top:-50px;" class="mrpchart2 responsive-img materialboxed" src="c2.png"></img>
  385.  
  386.  
  387. </div>
  388. </div>
  389. </div>
  390.  
  391.  
  392. <!-- Slide 4 -->
  393. <div class="swiper-slide color-2 slide4">
  394. <div class="row">
  395. <div class="col s10 offset-s1">
  396. <div class="card blue-grey darken-1">
  397. <div class="card-content white-text">
  398. <span class="card-title s4l1">Tactical Voting Works</span>
  399. <p class="s4l2" style="font-size:0.9em">Our recommendations are data-led, but we also take into account the local political situation. Our MRP analysis of polls conducted in October 2019 has a sample size of 46,000 voters. Some candidates have been asked to sign our pledge before we can recommend them. We hope to do another round of MRP before polling day to capture swings during the election campaign and will update our recommendations accordingly</p>
  400. </div>
  401.  
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406.  
  407. <!-- Slide 5-->
  408. <div class="swiper-slide color-2">
  409. <div class="row">
  410. <div class="col s10 offset-s1" style="position:relative;top:-50px">
  411. <p class="s5l1">Make sure you vote tactically to help a pro-Europe candidate win in your constituency.</p>
  412. </div>
  413. <div class="col s10 offset-s1" style="position:relative;top:-50px">
  414. <p class="s5l2">We recommend that you vote for</p>
  415. </div>
  416. <img class="partylogo" src="default.png" style="max-width:200px">
  417. <div class="col s12" style="position:absolute;bottom:50px;right:0">
  418. <p style="font-size:1em">Sign up to campaign updates <i class="material-icons"
  419. style="top:10px;position:relative;font-size:xx-large">keyboard_arrow_down</i></p>
  420. </div>
  421. </div>
  422. </div>
  423. <!--Slide 6 -->
  424. <div class="swiper-slide color-1">
  425. <div class="row">
  426. <div class="col s12" style="position:relative;top:-50px">
  427. <p>Sign up for updates about tactical voting and Best for Britain's campaign to stop Brexit.<br>Be part of the campaign today.</p>
  428. <a href="https://www.bestforbritain.org/signup-to-get-voting"
  429. class="waves-effect waves-light btn-large white black-text proceed"
  430. style="border-radius:20px"><i class="material-icons right">emoji_people</i>Sign up</a></p>
  431.  
  432. </div>
  433. <div class="col s12" style="position:absolute;bottom:50px;right:0">
  434. <div class="footer-text">
  435. <img src="bfblogo.png" style="max-width:100px"><br>
  436. <p><span>Published and promoted by Rudi Shenk on behalf of Best for Britain, the campaign name of UK-EU OPEN POLICY LIMITED registered at International House, 24 Holborn Viaduct, London, EC1A 2BN. Best for Britain is registered with The Electoral Commission.</span></p>
  437. <p><a href="https://www.bestforbritain.org/privacy_policy">Privacy Policy</a> | <a href="https://www.bestforbritain.org/terms_of_use">Terms of use</a> | <a href="https://www.bestforbritain.org/cookies">Cookies</a></p></div>
  438. </div>
  439. </div>
  440. </div>
  441.  
  442.  
  443. </div>
  444. <!-- Add Pagination -->
  445. <div class="swiper-pagination"></div>
  446. <br>
  447.  
  448.  
  449. <div class="col s12" style="position:absolute;bottom:0px;right:0">
  450. <p><a id="goback"><i class="material-icons"
  451. style="top:10px;position:relative;font-size:xx-large">keyboard_arrow_left</i>
  452. Back</a></p>
  453. </div>
  454.  
  455.  
  456. <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  457. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  458.  
  459. <script>
  460.  
  461. $('#postcode').on('input', function () {
  462.  
  463. if (this.value.length > 1) {
  464. var pcAPI = "https://api.postcodes.io/postcodes/"
  465. + this.value + "/autocomplete";
  466.  
  467. $.getJSON(pcAPI, function (data) {
  468. $("#postcode").autocomplete({
  469. source: data.result
  470. });
  471.  
  472. });
  473. }
  474. });
  475.  
  476. var mySwiper;
  477. var next_slide_added = 0;
  478. var prev_slide_added = 0;
  479. $(function () {
  480.  
  481. mySwiper = new Swiper('.swiper-container', {
  482. grabCursor: true,
  483. direction: 'vertical',
  484. initialSlide: 0,
  485. mousewheel: true,
  486.  
  487. pagination: {
  488. el: '.swiper-pagination',
  489. clickable: true,
  490. }
  491. })
  492. M.AutoInit();
  493. // $('#slide1').addClass('hide');
  494. // $('#slide2').addClass('hide');
  495. mySwiper.update();
  496. $('.tooltipped').tooltip();
  497. $('.materialboxed').materialbox();
  498.  
  499.  
  500.  
  501. });
  502. $('#findreco').click(function () {
  503. if ($('#postcode').val() != "") {
  504.  
  505.  
  506. var postAPI = "https://api.postcodes.io/postcodes/" + $('#postcode').val();
  507. $.getJSON(postAPI, {})
  508. .done(function (data) {
  509. parlycode = data.result.codes.parliamentary_constituency;
  510. country = data.result.country;
  511. constname = data.result.parliamentary_constituency;
  512.  
  513. if (parlycode == "") {
  514. console.log("Constituency not found");
  515. }
  516. $('#parlyconst').html(data.result.parliamentary_constituency);
  517. $.getJSON('NewData.json', function (recodata) {
  518.  
  519. found = 0;
  520. $.each(recodata, function (key, value) {
  521.  
  522. if (key == parlycode) {
  523.  
  524.  
  525. var individual=0;
  526. reco = value.Reco;
  527. console.log(reco);
  528. showMRP = value.ShowMRP;
  529. variation = value.Variation;
  530. partyname="";
  531.  
  532. // Insert data chart
  533.  
  534. if((reco!="none"|reco!="Pledge")&&(country=="England"|country=="Wales")){
  535. if(showMRP==1){
  536. console.log(showMRP);
  537. $('.mrp1').removeClass('hide');
  538. $('.mrp2').addClass('hide');
  539. fname= "charts/" + key + "_1.png";
  540. $('.mrpchart1').attr("src", fname);
  541. mySwiper.update();
  542.  
  543. }
  544. else if(showMRP==2){
  545. $('.mrp1').removeClass('hide');
  546. $('.mrp2').removeClass('hide');
  547. fname= "charts/" + key + "_1.png";
  548. $('.mrpchart1').attr("src", fname);
  549. fname= "charts/" + key + "_2.png";
  550. $('.mrpchart2').attr("src", fname);
  551. mySwiper.update();
  552. }
  553. else {
  554. $('.mrp1').addClass('hide');
  555. $('.mrp2').addClass('hide');
  556. mySwiper.update();
  557. }
  558.  
  559. } else {
  560. $('.mrp1').addClass('hide');
  561. $('.mrp2').addClass('hide');
  562. mySwiper.update();
  563.  
  564. }
  565.  
  566. if(reco=="Pledge"){
  567. //Slide1 code goes here
  568. }
  569. else if(reco=="none"){
  570. //Slide1 code goes here
  571. }
  572. else if(reco=="Lab"){
  573. partyname="The Labour Party";
  574. }
  575. else if(reco=="Lib Dem"){
  576. partyname="The Liberal Democrats";
  577. }
  578. else if(reco=="Green"){
  579. partyname="The Green Party";
  580. }
  581. else if(reco=="Plaid"){
  582. partyname="Plaid Cymru";
  583. }
  584. else if(reco=="LibLab"){
  585. partyname="Labour or the Liberal Democrats"
  586. }
  587. else {
  588. individual=1;
  589. partyname=reco;
  590. }
  591.  
  592. //Slide 1
  593. if(country=="Northern Ireland"){
  594. $('.s1l2').html("Vote for a candidate who represents you");
  595. }
  596. if(country=="Scotland"){
  597. $('.s1l2').html("Vote for a candidate who represents you");
  598. }
  599.  
  600. //Slide 2
  601. $('.s2l1').html(constname);
  602. if(country!="Northern Ireland"&&country!="Scotland"){
  603. if(reco=="Pledge"){
  604. //pledge variation here
  605. $('.s2l2').html("<span style='font-size:1.3em'>We're waiting to hear back from your candidates. Our recommendation is coming soon.</span>");
  606. $('.s2l3').html("When will we know? <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  607. }
  608. else if(reco=="LibLab") {
  609. $('.s2l2').html("<p>We recommend you vote for either the Labour or the Lib Dem candidate. Choose either and help a pro-European win.</p>");
  610. }
  611. else {
  612.  
  613. if(individual==1){
  614. //individual variation here
  615. $('.s2l2').html("<h4>We recommend you vote for " + partyname + ", your current MP</h4>");
  616. if(variation==7){
  617. $('.s2l2').html("<h4>We recommend you vote for " + partyname + ", the independent candidate</h4>");
  618. }
  619. } else{
  620. //party variation here
  621. $('.s2l2').html("<h4>We recommend you vote for " + partyname + " candidate</h4>");
  622. if(reco=="Lab"&&variation==6){
  623. $('.s2l1').html("You can stop Boris Johnson getting a majority in <b>" + constname + "</b> if you vote tactically here");
  624. }
  625. }
  626.  
  627. }
  628.  
  629. } else{
  630. if(country=="Scotland"){
  631. $('.s2l2').html("We have not made any specific recommendations in Scotland. Please vote for any candidate who supports staying in the EU.");
  632. }
  633. else if(country=="Northern Ireland"){
  634. $('.s2l2').html("We have not made any specific recommendations in Northern Ireland. Please vote for any candidate who supports staying in the EU.");
  635. }
  636. }
  637.  
  638. //Slide 3
  639. if(country!="Northern Ireland"&&country!="Scotland"){
  640. //England and Wales
  641. if(reco=="Pledge"){
  642. //pledge variation here
  643. $('.s3l1').html("We asked candidates in your area to sign our pledge to stop Brexit. We will use their reply to make our recommendation.");
  644. $('.s3l2').html("Check again before polling day or sign up for updates to get a reminder.");
  645. $('.s3l3').html("What's our pledge? <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  646. }
  647. else if(reco=="LibLab"){
  648. $('.s3l1').html("In your area, both Labour or Lib Dems could win and both have excellent pro-European credentials. We note your current Labour MP's excellent record on Europe in Parliament. ");
  649. $('.s3l2').html("Our data suggests neither the Brexit Party nor Tories can win here, unlike in other areas, so we feel safe not giving a recommendation.");
  650. }
  651. else {
  652. //EW candidate
  653. if(reco=="Lab"&&variation==6){
  654. $('.s3l1').html("Voting for " + partyname + " in your area is <b>the best chance</b> of stopping Boris Johnson getting a majority.");
  655. } else {
  656. $('.s3l1').html("Voting for " + partyname + " in your area is the best chance of electing a Pro-EU MP and stopping Brexit.");
  657. }
  658. if(reco=="Lab"&&variation==6){
  659. $('.s3l2').html("It's the only way to stop Brexit.");
  660. } else {
  661. $('.s3l2').html("We need a majority of MPs against Boris Johnson's Brexit plans.");
  662. }
  663.  
  664. $('.s3l3').html("Why vote tactically? <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  665. }
  666.  
  667. } else{
  668. if(country=="Scotland"){
  669. $('.s3l1').html("You can stop Boris Johnson getting a majority if you vote tactically here.");
  670. $('.s3l2').html("Use your vote for any candidate who wants to stop Brexit.");
  671. $('.s3l3').html("What next? <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  672. }
  673. else if(country=="Northern Ireland"){
  674. $('.s3l1').html("Many parties and candidates in Northern Ireland are Pro-European but some would not take their seats in the UK Parliament if elected. We want to avoid making confusing, inaccurate or counter-productive recommendations.");
  675. $('.s3l2').html("Use your vote for a candidate who best matches your views.");
  676. $('.s3l3').html("What next? <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  677. }
  678. }
  679.  
  680. //Slide 4
  681. if(country!="Northern Ireland"&&country!="Scotland"){
  682. //England and Wales
  683. if(reco=="Pledge"){
  684. //pledge variation here
  685. $('.s4l1').html("We asked candidates to sign our pledge:");
  686. $('.s4l2').html("<span style='font-size:small'>If elected, I pledge to vote in Parliament for any measures that would allow the UK to stay a member of the European Union and to give the people the final say on Brexit, with the option to remain in the EU.</span>");
  687.  
  688. }
  689. } else {
  690. $(".slide4").addClass("hide");
  691. mySwiper.update();
  692. }
  693.  
  694. //Slide 5
  695. if(country!="Northern Ireland"&&country!="Scotland"){
  696. //England and Wales
  697. if(reco=="Pledge"){
  698. //pledge variation here
  699. $('.s5l1').html("We've asked your candidates to pledge to stop Brexit.");
  700. $('.s5l2').html("Our recommendation is coming soon. Keep checking for updates.");
  701. $('.s5l3').html("Sign up for email updates <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  702. }
  703. else if(reco=="LibLab"){
  704. $('.s5l2').html("We recommend you vote for either the Labour or the Lib Dem candidate.");
  705.  
  706. }
  707. else {
  708. //EW candidate
  709. if(reco=="Lab"&&variation==6){
  710. $('.s5l1').html("Make sure you vote to<br><b>Stop Boris Johnson</b>");
  711. $('.s5l2').html("We recommend you vote for <br><b>" + partyname + "</b> candidate <br>in " + constname);
  712. $('.s5l3').html("Sign up to get updates <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  713. } else {
  714. $('.s5l1').html("Make sure you vote tactically to help a Pro-European win in your area");
  715. $('.s5l2').html("We recommend you vote for " + partyname);
  716. $('.s5l3').html("Sign up to get updates <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  717. }
  718. if(variation==7){
  719. $('.s5l2').html("<h4>We recommend you vote for " + partyname + ", the independent candidate</h4>");
  720. }
  721.  
  722. }
  723.  
  724. } else{
  725. if(country=="Scotland"){
  726. $('.s5l1').html("Make sure you vote for a Pro-European to win in your area");
  727. $('.s5l2').html("We recommend you vote for any candidate who supports staying in the EU.");
  728. $('.s5l3').html("Sign up to get updates <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  729. }
  730. else if(country=="Northern Ireland"){
  731. $('.s5l1').html("Make sure you vote for a Pro-European to win in your area");
  732. $('.s5l2').html("We recommend you vote for any candidate who supports staying in the EU.");
  733. $('.s5l3').html("Sign up to get updates <i class='material-icons' style='top:10px;position:relative;font-size:xx-large'>keyboard_arrow_down</i>");
  734. }
  735. }
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743. $('.parlyparty').html(partyname);
  744. console.log(partyname);
  745.  
  746. $('.partylogo').attr("src", "default.png");
  747. if (partyname == "The Labour Party") {
  748. $('.partylogo').attr("src", "labour.png");
  749. }
  750. if (partyname == "The Liberal Democrats") {
  751. $('.partylogo').attr("src", "ldem.png");
  752. }
  753. if (partyname == "The Green Party") {
  754. $('.partylogo').attr("src", "green.png");
  755. }
  756. if (partyname == "Plaid Cymru") {
  757. $('.partylogo').attr("src", "plaid.png");
  758. }
  759. if (partyname == "Conservatives") {
  760. $('.partylogo').attr("src", "cons.png");
  761. }
  762. if (partyname == "LibLab") {
  763. $('.partylogo').attr("src", "default.png");
  764. }
  765. $('.targetseat').removeClass('hide');
  766. found = 1;
  767.  
  768. }
  769. });
  770.  
  771.  
  772. });
  773. $('#intro').addClass('hide');
  774. $('#sw').removeClass('hide');
  775. mySwiper.update();
  776.  
  777. })
  778. .fail(function (data) {
  779. //JSON request failed"
  780. $('#postcode').addClass("invalid");
  781. });
  782.  
  783. } else {
  784. //field is empty"
  785. $('#postcode').addClass("invalid");
  786. }
  787.  
  788. });
  789.  
  790.  
  791.  
  792.  
  793.  
  794. </script>
  795.  
  796. </body>
  797.  
  798. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement