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
final class TransportableView: RCTView { | |
func takeSnapshot() { | |
removeSnapshot() | |
snapshot = snapshotView(afterScreenUpdates: false) | |
if let snapshot { | |
addSubview(snapshot) | |
snapshot.frame = frame | |
} | |
} | |
} |
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
final class TransportableView: RCTView { | |
func transportTo(_ transportView: TransportableView) { | |
if let transportedView = subviews.first { | |
transportedView.removeFromSuperview() | |
transportView.insertSubview(transportedView, at: 0) | |
bridge.uiManager?.setSize(frame.size, for: transportedView) | |
} | |
} | |
} |
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
*:not(input):not(textarea):not(select) { | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
} |
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
document.addEventListener('DOMContentLoaded', (event) => { | |
const meta = document.createElement('meta'); | |
meta.setAttribute('name', 'viewport'); | |
meta.setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, viewport-fit=cover'); | |
document.getElementsByTagName('head')[0].appendChild(meta); | |
}); |
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
// the tangents are computed when the mesh is created, and passed as an attribute | |
attribute vec3 tangent; | |
vec3 lookDirection = normalize(position.xyz - cameraPosition); | |
vec3 offset = cross(lookDirection, tangent); | |
vec3 adjustedPosition = position.xyz + normalize(offset) * thickness; |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |