Stupid RTL Demo

Developer
Size
3,075 Kb
Views
28,336

How do I make an stupid rtl demo?

Used old codepens to demonstrate this stupid joke functionality to a friend at work.. What is a stupid rtl demo? How do you make a stupid rtl demo? This script and codes were developed by Chris Burnell on 16 September 2022, Friday.

Stupid RTL Demo Previews

Stupid RTL Demo - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Stupid RTL Demo</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ html, body { height: 100%;
}
body { background: mintcream; color: gray; position: relative;
}
.container { font: bold normal 18px/1.618em "Helvetica Neue", Arial, sans-serif; width: 80%; position: absolute; top: 25%; left: 50%; margin-left: -40%;
}
input { opacity: 0; width: 200px; height: 60px; display: block; position: absolute; cursor: pointer; z-index: 10;
}
.check { background: green; color: mintcream; width: 200px; overflow: hidden; line-height: 60px; text-align: center; cursor: pointer; margin-bottom: 1em; z-index: 9; border-radius: 3px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: all .2s ease-in-out; transition: all .2s ease-in-out;
}
input:checked + .check { background: green; color: #efefef; padding-left: 56px; /* mAgIc NuMbErS */ position: relative;
}
.check:after { background: rgba(0,0,0,.2); color: #efefef !important; padding: 0 0.5em; display: none; position: absolute; left: 0; content: "✔"; font-size: 2em; border-radius: 3px 0 0 3px; -webkit-transition: left .25s ease-in-out; transition: left .25s ease-in-out;
}
input:checked + .check:after { display: inline;
}
span { float: left; }
input:checked ~ span { float: right; } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="container"> <input type="checkbox"> <div class="check">Left to right</div> <span>I</span> <span>t</span> <span>&nbsp;</span> <span>i</span> <span>s</span> <span>&nbsp;</span> <span>s</span> <span>u</span> <span>p</span> <span>e</span> <span>r</span> <span>&nbsp;</span> <span>e</span> <span>a</span> <span>s</span> <span>y</span> <span>&nbsp;</span> <span>n</span> <span>o</span> <span>w</span> <span>a</span> <span>d</span> <span>a</span> <span>y</span> <span>s</span> <span>&nbsp;</span> <span>t</span> <span>o</span> <span>&nbsp;</span> <span>c</span> <span>o</span> <span>n</span> <span>v</span> <span>e</span> <span>r</span> <span>t</span> <span>&nbsp;</span> <span>y</span> <span>o</span> <span>u</span> <span>r</span> <span>&nbsp;</span> <span>w</span> <span>o</span> <span>r</span> <span>d</span> <span>s</span> <span>&nbsp;</span> <span>f</span> <span>r</span> <span>o</span> <span>m</span> <span>&nbsp;</span> <span>R</span> <span>T</span> <span>L</span> <span>&nbsp;</span> <span>t</span> <span>o</span> <span>&nbsp;</span> <span>L</span> <span>T</span> <span>R</span> <span>.</span>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Stupid RTL Demo - Script Codes CSS Codes

html, body { height: 100%;
}
body { background: mintcream; color: gray; position: relative;
}
.container { font: bold normal 18px/1.618em "Helvetica Neue", Arial, sans-serif; width: 80%; position: absolute; top: 25%; left: 50%; margin-left: -40%;
}
input { opacity: 0; width: 200px; height: 60px; display: block; position: absolute; cursor: pointer; z-index: 10;
}
.check { background: green; color: mintcream; width: 200px; overflow: hidden; line-height: 60px; text-align: center; cursor: pointer; margin-bottom: 1em; z-index: 9; border-radius: 3px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: all .2s ease-in-out; transition: all .2s ease-in-out;
}
input:checked + .check { background: green; color: #efefef; padding-left: 56px; /* mAgIc NuMbErS */ position: relative;
}
.check:after { background: rgba(0,0,0,.2); color: #efefef !important; padding: 0 0.5em; display: none; position: absolute; left: 0; content: "✔"; font-size: 2em; border-radius: 3px 0 0 3px; -webkit-transition: left .25s ease-in-out; transition: left .25s ease-in-out;
}
input:checked + .check:after { display: inline;
}
span { float: left; }
input:checked ~ span { float: right; }

Stupid RTL Demo - Script Codes JS Codes

$('input').click(function() { if($(this).is(':checked')) $('.check').text('Right to left'); else $('.check').text('Left to right');
});
Stupid RTL Demo - Script Codes
Stupid RTL Demo - Script Codes
Home Page Home
Developer Chris Burnell
Username chrisburnell
Uploaded September 16, 2022
Rating 3
Size 3,075 Kb
Views 28,336
Do you need developer help for Stupid RTL Demo?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chris Burnell (chrisburnell) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!