forked from FlineDev/Twoot-it-LandingPage
-
-
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
1 changed file
with
46 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> | ||
|
||
{% for file in site.static_files %} | ||
{% if file.path contains 'assets/screenshot/' %} | ||
<script> | ||
$(function() { | ||
$(".iphoneScreen").attr('src', '{{ site.github.baseurl }}{{ file.path }}'); | ||
$(".iphoneScreen").removeClass("hidden"); | ||
console.log("{{ file.path }}"); | ||
}); | ||
</script> | ||
{% elsif file.path contains 'assets/videos/' %} | ||
{% unless file.path contains 'assets/videos/Place-video-files-here.txt' %} | ||
<script> | ||
$(function() { | ||
$(".iphoneScreen").addClass("hidden"); | ||
console.log("remove screenshot"); | ||
}); | ||
</script> | ||
{% endunless %} | ||
{% if file.extname == ".mov" or file.extname == ".mp4" %} | ||
<script> | ||
$(function() { | ||
$(".videoContainer").removeClass("hidden"); | ||
$(".screenvideo").append('<source src="{{ site.github.baseurl }}{{ file.path }}" type="video/mp4">'); | ||
console.log("{{ file.path }}"); | ||
}); | ||
</script> | ||
{% elsif file.extname == ".ogg" %} | ||
<script> | ||
$(function() { | ||
$(".videoContainer").removeClass("hidden"); | ||
$(".screenvideo").append('<source src="{{ site.github.baseurl }}{{ file.path }}" type="video/ogg">'); | ||
console.log("{{ file.path }}"); | ||
}); | ||
</script> | ||
{% elsif file.extname == ".webm" %} | ||
<script> | ||
$(function() { | ||
$(".videoContainer").removeClass("hidden"); | ||
$(".screenvideo").append('<source src="{{ site.github.baseurl }}{{ file.path }}" type="video/webm">'); | ||
console.log("{{ file.path }}"); | ||
}); | ||
</script> | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
<script> | ||
// Function to check if the user is on a mobile device | ||
function isMobileDevice() { | ||
return /Mobi|Android/i.test(navigator.userAgent); | ||
} | ||
|
||
$(function() { | ||
var isMobile = isMobileDevice(); | ||
|
||
{% for file in site.static_files %} | ||
{% if file.path contains 'assets/screenshot/' %} | ||
if (isMobile) { | ||
$(".iphoneScreen").attr('src', '{{ site.github.baseurl }}{{ file.path }}'); | ||
$(".iphoneScreen").removeClass("hidden"); | ||
console.log("Screenshot: {{ file.path }}"); | ||
} | ||
{% elsif file.path contains 'assets/videos/' %} | ||
{% unless file.path contains 'assets/videos/Place-video-files-here.txt' %} | ||
if (!isMobile) { | ||
$(".iphoneScreen").addClass("hidden"); | ||
console.log("remove screenshot"); | ||
} | ||
{% endunless %} | ||
{% if file.extname == ".mov" or file.extname == ".mp4" %} | ||
if (!isMobile) { | ||
$(".videoContainer").removeClass("hidden"); | ||
$(".screenvideo").append('<source src="{{ site.github.baseurl }}{{ file.path }}" type="video/mp4">'); | ||
console.log("Video: {{ file.path }}"); | ||
} | ||
{% elsif file.extname == ".ogg" %} | ||
if (!isMobile) { | ||
$(".videoContainer").removeClass("hidden"); | ||
$(".screenvideo").append('<source src="{{ site.github.baseurl }}{{ file.path }}" type="video/ogg">'); | ||
console.log("Video: {{ file.path }}"); | ||
} | ||
{% elsif file.extname == ".webm" %} | ||
if (!isobile) { | ||
$(".videoContainer").removeClass("hidden"); | ||
$(".screenvideo").append('<source src="{{ site.github.baseurl }}{{ file.path }}" type="video/webm">'); | ||
console.log("Video: {{ file.path }}"); | ||
} | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
}); | ||
</script> |