-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
68 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Redirecting...</title> | ||
<style> | ||
body, html { | ||
height: 100%; | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #f0f0f0; | ||
} | ||
.container { | ||
text-align: center; | ||
} | ||
img { | ||
max-width: 50%; | ||
max-height: 80vh; | ||
object-fit: contain; | ||
} | ||
</style> | ||
<script> | ||
fetch('/redirect') | ||
.then(response => response.json()) | ||
.then(data => { | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Redirecting...</title> | ||
<style> | ||
body, html { | ||
height: 100%; | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #f0f0f0; | ||
} | ||
.container { | ||
text-align: center; | ||
} | ||
img { | ||
max-width: 50%; | ||
max-height: 80vh; | ||
object-fit: contain; | ||
} | ||
</style> | ||
<script> | ||
// Function to get query parameters | ||
function getQueryParameter(name) { | ||
const urlParams = new URLSearchParams(window.location.search); | ||
return urlParams.get(name); | ||
} | ||
|
||
// Get the source from the query parameter, default to 'local' | ||
const source = getQueryParameter('source') || 'local'; | ||
|
||
if (source === 'local') { | ||
fetch('/redirect') | ||
.then(response => response.json()) | ||
.then(data => { | ||
setTimeout(() => { | ||
window.location.href = data.redirect_url; | ||
}, 500); | ||
}) | ||
.catch(error => console.error('Error:', error)); | ||
} else if (source === 'remote') { | ||
setTimeout(() => { | ||
window.location.href = data.redirect_url; | ||
window.location.href = 'brands/brands.html?source=remote'; | ||
}, 500); | ||
}) | ||
.catch(error => console.error('Error:', error)); | ||
</script> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<img src="solara.png" alt="Logo Image"> | ||
</div> | ||
</body> | ||
} else { | ||
console.error('Invalid source parameter'); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<img src="solara.png" alt="Logo Image"> | ||
</div> | ||
</body> | ||
</html> |