Skip to content

Commit

Permalink
Create style.js
Browse files Browse the repository at this point in the history
  • Loading branch information
cc18dd authored Oct 21, 2023
1 parent c77583d commit 6fc335c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script>
// Function to check if the user is on a mobile device
function isMobileDevice() {
return (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1);
}

// Check if the user is on a mobile device and load the appropriate CSS file
if (isMobileDevice()) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'mobile.css'; // Path to your mobile CSS file
document.getElementsByTagName('head')[0].appendChild(link);
}
else
{
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'style.css'; // Path to your mobile CSS file
document.getElementsByTagName('head')[0].appendChild(link);
}
</script>

0 comments on commit 6fc335c

Please sign in to comment.