HTML
SCSS
JS
Result
Skip Results Iframe
EDIT ON
Live
Live
Live
This Pen is owned by
Nicolas Jesenberger
on
CodePen
.
See more by @nicolasjesenberger on CodePen
External CSS
https://codepen.io/nicolasjesenberger/pen/GRYvOWy/d5176f9552830811da3e2bde0120cc26.css
External JavaScript
https://codepen.io/nicolasjesenberger/pen/VwEzMrY/81eb6139c2c9b7dbc46e43d898e7d29b.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 *; serial *; vr *; web-share *; xr-spatial-tracking *","iframe_sandbox":"allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox 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\":false,\"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\":\"BaqYwea\",\"auto_save\":false},\"hashid\":\"BaqYwea\",\"itemType\":\"pen\",\"resources\":[{\"url\":\"https://codepen.io/nicolasjesenberger/pen/GRYvOWy/d5176f9552830811da3e2bde0120cc26.css\",\"order\":0,\"resource_type\":\"css\",\"par_content\":\"\"},{\"url\":\"https://codepen.io/nicolasjesenberger/pen/VwEzMrY/81eb6139c2c9b7dbc46e43d898e7d29b.js\",\"order\":0,\"resource_type\":\"js\",\"par_content\":\"\"}],\"tags\":[\"toggle\",\"switch\",\"button\",\"skeuomorphic\",\"skeuomorphism\"],\"id\":68261689,\"user_id\":4175254,\"html\":\"<div class=\\\"toggle-wrapper\\\">\\n <input class=\\\"toggle-checkbox\\\" type=\\\"checkbox\\\">\\n <div class=\\\"toggle-container\\\"> \\n <div class=\\\"toggle-button\\\">\\n <div class=\\\"toggle-button-circles-container\\\">\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n </div>\\n </div>\\n </div>\\n</div>\\n\\n<div class=\\\"toggle-wrapper\\\">\\n <input class=\\\"toggle-checkbox\\\" type=\\\"checkbox\\\" checked>\\n <div class=\\\"toggle-container\\\"> \\n <div class=\\\"toggle-button\\\">\\n <div class=\\\"toggle-button-circles-container\\\">\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n <div class=\\\"toggle-button-circle\\\"></div>\\n </div>\\n </div>\\n </div>\\n</div>\",\"css\":\"body {\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n row-gap: .5em;\\n min-height: 100vh;\\n background-color: #e8e1d6;\\n font-size: 3em;\\n}\\n\\n.toggle-wrapper {\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n position: relative;\\n border-radius: .5em;\\n padding: .125em;\\n background-image: linear-gradient(to bottom, #d0c4b8, #f5ece5);\\n box-shadow: \\n 0 1px 1px rgb(255 255 255 / .6),\\n ;\\n}\\n\\n.toggle-checkbox {\\n -webkit-appearance: none;\\n appearance: none;\\n position: absolute;\\n z-index: 1;\\n border-radius: inherit;\\n width: 100%;\\n height: 100%;\\n opacity: 0;\\n cursor: pointer;\\n}\\n\\n.toggle-container {\\n display: flex;\\n align-items: center;\\n position: relative;\\n border-radius: .375em;\\n width: 3em;\\n height: 1.5em;\\n background-color: #e1dacd;\\n box-shadow: \\n inset 0 0 .0625em .125em rgb(255 255 255 / .2),\\n inset 0 .0625em .125em rgb(0 0 0 / .4),\\n ;\\n transition: background-color .4s linear;\\n \\n .toggle-checkbox:checked + & {\\n background-color: #f3b519;\\n }\\n}\\n\\n.toggle-button {\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n position: absolute;\\n left: .0625em;\\n border-radius: .3125em;\\n width: 1.375em;\\n height: 1.375em;\\n background-color: #e4ddcf;\\n box-shadow:\\n inset 0 -.0625em .0625em .125em rgb(0 0 0 / .1),\\n inset 0 -.125em .0625em rgb(0 0 0 / .2),\\n inset 0 .1875em .0625em rgb(255 255 255 / .3),\\n 0 .125em .125em rgb(0 0 0 / .5),\\n ;\\n transition: left .4s/*cubic-bezier(.65, 1.35, .5, 1)*/;\\n \\n .toggle-checkbox:checked + .toggle-container > & {\\n left: 1.5625em;\\n }\\n}\\n\\n.toggle-button-circles-container {\\n display: grid;\\n grid-template-columns: repeat(3, min-content);\\n gap: .125em;\\n position: absolute;\\n margin: 0 auto;\\n}\\n\\n.toggle-button-circle {\\n border-radius: 50%;\\n width: .125em;\\n height: .125em;\\n background-image: radial-gradient(circle at 50% 0, #f6f0e9, #bebcb0);\\n}\",\"js\":\"// Inspired by MVBen on Dribbble:\\n// https://dribbble.com/shots/797923-Buttons-And-Switches-PSD\",\"html_pre_processor\":\"none\",\"css_pre_processor\":\"scss\",\"js_pre_processor\":\"none\",\"html_classes\":\"\",\"css_starter\":\"neither\",\"js_library\":null,\"created_at\":\"2023-05-07T18:34:08.823Z\",\"updated_at\":\"2023-06-12T10:47:35.743Z\",\"title\":\"Skeuomorphic Toggle Switch (vol. 3)\",\"description\":\"Inspired by MVBen on Dribbble: https://dribbble.com/shots/797923-Buttons-And-Switches-PSD\",\"slug_hash\":\"BaqYwea\",\"head\":\"\",\"private\":false,\"has_animation\":false,\"team_id\":0,\"css_prefix\":\"neither\",\"template\":false,\"parent_id\":0,\"comments_count\":3,\"custom_screenshot_filename\":null,\"loves_count\":192,\"pick\":false,\"popularity\":1617,\"views_count\":6268,\"pick_visible_at\":null,\"cpid\":\"0187f77e-1837-75e1-a61f-df281186e2ba\",\"is_new_editor_pen\":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://public.codepenassets.com/css/normalize-5.0.0.min.css","__pen_prefix_free_url":"https://public.codepenassets.com/js/prefixfree-1.0.7.min.js","__pen_reset_css_url":"https://public.codepenassets.com/css/reset-2.0.min.css"}