CSS
JS
Result
Skip Results Iframe
EDIT ON
Live
Live
This Pen is owned by
web.dev
on
CodePen
.
See more by @web-dot-dev on CodePen
External CSS
https://codepen.io/web-dot-dev/pen/XWqWYgB.css
https://codepen.io/web-dot-dev/pen/ZExZWBQ.css
External JavaScript
https://codepen.io/web-dot-dev/pen/XWqWYgB.js
https://codepen.io/web-dot-dev/pen/ZExZWBQ.js
{"__browser":{"country":"US","device":"unknown_device","mobile":false,"name":"unknown browser","platform":"unknown_platform","version":"0"},"__constants":{},"__CPDATA":{"domain_iframe":"https://cdpn.io","environment":"production","host":"codepen.io","iframe_allow":"accelerometer *; ambient-light-sensor *; camera *; display-capture *; encrypted-media *; geolocation *; gyroscope *; microphone *; midi *; payment *; vr *; web-share *; serial *; xr-spatial-tracking *","iframe_sandbox":"allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups-to-escape-sandbox allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation"},"__graphql":{"data":{"errors":[{"message":"Cannot return null for non-nullable field Query.sessionUser"}],"data":null},"url":"https://codepen.io/graphql","api":"cprails"},"__pay_stripe_public_key":"pk_live_2GndomDfiklqpSNQn8FrGuwZSMIMzha7DkLJqlYe7IR0ihKAlKdiHg68JJc5eVPt68rzAjzAAVXcUwjySHRCsgjQQ00gtRBUFNH","__pay_braintree_env":"production","__boomboom":{"serve_url":"https://cdpn.io/cpe/boomboom","store_url":"https://codepen.io/cpe/boomboom/store"},"__pageType":"embed","__item":"{\"editor_settings\":{\"auto_run\":true,\"autocomplete\":false,\"code_folding\":true,\"css_pre_processor\":\"none\",\"css_prefix\":\"neither\",\"css_starter\":\"neither\",\"emmet_active\":true,\"font_size\":14,\"font_type\":\"system\",\"format_on_save\":true,\"html_pre_processor\":\"none\",\"indent_with\":\"spaces\",\"js_pre_processor\":\"none\",\"key_bindings\":\"normal\",\"line_numbers\":true,\"line_wrapping\":true,\"match_brackets\":true,\"snippets\":{\"markupSnippets\":{},\"stylesheetSnippets\":{}},\"tab_size\":2,\"theme\":\"twilight\",\"id\":\"OJvGRzz\",\"auto_save\":true},\"hashid\":\"OJvGRzz\",\"itemType\":\"pen\",\"resources\":[{\"url\":\"https://codepen.io/web-dot-dev/pen/XWqWYgB.css\",\"order\":0,\"resource_type\":\"css\",\"par_content\":\"\"},{\"url\":\"https://codepen.io/web-dot-dev/pen/XWqWYgB.js\",\"order\":0,\"resource_type\":\"js\",\"par_content\":\"\"},{\"url\":\"https://codepen.io/web-dot-dev/pen/ZExZWBQ.css\",\"order\":1,\"resource_type\":\"css\",\"par_content\":\"\"},{\"url\":\"https://codepen.io/web-dot-dev/pen/ZExZWBQ.js\",\"order\":1,\"resource_type\":\"js\",\"par_content\":\"\"}],\"tags\":[],\"id\":62719355,\"user_id\":5928893,\"html\":\"\",\"css\":\"@layer normalize, open-props, base, mdl, demo;\\n\\n@layer demo {\\n [popover] {\\n padding: var(--size-4);\\n }\\n [popover] {\\n box-shadow: var(--shadow-5);\\n position: fixed;\\n top: 50%;\\n left: 50%;\\n margin: 0;\\n padding: 0;\\n border: 0;\\n }\\n\\n .balloon {\\n cursor: pointer;\\n font-size: var(--font-size-fluid-1);\\n font-weight: var(--font-weight-9);\\n color: var(--gray-0);\\n overflow: visible;\\n width: 12vmin;\\n aspect-ratio: 0.8 / 1;\\n height: auto;\\n background: hsl(var(--hue) 50% 50% / 0.75);\\n border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;\\n filter: brightness(var(--brightness, 1));\\n transition: filter 0.2s, transform 0.2s;\\n transform: translate(-50%, -50%) translateX(calc(var(--index, 0) * 110%))\\n translateY(0) scale(var(--scale, 1));\\n /*animation: float calc(var(--d, 1) * 1s) calc(var(--delay, 0) * -1s) infinite linear both;*/\\n }\\n\\n [popover]:hover {\\n --scale: 1.2;\\n --brightness: 1.2;\\n }\\n\\n [popover]:open {\\n animation: float calc(var(--float-speed) * 10s) forwards,\\n bob calc(var(--bob-speed) * 10s) infinite ease-in-out;\\n }\\n\\n @keyframes float {\\n 0% {\\n transform: translate(-50%, -50%) translateX(calc(var(--index, 0) * 110%))\\n translateY(100vh) translateY(0vh);\\n }\\n }\\n\\n @keyframes bob {\\n 50% {\\n transform: translate(-50%, -50%) translateX(calc(var(--index, 0) * 110%))\\n translateY(0) translateY(-25%);\\n }\\n }\\n\\n .balloon:before {\\n content: \\\"\\\";\\n position: absolute;\\n width: 20%;\\n height: 30%;\\n background: blue;\\n top: 8%;\\n left: 16%;\\n border-radius: 50%;\\n transform: rotate(40deg);\\n background: var(--shine);\\n }\\n\\n .balloon__content {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n height: 100%;\\n width: 100%;\\n flex-direction: column;\\n gap: var(--size-4);\\n font-weight: var(--font-weight-6);\\n }\\n\\n .balloon__handle {\\n --chord: hsl(45, 100%, 40%);\\n width: 2%;\\n height: 60%;\\n background: var(--chord);\\n top: 100%;\\n left: 50%;\\n transform: translate(-50%, 0);\\n position: absolute;\\n }\\n .balloon__handle:before,\\n .balloon__handle:after {\\n content: \\\"\\\";\\n position: absolute;\\n height: 5%;\\n transform: translate(-50%, 0);\\n border-radius: 25% / 50%;\\n left: 50%;\\n }\\n\\n .balloon__handle:before {\\n top: 0;\\n background: var(--chord);\\n width: 500%;\\n }\\n\\n .balloon__handle:after {\\n top: 5%;\\n background: var(--primary-color);\\n width: 700%;\\n }\\n\\n @keyframes float-up {\\n from {\\n transform: translate(-50%, -50%) translateX(calc(var(--index) * 125%))\\n scale(calc(1 + var(--scale, 0))) translateY(100vh);\\n }\\n }\\n}\\n\\n@layer base {\\n :root {\\n --shine: hsl(0 0% 100% / 0.75);\\n --speed: 1s;\\n }\\n\\n *,\\n *:after,\\n *:before {\\n box-sizing: border-box;\\n }\\n\\n body {\\n display: grid;\\n place-items: center;\\n min-height: 100vh;\\n font-family: \\\"Google Sans\\\", sans-serif, system-ui;\\n align-content: center;\\n overflow: hidden;\\n }\\n\\n :where([popup]) {\\n margin: auto;\\n border-width: initial;\\n border-style: solid;\\n }\\n}\\n\",\"js\":\"const AUDIO_POP = new Audio(\\\"https://assets.codepen.io/5928893/pop.mp3\\\");\\nconst WORD = \\\"Pop-up\\\";\\nconst START_INDEX = WORD.length / -2 + 0.5;\\n\\nfor (let p = 0; p < WORD.length; p++) {\\n const POPUP = Object.assign(document.createElement(\\\"button\\\"), {\\n popover: \\\"manual\\\",\\n className: \\\"balloon\\\",\\n id: WORD.charAt(p),\\n defaultOpen: true,\\n title: `Pop \\\"${WORD.charAt(p)}\\\"`,\\n innerHTML: `\\n <span class=\\\"balloon__content\\\">\\n <span class=\\\"balloon__letter\\\">${WORD.charAt(p)}</span>\\n <span class=\\\"balloon__handle\\\"></div>\\n </span>\\n `,\\n style: `\\n --index: ${START_INDEX + p};\\n --hue: ${Math.random() * 359};\\n --bob-speed: ${Math.random() + 0.5};\\n --float-speed: ${Math.random() + 0.5};\\n `\\n });\\n document.body.appendChild(POPUP);\\n POPUP.addEventListener(\\\"click\\\", () => {\\n AUDIO_POP.currentTime = 0;\\n AUDIO_POP.play();\\n POPUP.hidePopover();\\n Object.assign(POPUP, {\\n style: `\\n --index: ${START_INDEX + p};\\n --hue: ${Math.random() * 359};\\n --bob-speed: ${Math.random() + 0.5};\\n --float-speed: ${Math.random() + 0.5};\\n `\\n });\\n requestAnimationFrame(() => POPUP.showPopover());\\n });\\n // Because defaultopen does not work for some reason?\\n POPUP.showPopover();\\n}\\n\",\"html_pre_processor\":\"none\",\"css_pre_processor\":\"none\",\"js_pre_processor\":\"none\",\"html_classes\":\"popup-support\",\"css_starter\":\"neither\",\"js_library\":null,\"created_at\":\"2022-08-23T19:45:29.757Z\",\"updated_at\":\"2022-11-04T11:42:20.719Z\",\"title\":\"11. Pop the pop-ups!\",\"description\":\"\",\"slug_hash\":\"OJvGRzz\",\"head\":\"\",\"private\":false,\"has_animation\":true,\"team_id\":0,\"css_prefix\":\"neither\",\"template\":false,\"parent_id\":0,\"comments_count\":0,\"custom_screenshot_filename\":null,\"loves_count\":0,\"pick\":false,\"popularity_score\":0,\"views_count\":0,\"pick_visible_at\":null,\"cpid\":\"0182cc3d-0e9d-75ac-9b3d-c964af8b5f8a\",\"is_new_editor_pen\":false,\"protected\":false,\"access\":\"Public\",\"pen_hash\":null}","__processorsMap":{"autoprefixer":"autoprefixer-10","babel":"babel-7","coffeescript":"coffeescript-2","format-1":"format-1","flutter":"flutter-1","haml":"haml-4","less":"less-3","lint-1":"lint-1","livescript":"livescript-1","markdown":"markdown-11","postcss":"postcss-7","pug":"pug-2","sass":"sass-1","scss":"sass-1","sass-ruby-3":"sass-ruby-3","sass-ruby-compass-3":"sass-ruby-compass-3","slim":"slim-3","stylus":"stylus-0","typescript":"typescript-4","vue":"vue-2","vue3":"vue-3"},"__favicon_mask_icon":"https://cpwebassets.codepen.io/assets/favicon/logo-pin-b4b4269c16397ad2f0f7a01bcdf513a1994f4c94b8af2f191c09eb0d601762b1.svg","__favicon_shortcut_icon":"https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico","__path_to_iframe_console_runner":"https://cpwebassets.codepen.io/assets/editor/iframe/iframeConsoleRunner-6d8bf8b4b479137260842506acbb12717dace0823c023e08b96360e60b0840d9.js","__path_to_iframe_refresh_css":"https://cpwebassets.codepen.io/assets/editor/iframe/iframeRefreshCSS-44fe83e49b63affec96918c9af88c0d80b209a862cf87ac46bc933074b8c557d.js","__path_to_iframe_runtime_errors":"https://cpwebassets.codepen.io/assets/editor/iframe/iframeRuntimeErrors-4f205f2c14e769b448bcf477de2938c681660d5038bc464e3700256713ebe261.js","__path_to_processor_worker":"https://cpwebassets.codepen.io/assets/packs/router.js","__path_to_stop_execution_on_timeout":"https://cpwebassets.codepen.io/assets/common/stopExecutionOnTimeout-2c7831bb44f98c1391d6a4ffda0e1fd302503391ca806e7fcc7b9b87197aec26.js","__pen_normalize_css_url":"https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css","__pen_prefix_free_url":"https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js","__pen_reset_css_url":"https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"}