Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
22,356 additions
and 0 deletions.
- +36 −0 test/studio/Masking.framer/.gitignore
- +3 −0 test/studio/Masking.framer/app.coffee
- +12 −0 test/studio/Masking.framer/framer/coffee-script.js
- +8 −0 test/studio/Masking.framer/framer/config.json
- +126 −0 test/studio/Masking.framer/framer/framer.init.js
- +20,853 −0 test/studio/Masking.framer/framer/framer.js
- BIN test/studio/Masking.framer/framer/images/background.png
- BIN test/studio/Masking.framer/framer/images/cursor-active.png
- BIN test/studio/Masking.framer/framer/images/cursor-active@2x.png
- BIN test/studio/Masking.framer/framer/images/cursor.png
- BIN test/studio/Masking.framer/framer/images/cursor@2x.png
- BIN test/studio/Masking.framer/framer/images/icon-120.png
- BIN test/studio/Masking.framer/framer/images/icon-152.png
- BIN test/studio/Masking.framer/framer/images/icon-180.png
- BIN test/studio/Masking.framer/framer/images/icon-192.png
- BIN test/studio/Masking.framer/framer/images/icon-76.png
- BIN test/studio/Masking.framer/framer/images/icon-arrow.png
- BIN test/studio/Masking.framer/framer/images/icon-arrow@2x.png
- BIN test/studio/Masking.framer/framer/images/icon-close.png
- BIN test/studio/Masking.framer/framer/images/icon-close@2x.png
- BIN test/studio/Masking.framer/framer/images/icon-framer.png
- BIN test/studio/Masking.framer/framer/images/icon-framer@2x.png
- BIN test/studio/Masking.framer/framer/images/icon-share.png
- BIN test/studio/Masking.framer/framer/images/icon-share@2x.png
- +196 −0 test/studio/Masking.framer/framer/mirror.css
- +59 −0 test/studio/Masking.framer/framer/style.css
- +1 −0 test/studio/Masking.framer/framer/version
- 0 test/studio/Masking.framer/images/.gitkeep
- BIN .../studio/Masking.framer/imported/masks/images/Layer-label-07CA3415-BE33-4CB5-9FA2-F571DEBB9A07.png
- BIN .../studio/Masking.framer/imported/masks/images/Layer-label-433500E8-13BC-4AF8-B65C-748ACE493CE5.png
- BIN .../studio/Masking.framer/imported/masks/images/Layer-label-7100928B-6344-4BCE-8484-11B32446A96F.png
- BIN .../studio/Masking.framer/imported/masks/images/Layer-label-982C4A93-985D-4A14-9FB9-4B5E979C2226.png
- BIN .../studio/Masking.framer/imported/masks/images/Layer-label-C6DDFA1D-1780-41FA-99E8-010C7A3E854A.png
- BIN .../studio/Masking.framer/imported/masks/images/Layer-label-FB756A0F-D3EF-4529-A91D-A78561E75437.png
- BIN test/studio/Masking.framer/imported/masks/images/Layer-mask-03B6E603-BF6F-4E8E-B115-A1100B91E662.png
- BIN test/studio/Masking.framer/imported/masks/images/Layer-mask-1BFFD0E6-6E9F-486E-9986-DDBA05275694.png
- BIN test/studio/Masking.framer/imported/masks/images/Layer-mask-58AF78AA-BCCB-4B7D-8193-300E36804529.png
- BIN test/studio/Masking.framer/imported/masks/images/Layer-mask-78A4DB47-C8A9-49C1-B2E4-169B042EFD8D.png
- BIN test/studio/Masking.framer/imported/masks/images/Layer-mask-BE2E06E1-C704-4741-8D34-610CCEFD41B7.png
- BIN test/studio/Masking.framer/imported/masks/images/Layer-mask-E295FDF2-8CFA-4D56-B282-EEE877F81682.png
- BIN ...tudio/Masking.framer/imported/masks/images/Layer-parentA-14D768D1-2821-4DEE-8C46-16A8A0904F73.png
- BIN ...tudio/Masking.framer/imported/masks/images/Layer-parentA-35D27058-CA6A-4E69-A554-199C118C4459.png
- BIN ...tudio/Masking.framer/imported/masks/images/Layer-parentA-A0FD1F5A-DF42-4D36-B99C-64AF713A4916.png
- BIN ...tudio/Masking.framer/imported/masks/images/Layer-parentA-BEFD9E38-0925-487B-AAFE-2FBAFA397AF3.png
- BIN ...tudio/Masking.framer/imported/masks/images/Layer-parentB-7A84AEE4-02A6-4CE9-A301-DC6F3A5CE77D.png
- BIN ...tudio/Masking.framer/imported/masks/images/Layer-parentB-CA88FB50-E355-4613-95C6-A5F962F551EC.png
- +506 −0 test/studio/Masking.framer/imported/masks/layers.json
- +507 −0 test/studio/Masking.framer/imported/masks/layers.json.js
- +39 −0 test/studio/Masking.framer/index.html
- BIN test/studio/Masking.framer/masks.sketch
- +10 −0 test/studio/Masking.framer/modules/myModule.coffee
@@ -0,0 +1,3 @@ | ||
# This imports all the layers for "masks" into masksLayers | ||
sketch = Framer.Importer.load "imported/masks" | ||
|
@@ -0,0 +1,8 @@ | ||
{ | ||
"updateDelay" : 0.3, | ||
"deviceScale" : -1, | ||
"deviceOrientation" : 0, | ||
"contentScale" : 1, | ||
"sharedPrototype" : 0, | ||
"deviceType" : "fullscreen" | ||
} |
@@ -0,0 +1,126 @@ | ||
(function() { | ||
|
||
function isFileLoadingAllowed() { | ||
return (window.location.protocol.indexOf("file") == -1) | ||
} | ||
|
||
function isHomeScreened() { | ||
return ("standalone" in window.navigator) && window.navigator.standalone == true | ||
} | ||
|
||
function isCompatibleBrowser() { | ||
return Utils.isWebKit() | ||
} | ||
|
||
var alertNode; | ||
|
||
function dismissAlert() { | ||
alertNode.parentElement.removeChild(alertNode) | ||
loadProject() | ||
} | ||
|
||
function showAlert(html) { | ||
|
||
alertNode = document.createElement("div") | ||
|
||
alertNode.classList.add("framerAlertBackground") | ||
alertNode.innerHTML = html | ||
|
||
document.addEventListener("DOMContentLoaded", function(event) { | ||
document.body.appendChild(alertNode) | ||
}) | ||
|
||
window.dismissAlert = dismissAlert; | ||
} | ||
|
||
function showBrowserAlert() { | ||
var html = "" | ||
html += "<div class='framerAlert'>" | ||
html += "<strong>Error: Not A WebKit Browser</strong>" | ||
html += "Your browser is not supported. <br> Please use Safari or Chrome.<br>" | ||
html += "<a class='btn' href='javascript:void(0)' onclick='dismissAlert();'>Try anyway</a>" | ||
html += "</div>" | ||
|
||
showAlert(html) | ||
} | ||
|
||
function showFileLoadingAlert() { | ||
var html = "" | ||
html += "<div class='framerAlert'>" | ||
html += "<strong>Error: Local File Restrictions</strong>" | ||
html += "Preview this prototype with Framer Mirror or learn more about " | ||
html += "<a href='https://github.com/koenbok/Framer/wiki/LocalLoading'>file restrictions</a>.<br>" | ||
html += "<a class='btn' href='javascript:void(0)' onclick='dismissAlert();'>Try anyway</a>" | ||
html += "</div>" | ||
|
||
showAlert(html) | ||
} | ||
|
||
function showHomeScreenAlert() { | ||
|
||
link = document.createElement("link"); | ||
link.href = "framer/mirror.css" | ||
link.type = "text/css" | ||
link.rel = "stylesheet" | ||
link.media = "screen" | ||
|
||
document.addEventListener("DOMContentLoaded", function(event) { | ||
document.getElementsByTagName("head")[0].appendChild(link) | ||
}) | ||
|
||
var html = "" | ||
html += "<figure class='icon-close' href='javascript:void(0)' onclick='dismissAlert();'></figure>" | ||
html += "<section class='wrapper'>" | ||
html += "<figure class='icon-framer'></figure><h1>Install Prototype</h1>" | ||
html += "<p>Tap <div class='share'><figure class='icon-share'></figure> Share</div>, then choose 'Add to Home Screen'</p> " | ||
html += "<section class='arrow'><figure class='icon-arrow'></figure></section>" | ||
html += "</section>" | ||
|
||
showAlert(html) | ||
} | ||
|
||
function loadProject() { | ||
CoffeeScript.load("app.coffee") | ||
} | ||
|
||
function setDefaultPageTitle() { | ||
// If no title was set we set it to the project folder name so | ||
// you get a nice name on iOS if you bookmark to desktop. | ||
document.addEventListener("DOMContentLoaded", function() { | ||
if (document.title == "") { | ||
if (window.FramerStudioInfo && window.FramerStudioInfo.documentTitle) { | ||
document.title = window.FramerStudioInfo.documentTitle | ||
} else { | ||
document.title = window.location.pathname.replace(/\//g, "") | ||
} | ||
} | ||
}) | ||
} | ||
|
||
function init() { | ||
|
||
if (Utils.isFramerStudio()) { | ||
return | ||
} | ||
|
||
setDefaultPageTitle() | ||
|
||
if (!isCompatibleBrowser()) { | ||
return showBrowserAlert() | ||
} | ||
|
||
if (!isFileLoadingAllowed()) { | ||
return showFileLoadingAlert() | ||
} | ||
|
||
// if (Utils.isMobile() && !isHomeScreened()) { | ||
// return showHomeScreenAlert() | ||
// } | ||
|
||
loadProject() | ||
|
||
} | ||
|
||
init() | ||
|
||
})() |
Oops, something went wrong.