Skip to content

Commit

Permalink
fix: use js to render svg animations (ory#79)
Browse files Browse the repository at this point in the history
Resolves a new sfari 13.1+ bug where animations stopped working.
  • Loading branch information
aeneasr committed Jul 2, 2020
1 parent c29785a commit 86c6df3
Show file tree
Hide file tree
Showing 14 changed files with 2,335 additions and 294 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
static/scripts/*
8 changes: 8 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ module.exports = {
},
},
`gatsby-plugin-sharp`,
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /.*images\/animations\/.*\.svg$/ // See below to configure properly
}
}
},
{
resolve: `gatsby-transformer-remark`,
options: {
Expand Down
861 changes: 653 additions & 208 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"gatsby-plugin-offline": "~3.0.40",
"gatsby-plugin-postcss": "~2.1.21",
"gatsby-plugin-react-helmet": "~3.1.23",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-sharp": "^2.5.3",
"gatsby-plugin-sitemap": "~2.2.29",
"gatsby-plugin-typescript": "~2.1.27",
Expand Down Expand Up @@ -60,6 +61,7 @@
"react-countup": "~4.3.2",
"react-dom": "~16.13.0",
"react-helmet": "~5.2.1",
"react-keyshape": "^3.3.0",
"react-prism": "~4.3.2",
"react-visibility-sensor": "~5.1.1",
"regression": "~2.0.1",
Expand Down
Binary file modified src/.DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion src/components/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ class Stats extends Component<PropTypes, StateTypes> {
}

render() {
console.log(this.state)
return (
<div className={styles.stats}>
<div className="container-fluid">
Expand Down
124 changes: 65 additions & 59 deletions src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,74 +23,80 @@ import icon17 from './images/icon/mstile-310x310.png'
export default function HTML(props) {
return (
<html {...props.htmlAttributes}>
<head>
<link rel="apple-touch-icon-precomposed" sizes="57x57" href={icon}/>
<link rel="apple-touch-icon-precomposed" sizes="114x114" href={icon1}/>
<link rel="apple-touch-icon-precomposed" sizes="72x72" href={icon2}/>
<link rel="apple-touch-icon-precomposed" sizes="144x144" href={icon3}/>
<link rel="apple-touch-icon-precomposed" sizes="60x60" href={icon4}/>
<link rel="apple-touch-icon-precomposed" sizes="120x120" href={icon5}/>
<link rel="apple-touch-icon-precomposed" sizes="76x76" href={icon6}/>
<link rel="apple-touch-icon-precomposed" sizes="152x152" href={icon7}/>
<link rel="icon" type="image/png" href={icon8}/>
<link rel="icon" type="image/png" href={icon9}/>
<link rel="icon" type="image/png" href={icon10}/>
<link rel="icon" type="image/png" href={icon11}/>
<link rel="icon" type="image/png" href={icon12}/>
<meta name="msapplication-TileImage" content={icon13}/>
<meta name="msapplication-square70x70logo" content={icon14}/>
<meta name="msapplication-square150x150logo" content={icon15}/>
<meta name="msapplication-wide310x150logo" content={icon16}/>
<meta name="msapplication-square310x310logo" content={icon17}/>
<head>
<link rel="apple-touch-icon-precomposed" sizes="57x57" href={icon} />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href={icon1} />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href={icon2} />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href={icon3} />
<link rel="apple-touch-icon-precomposed" sizes="60x60" href={icon4} />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href={icon5} />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href={icon6} />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href={icon7} />
<link rel="icon" type="image/png" href={icon8} />
<link rel="icon" type="image/png" href={icon9} />
<link rel="icon" type="image/png" href={icon10} />
<link rel="icon" type="image/png" href={icon11} />
<link rel="icon" type="image/png" href={icon12} />
<meta name="msapplication-TileImage" content={icon13} />
<meta name="msapplication-square70x70logo" content={icon14} />
<meta name="msapplication-square150x150logo" content={icon15} />
<meta name="msapplication-wide310x150logo" content={icon16} />
<meta name="msapplication-square310x310logo" content={icon17} />

<meta charSet="utf-8"/>
<meta httpEquiv="x-ua-compatible" content="ie=edge"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
{props.headComponents}
<script
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
{props.headComponents}
<script
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MJD22FZ');`,
}}
/>
</head>
<body {...props.bodyAttributes}>
{props.preBodyComponents}
<noscript key="noscript" id="gatsby-noscript">
This app works best with JavaScript enabled.
</noscript>
<div
key={`body`}
id="___gatsby"
dangerouslySetInnerHTML={{ __html: props.body }}
/>
{props.postBodyComponents}
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-71865250-1"
/>
<script
dangerouslySetInnerHTML={{
__html: `window.dataLayer = window.dataLayer || [];
}}
/>
<script src="/scripts/keyshapejs-1.1.0.min.js" />
</head>
<body {...props.bodyAttributes}>
{props.preBodyComponents}
<noscript key="noscript" id="gatsby-noscript">
This app works best with JavaScript enabled.
</noscript>
<div
key={`body`}
id="___gatsby"
dangerouslySetInnerHTML={{ __html: props.body }}
/>
{props.postBodyComponents}
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-71865250-1"
/>
<script
dangerouslySetInnerHTML={{
__html: `window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-71865250-1');`,
}}
/>
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-MJD22FZ"
style={{ height: 0, width: 0, display: 'none', visibility: 'hidden' }}
/>
</noscript>
</body>
}}
/>
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-MJD22FZ"
style={{
height: 0,
width: 0,
display: 'none',
visibility: 'hidden',
}}
/>
</noscript>
</body>
</html>
)
}
Expand Down
Binary file modified src/images/.DS_Store
Binary file not shown.
22 changes: 22 additions & 0 deletions src/images/animations/kratos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 1 addition & 9 deletions src/pages/kratos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@ import SEO from '../components/seo'
import kratosPolyglot from '../images/kratos/svg_kratos_p.svg'
import Stats from '../components/stats'
import CodeBox, { Languages } from '../components/codebox'
import kratosProcess from '../images/kratos/svg_kratos.svg'
import KratosAnimation from '../images/animations/kratos.svg'
import { brandPrefix } from '../config'
import Collaborator from '../components/collaborator'

const KratosAnimation = () => (
<img
alt="The ORY Kratos user login and registration service"
className="responsive"
src={kratosProcess}
/>
)

const KratosSdk = () => (
<img alt="ORY Kratos SDKs" className="responsive" src={kratosPolyglot} />
)
Expand Down
16 changes: 8 additions & 8 deletions src/pages/markdown/imprint.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
published: true
path: '/imprint/'
title: 'Imprint'
metaTitle: 'ORY Imprint'
metaDescription: 'Read the ORY imprint.'
lastUpdatedAt: 'Apr 6th, 2020'
published: true
path: '/imprint/'
title: 'Imprint'
metaTitle: 'ORY Imprint'
metaDescription: 'Read the ORY imprint.'
lastUpdatedAt: 'Apr 6th, 2020'
---

**ORY Corp**
32 Veterans Lane, Ste A-128
Doylestown, PA 18901-3424
United States of America
United States of America

E-Mail: [[email protected]](mailto:[email protected])
E-Mail: [[email protected]](mailto:[email protected])
Loading

0 comments on commit 86c6df3

Please sign in to comment.