Nessuna descrizione

config.js 3.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. 'use strict';
  2. import newsletter from "./newsletterZeit";
  3. // import newsletter from "./newsletterBahn";
  4. const autoHeightHtml0 = newsletter;//`<p style="font-weight: 400;font-style: normal;font-size: 21px;line-height: 1.58;letter-spacing: -.003em;"><a href="https://github.com/iou90/react-native-autoheight-webview">Tags</a> are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. <span style="background-color: transparent !important;background-image: linear-gradient(to bottom, rgba(146, 249, 190, 1), rgba(146, 249, 190, 1));">If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn't only tag the piece with "moving". I’d also use the <a href="http://x-squad.com">tags</a> "pets", "marriage", "career change", and "travel tips".</span></p>`;
  5. const autoHeightHtml1 = `Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn’t only tag the piece with "moving".`;
  6. const style0 = `
  7. p {
  8. font-family: sans-serif;
  9. padding: 50px;
  10. box-sizing: border-box;
  11. }
  12. `;
  13. const style1 = `
  14. p {
  15. font-size: 12px !important;
  16. box-sizing: border-box;
  17. }
  18. `;
  19. const inlineBodyStyle = `
  20. @font-face {
  21. font-family: ae_AlArabiya;
  22. src:url("ae_AlArabiya.ttf");
  23. }
  24. body {
  25. font-family: ae_AlArabiya;
  26. display: inline-block;
  27. }
  28. `;
  29. // https://medium.com/@elhardoum/opening-external-links-in-browser-in-react-native-webview-18fe6a66312a
  30. const autoDetectLinkScript = `
  31. (function() {
  32. var links = document.querySelectorAll('a[href]');
  33. if (links) {
  34. for (var index = 0; index < links.length; index++) {
  35. links[index].addEventListener('click', function(event) {
  36. event.preventDefault();
  37. window.ReactNativeWebView.postMessage(JSON.stringify({ url: this.href }));
  38. });
  39. }
  40. }
  41. })();
  42. `;
  43. const autoHeightScript = `
  44. var styleElement = document.createElement('style');
  45. styleElement.innerHTML = '${style1.replace(/\'/g, "\\'").replace(/\n/g, '\\n')}';
  46. document.head.appendChild(styleElement);
  47. document.body.style.background = 'cornflowerblue';
  48. `;
  49. const autoWidthHtml0 = `
  50. <html>
  51. <head>
  52. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  53. </head>
  54. <p class="localStyle" style="display: inline;background-color: transparent !important;background-image: linear-gradient(to bottom, rgba(146, 249, 190, 1), rgba(146, 249, 190, 1));font-style: normal;font-size: 21px;line-height: 1.58;letter-spacing: -.003em;padding-top:0;padding-bottom:0;">hey</p>
  55. </html>
  56. `;
  57. const autoWidthHtml1 = `
  58. <p style="display: inline;background-color: transparent !important;">easy</p>
  59. `;
  60. const autoWidthScript = `
  61. var styleElement = document.createElement('style');
  62. styleElement.innerHTML = '${style1.replace(/\'/g, "\\'").replace(/\n/g, '\\n')}';
  63. document.head.appendChild(styleElement);
  64. `;
  65. export {
  66. autoHeightHtml0,
  67. autoHeightHtml1,
  68. style0,
  69. autoHeightScript,
  70. autoWidthHtml0,
  71. autoWidthHtml1,
  72. autoWidthScript,
  73. inlineBodyStyle,
  74. autoDetectLinkScript
  75. };