مجموعة من ِأشكال أزرار التحميل (PROGRESS BUTTON STYLES)

ProgressButtonStyles   [button type=”bd_button btn_large” url=”http://files.fwasl.com/demo/ProgressButtonStyles/” target=”” button_color_fon=”#3fc2da” button_text_color=”#ffffff” ]أمثلة (demo)   [/button] [button type=”bd_button btn_large” url=”http://files.fwasl.com/webdesign/ProgressButtonStyles.zip” target=”on” button_color_fon=”#3fc2da” button_text_color=”#ffffff” ] التحميل[/button] ملاحظة: سوف نستخدم (transitions – pseudo-elements) وهي ليست مدعومة من بعض المتصفحات مثل (e.g. Safari and Mobile Safari). وانتبه أيضا سوف نستخدم   [highlight] transform-style: preserve-3d [/highlight] الاسكربت الذي قمنا بعمله هو للتوضيح باستخدام كود زر بسيط (simple button markup) [codepen_embed height=”120″ theme_id=”4025″ slug_hash=”Hgabu” default_tab=”html”] &lt;button class=&quot;progress-button&quot; data-style=&quot;rotate-angle-bottom&quot; data-perspective data-horizontal&gt;Submit&lt;/button&gt; See the Pen <a href=’http://codepen.io/fwasl/pen/Hgabu’>Hgabu</a> by mohamed maher (<a href=’http://codepen.io/fwasl’>@fwasl</a>) on <a href=’http://codepen.io’>CodePen</a>. [/codepen_embed]   وتحويلها إلى البنية التالية:   [codepen_embed height=”268″ theme_id=”4025″ slug_hash=”lujeq” default_tab=”html”] &lt;button class=&quot;progress-button&quot; data-style=&quot;rotate-angle-bottom&quot; data-perspective data-horizontal&gt; &lt;span class=&quot;progress-wrap&quot;&gt; &lt;span class=&quot;content&quot;&gt;Submit&lt;/span&gt; &lt;span class=&quot;progress&quot;&gt; &lt;span class=&quot;progress-inner&quot;&gt;&lt;/span&gt; &lt;/span&gt; &lt;/span&gt; &lt;/button&gt; See the Pen <a href=’http://codepen.io/fwasl/pen/lujeq’>lujeq</a> by mohamed maher (<a href=’http://codepen.io/fwasl’>@fwasl</a>) on <a href=’http://codepen.io’>CodePen</a>. [/codepen_embed]   اذا لم نقم بضبط دالة   [highlight] data-perspective [/highlight]   سنستخدم هذا الكود [codepen_embed height=”200″ theme_id=”4025″ slug_hash=”niuAz” default_tab=”html”] &lt;button class=&quot;progress-button&quot; data-style=&quot;fill&quot; data-horizontal&gt; &lt;span class=&quot;content&quot;&gt;Submit&lt;/span&gt; &lt;span class=&quot;progress&quot;&gt; &lt;span class=&quot;progress-inner&quot;&gt;&lt;/span&gt; &lt;/span&gt; &lt;/button&gt; See the Pen <a href=’http://codepen.io/fwasl/pen/niuAz’>niuAz</a> by mohamed maher (<a href=’http://codepen.io/fwasl’>@fwasl</a>) on <a href=’http://codepen.io’>CodePen</a>. [/codepen_embed] كود الـ css التالي يستخدم عامة في التصميم لكل الأزرار (ملاحظة: هذه الأكواد هامة للأزرار ثلاثية الأبعاد): [codepen_embed height=”268″ theme_id=”4025″ slug_hash=”niuAz” default_tab=”css”] *, *:after, *::before { box-sizing: border-box; } @font-face { font-weight: normal; font-style: normal; font-family: ‘icomoon’; src:url(‘../fonts/icomoon/icomoon.eot’); src:url(‘../fonts/icomoon/icomoon.eot?#iefix’) format(’embedded-opentype’), url(‘../fonts/icomoon/icomoon.ttf’) format(‘truetype’), url(‘../fonts/icomoon/icomoon.woff’) format(‘woff’), url(‘../fonts/icomoon/icomoon.svg#icomoon’) format(‘svg’); } .progress-button { position: relative; display: inline-block; padding: 0 60px; outline: none; border: none; background: #1d9650; color: #fff; text-transform: uppercase; letter-spacing: 1px; font-size: 1em; line-height: 4; } .progress-button[disabled], .progress-button[disabled].state-loading { cursor: default; } .progress-button .content { position: relative; display: block; } .progress-button .content::before, .progress-button .content::after { position: absolute; right: 20px; color: #0e7138; font-family: &quot;icomoon&quot;; opacity: 0; transition: opacity 0.3s 0.3s; } .progress-button .content::before { content: &quot;\e600&quot;; /* Checkmark for success */ } .progress-button .content::after { content: &quot;\e601&quot;; /* Cross for error */ } .progress-button.state-success .content::before, .progress-button.state-error .content::after { opacity: 1; } .notransition { transition: none !important; } .progress-button .progress { background: #148544; } .progress-button .progress-inner { position: absolute; left: 0; background: #0e7138; } .progress-button[data-horizontal] .progress-inner { top: 0; width: 0; height: 100%; transition: width 0.3s, opacity 0.3s; } .progress-button[data-vertical] .progress-inner { bottom: 0; width: 100%; height: 0; transition: height 0.3s, opacity 0.3s; } /* Necessary styles for buttons with 3D transforms */ .progress-button[data-perspective] { position: relative; display: inline-block; padding: 0; background: transparent; perspective: 900px; } .progress-button[data-perspective] .content { padding: 0 60px; background: #1d9650; } .progress-button[data-perspective] .progress-wrap { display: block; transition: transform 0.2s; transform-style: preserve-3d; } .progress-button[data-perspective] .content, .progress-button[data-perspective] .progress { outline: 1px solid rgba(0,0,0,0); /* Smoothen jagged edges in FF */ } See the Pen <a href=’http://codepen.io/fwasl/pen/niuAz’>niuAz</a> by mohamed maher (<a href=’http://codepen.io/fwasl’>@fwasl</a>) on <a href=’http://codepen.io’>CodePen</a>. [/codepen_embed] لاحظ أن في الامثلة ثلاثية الأبعاء (3D) , سوف نستخدم الزر كـ “shell” ليضيف شكل ثلاثي الأبعاد. محتوي الـ “span” سيحتوي علي أكواد التنسيق للأزرار مثل  لون الخلفية (background color) و (padding) .  

مثال لكود وشكل زر ثلاثي الأبعاء

  [codepen_embed height=”268″ theme_id=”4025″ slug_hash=”Aivdk” default_tab=”css”] /* Rotate bottom 3d */ /* ====================== */ .progress-button[data-style=&quot;rotate-angle-bottom&quot;] .progress { position: absolute; top: 100%; left: 0; width: 100%; height: 20px; box-shadow: 0 -1px 0 #148544; /* fix the blurriness that causes a gap */ transform: rotateX(-90deg); transform-origin: 50% 0%; } .progress-button[data-style=&quot;rotate-angle-bottom&quot;].state-loading .progress-wrap { transform: rotateX(45deg); } See the Pen <a href=’http://codepen.io/fwasl/pen/Aivdk’>Aivdk</a> by mohamed maher (<a href=’http://codepen.io/fwasl’>@fwasl</a>) on <a href=’http://codepen.io’>CodePen</a>. [/codepen_embed]   وفي النهاية نأمل أن تجد هذه الأزرار ملهمة وذات فائدة لك!]]>

شارك

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *

مقالات ذات صلة