Skip to content

Commit

Permalink
chore(demo): add nicer demo
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas committed Mar 9, 2022
1 parent ba8da0f commit 05f7ee1
Showing 1 changed file with 156 additions and 126 deletions.
282 changes: 156 additions & 126 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,137 +4,167 @@
<meta charset="utf-8" />
<title>tailwindcss-vanilla-rtl</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍦</text></svg>"
/>
<link rel="stylesheet" href="out.css" />
</head>
<body
class="bg-fixed bg-gradient-to-tr from-teal-300 via-cyan-400 to-sky-400"
>
<button
id="switch-alignment"
class="appearance-none bg-gradient-to-br block bs-12 flex-1 font-medium from-cyan-100 my-6 rounded shadow-sm text-cyan-700 to-cyan-200 hover:from-cyan-100 hover:text-cyan-900 hover:to-cyan-300 sm:flex-none sm:px-12 lg:flex-1 lg:px-0"
<body class="bg-gray-50 space-y-4">
<svg hidden>
<defs>
<symbol
id="checkmark"
class="w-6 h-6 flex-none fill-sky-100 stroke-sky-500 stroke-2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="11" />
<path d="m8 13 2.165 2.165a1 1 0 0 0 1.521-.126L16 9" fill="none" />
</symbol>
</defs>
</svg>
<h1
class="text-2xl mt-[10vh] px-4 pt-10 pb-8 sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10 max-w-md mx-auto"
>
Switch Text Direction
</button>
<!--
Welcome to Tailwind Play, the official Tailwind CSS playground!
Everything here works just like it does when you're running Tailwind locally
with a real build pipeline. You can customize your config file, use features
like `@apply`, or even add third-party plugins.
Feel free to play with this example if you're just learning, or trash it and
start from scratch if you know enough to be dangerous. Have fun!
-->
<a
class="underline text-sky-700"
href="https://github.com/thibaudcolas/tailwindcss-vanilla-rtl"
>tailwindcss-vanilla-rtl</a
>
</h1>
<p
class="px-4 pt-10 pb-8 sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10 max-w-md mx-auto"
>
Simple right-to-left (RTL) language support, switching vanilla Tailwind
utilities to
<a href="https://rtlstyling.com/posts/rtl-styling#css-logical-properties"
>CSS logical properties and values</a
>.
</p>
<div
class="min-h-screen bg-gray-50 py-6 flex flex-col justify-center relative overflow-hidden sm:py-12"
dir="ltr"
lang="en"
class="px-4 pt-10 pb-8 bg-white shadow-sm sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10 max-w-md mx-auto"
>
<img
src="/img/beams.jpg"
alt=""
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 max-w-none"
width="1308"
/>
<div
class="absolute inset-0 bg-[url(/img/grid.svg)] bg-center [mask-image:linear-gradient(180deg,white,rgba(255,255,255,0))]"
></div>
<div
class="relative px-4 pt-10 pb-8 bg-white shadow-xl ring-1 ring-gray-900/5 sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10"
>
<div class="max-w-md mx-auto">
<img src="/img/logo.svg" class="h-6" alt="Tailwind Play" />
<div class="divide-y divide-gray-300/50">
<div class="py-8 text-base leading-7 space-y-6 text-gray-600">
<p>
An advanced online playground for Tailwind CSS, including
support for things like:
</p>
<ul class="space-y-4">
<li class="flex items-center">
<svg
class="w-6 h-6 flex-none fill-sky-100 stroke-sky-500 stroke-2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="11" />
<path
d="m8 13 2.165 2.165a1 1 0 0 0 1.521-.126L16 9"
fill="none"
/>
</svg>
<p class="ml-4">
Customizing your
<code class="text-sm font-bold text-gray-900"
>tailwind.config.js</code
>
file
</p>
</li>
<li class="flex items-center">
<svg
class="w-6 h-6 flex-none fill-sky-100 stroke-sky-500 stroke-2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="11" />
<path
d="m8 13 2.165 2.165a1 1 0 0 0 1.521-.126L16 9"
fill="none"
/>
</svg>
<p class="ml-4">
Extracting classes with
<code class="text-sm font-bold text-gray-900">@apply</code>
</p>
</li>
<li class="flex items-center">
<svg
class="w-6 h-6 flex-none fill-sky-100 stroke-sky-500 stroke-2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="11" />
<path
d="m8 13 2.165 2.165a1 1 0 0 0 1.521-.126L16 9"
fill="none"
/>
</svg>
<p class="ml-4">Code completion with instant preview</p>
</li>
</ul>
<p>
Perfect for learning how the framework works, prototyping a new
idea, or creating a demo to share online.
</p>
</div>
<div class="pt-8 text-base leading-7 font-semibold">
<p class="text-gray-900 text-left">
Want to dig deeper into Tailwind?
</p>
<p>
<a
href="https://tailwindcss.com/docs"
class="text-sky-500 hover:text-sky-600"
>Read the docs &rarr;</a
>
</p>
</div>
</div>
</div>
</div>
<blockquote class="border-l-4 border-gray-300 pl-2">
Let the beauty of what you love be what you do.
</blockquote>
<ul class="space-y-2 mt-4">
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>English
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>Arabic
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>Hebrew
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>Persian
</li>
</ul>
</div>
<div
dir="rtl"
lang="ar"
class="px-4 pt-10 pb-8 bg-white shadow-sm sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10 max-w-md mx-auto"
>
<blockquote class="border-l-4 border-gray-300 pl-2">
ما تبحث عنه يبحث عنك
</blockquote>
<ul class="space-y-2 mt-4">
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>إنجليزي
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>العربية
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>اللغة العِبْرِيَّة
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>اللُغَةُ الْفَارِسِيَّةُ
</li>
</ul>
</div>
<div
dir="rtl"
lang="he"
class="px-4 pt-10 pb-8 bg-white shadow-sm sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10 max-w-md mx-auto"
>
<blockquote class="border-l-4 border-gray-300 pl-2">
האהבה היא אוקיינוס שאין לו התחלה ואין לו סוף.
</blockquote>
<ul class="space-y-2 mt-4">
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>אנגלית
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>עֲרָבִית
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>עִבְרִית
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>פרסית
</li>
</ul>
</div>
<div
dir="rtl"
lang="fa"
class="px-4 pt-10 pb-8 bg-white shadow-sm sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10 max-w-md mx-auto"
>
<blockquote class="border-l-4 border-gray-300 pl-2">
از محبت، نار نوری می‌شود// وز محبت، دیو حوری می‌شود
</blockquote>
<ul class="space-y-2 mt-4">
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>انگلیسی
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>عربی
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>عبری
</li>
<li>
<svg class="w-6 h-6 inline-block align-bottom mr-2">
<use href="#checkmark"></use></svg
>فارسی
</li>
</ul>
</div>

<script>
(function () {
var htmlElement = document.querySelector("html");
var switchButton = document.querySelector("#switch-alignment");
switchButton.onclick = function (event) {
if (htmlElement.getAttribute("dir") === "ltr") {
htmlElement.setAttribute("dir", "rtl");
} else {
htmlElement.setAttribute("dir", "ltr");
}
};
})();
</script>
</body>
</html>

0 comments on commit 05f7ee1

Please sign in to comment.