core: improve loading speed of flow background
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		| @ -5,6 +5,7 @@ | ||||
|  | ||||
| {% block head_before %} | ||||
| {{ block.super }} | ||||
| <link rel="prefetch" href="{{ flow.background_url }}" /> | ||||
| {% if flow.compatibility_mode and not inspector %} | ||||
| <script>ShadyDOM = { force: !navigator.webdriver };</script> | ||||
| {% endif %} | ||||
| @ -19,7 +20,7 @@ window.authentik.flow = { | ||||
| {% block head %} | ||||
| <script src="{% static 'dist/flow/FlowInterface.js' %}" type="module"></script> | ||||
| <style> | ||||
| .pf-c-background-image::before { | ||||
| :root { | ||||
|     --ak-flow-background: url("{{ flow.background_url }}"); | ||||
| } | ||||
| </style> | ||||
|  | ||||
| @ -4,13 +4,19 @@ | ||||
| {% load i18n %} | ||||
|  | ||||
| {% block head_before %} | ||||
| <link rel="prefetch" href="/static/dist/assets/images/flow_background.jpg" /> | ||||
| <link rel="stylesheet" type="text/css" href="{% static 'dist/patternfly.min.css' %}"> | ||||
| {% endblock %} | ||||
|  | ||||
| {% block head %} | ||||
| <style> | ||||
| .pf-c-background-image::before { | ||||
| :root { | ||||
|     --ak-flow-background: url("/static/dist/assets/images/flow_background.jpg"); | ||||
|     --pf-c-background-image--BackgroundImage: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage-2x: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage--sm: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage--sm-2x: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage--lg: var(--ak-flow-background); | ||||
| } | ||||
| /* Form with user */ | ||||
| .form-control-static { | ||||
|  | ||||
| @ -9,10 +9,19 @@ | ||||
|         <link rel="stylesheet" type="text/css" href="/outpost.goauthentik.io/static/dist/patternfly.min.css"> | ||||
|         <link rel="stylesheet" type="text/css" href="/outpost.goauthentik.io/static/dist/authentik.css"> | ||||
|         <link rel="stylesheet" type="text/css" href="/outpost.goauthentik.io/static/dist/custom.css"> | ||||
|         <link rel="prefetch" href="/outpost.goauthentik.io/static/dist/assets/images/flow_background.jpg" /> | ||||
|         <style> | ||||
|             .pf-c-background-image::before { | ||||
|                 --ak-flow-background: url("/outpost.goauthentik.io/static/dist/assets/images/flow_background.jpg"); | ||||
|             } | ||||
|             :root { | ||||
|                 --ak-flow-background: url("/outpost.goauthentik.io/static/dist/assets/images/flow_background.jpg"); | ||||
|                 --pf-c-background-image--BackgroundImage: var(--ak-flow-background); | ||||
|                 --pf-c-background-image--BackgroundImage-2x: var(--ak-flow-background); | ||||
|                 --pf-c-background-image--BackgroundImage--sm: var(--ak-flow-background); | ||||
|                 --pf-c-background-image--BackgroundImage--sm-2x: var(--ak-flow-background); | ||||
|                 --pf-c-background-image--BackgroundImage--lg: var(--ak-flow-background); | ||||
|             } | ||||
|         </style> | ||||
|     </head> | ||||
|     <body> | ||||
|  | ||||
| @ -9,6 +9,12 @@ | ||||
|     --ak-dark-background-light: #1c1e21; | ||||
|     --ak-dark-background-light-ish: #212427; | ||||
|     --ak-dark-background-lighter: #2b2e33; | ||||
|  | ||||
|     --pf-c-background-image--BackgroundImage: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage-2x: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage--sm: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage--sm-2x: var(--ak-flow-background); | ||||
|     --pf-c-background-image--BackgroundImage--lg: var(--ak-flow-background); | ||||
| } | ||||
|  | ||||
| html { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer