-
Notifications
You must be signed in to change notification settings - Fork 6
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
Github Action
committed
Feb 23, 2024
1 parent
e86e172
commit a240c30
Showing
5 changed files
with
104 additions
and
113 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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Open and respect</title> | ||
<link rel="stylesheet" href="//embed.typeform.com/next/css/popover.css" /> | ||
<link rel="stylesheet" href="//embed.typeform.com/next/css/slider.css" /> | ||
<link rel="stylesheet" href="//embed.typeform.com/next/css/sidetab.css" /> | ||
</head> | ||
<body> | ||
<h1>Respect</h1> | ||
<form action="?" method="get"> | ||
<label><input type="radio" name="respect" value="all" /> all</label><br /> | ||
<label | ||
><input type="radio" name="respect" value="same" /> same forms</label | ||
><br /> | ||
<label><input type="radio" name="respect" value="none" /> none</label> | ||
</form> | ||
<p>Form in popover opens in 1 second.</p> | ||
<p> | ||
<strong>If respect = none</strong> the same form in slider opens in 2 | ||
second. | ||
</p> | ||
<p> | ||
<strong>If respect = none or same</strong> different form in side tab | ||
might open in 3 seconds. | ||
</p> | ||
|
||
<script src="//embed.typeform.com/next/embed.js"></script> | ||
<script> | ||
document.querySelectorAll('input').forEach((radio) => { | ||
radio.onclick = () => document.querySelector('form').submit() | ||
}) | ||
const [, respectOpenModals = 'none'] = | ||
window.location.search.match(/\?respect=([a-z]+)/) || [] | ||
document.querySelector( | ||
`input[name=respect][value=${respectOpenModals}]` | ||
).checked = true | ||
|
||
window.tf.createPopover('HLjqXS5W', { | ||
open: 'time', | ||
openValue: 1000, | ||
respectOpenModals, | ||
}) | ||
window.tf.createSlider('HLjqXS5W', { | ||
position: 'left', | ||
open: 'time', | ||
openValue: 2000, | ||
respectOpenModals, | ||
}) | ||
window.tf.createSidetab('Cqrg7cgL', { | ||
open: 'time', | ||
openValue: 3000, | ||
respectOpenModals, | ||
}) | ||
</script> | ||
</body> | ||
</html> |
4 changes: 2 additions & 2 deletions
4
...l/prevent-reopen-on-close-js/package.json → demo-html/respect-js/package.json
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