Created
August 26, 2018 03:30
-
-
Save esironal/765354a88937ab58a5a247b315be2144 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<script src="https://metroui.org.ua/js/jquery-3.3.1.min.js"></script> | |
<script src="https://metroui.org.ua/metro/js/metro.js"></script> | |
<script src="https://metroui.org.ua/examples/desktop/desktop.js"></script> | |
<script> | |
var w_icons = [ | |
'rocket', 'apps', 'cog', 'anchor' | |
]; | |
var w_titles = [ | |
'rocket', 'apps', 'cog', 'anchor' | |
]; | |
function createWindow(){ | |
var index = Metro.utils.random(0, 3); | |
Desktop.createWindow({ | |
width: 300, | |
icon: "<span class='mif-"+w_icons[index]+"'></span>", | |
title: w_titles[index], | |
content: "<div class='p-2'>This is desktop demo created with Metro 4 Components Library</div>" | |
}); | |
} | |
function createWindowModal(){ | |
Desktop.createWindow({ | |
width: 300, | |
icon: "<span class='mif-cogs'></span>", | |
title: "Modal window", | |
content: "<div class='p-2'>This is desktop demo created with Metro 4 Components Library</div>", | |
overlay: true, | |
//overlayColor: "transparent", | |
modal: true, | |
place: "center", | |
onShow: function(win){ | |
win.addClass("ani-swoopInTop"); | |
setTimeout(function(){ | |
win.removeClass("ani-swoopInTop"); | |
}, 1000); | |
}, | |
onClose: function(win){ | |
win.addClass("ani-swoopOutTop"); | |
} | |
}); | |
} | |
function createWindowYoutube(){ | |
Desktop.createWindow({ | |
width: 500, | |
icon: "<span class='mif-youtube'></span>", | |
title: "Youtube video", | |
content: "https://youtu.be/S9MeTn1i72g", | |
clsContent: "bg-dark" | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment