HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<body>
<div class='post-body'>
<h2 class='post-title'>اسحب المحتوى باستخدام الماوس</h2>
<h2 class='postitle'>من قصص جحا المضحكة :</h2>
<p>سأله رجل أيهما أفضل يا جحا؟.. المشي خلف الجنازة أم أمامها.. فقال جحا: لا تكن على النعش وامش حيث شئت</p>
<p>رأى جحا يوما سربا من البط قريبا من شاطئ بحيرة فحاول أن يلتقط من هذه الطيور شيئا فلم يستطع لأنها أسرعت بالفرار من أمامه.. وكان معه قطعة من الخبز فراح يغمسها بالماء ويأكلها.. فمر به أحدهم وقال له: هنيئاً لك ما تأكله فما هذا؟.. قال: هو حساء البط فإذا فاتك البط فاستفد من مرقه
</p><p>ضاع حماره فحلف أنه إذا وجده أن يبيعه بدينار، فلما وجده جاء بقط وربطه بحبل وربط الحبل في رقبة الحمار وأخرجهما إلى السوق وكان ينادي: من يشتري حمارا بدينار، وقطا بمائة دينار؟ ولكن لا أبيعهما إلا معا
</p>
<p>أعطى خادما له جرة ليملأها من النهر، ثم صفعه على وجهه صفعة شديدة وقال له: إياك أن تكسر الجرة، فقيل له: لماذا تضربه قبل أن يكسرها؟ فقال: أردت أن أريه جزاء كسرها حتى يحرص عليها
</p>
<p>مشى في طريق، فدخلت في رجله شوكة فآلمته، فلما ذهب إلى بيته أخرجها وقال: الحمد لله، فقالت زوجته: على أي شيء تحمد الله؟ قال: أحمده على أني لم أكن لابسا حذائي الجديد وإلا خرقته الشوكة
</p>
<p>سئل جحا يوما: كم عمرك؟ فقال عمري أربعون عاما.. وبعد مضي عشرة أعوام سئل أيضا عن عمره فقال عمري أربعون عاما فقالوا له: إننا سألناك منذ عشر سنين فقلت إنه أربعون والآن تقول أيضا إنه أربعون فقال: أنا رجل لا أغير كلامي ولا أرجع عنه وهذا شأن الرجال الأحرار</p>
<p>طبخ طعاما وقعد يأكل مع زوجته فقال: ما أطيب هذا الطعام لولا الزحام! فقالت زوجته: أي زحام إنما هو أنا وأنت؟ قال: كنت أتمنى أن أكون أنا والقِدر لا غير
</p>
<p>جاءه ضيف ونام عنده فلما كان منتصف الليل أفاق الضيف ونادى جحا قائلا: ناولني يا سيدي الشمعة الموضوعة على يمينك فاستغرب جحا طلبه وقال له: أنت مجنون، كيف أعرف جانبي الأيمن في هذا الظلام الدامس؟</p>
<p>سألوه يوماً: ما هو طالعك؟ فقال: برج التيس. قالوا: ليس في علم النجوم برج اسمه تيس. فقال: لما كنت طفلا فتحت لي والدتي طالعي فقالوا لها أنه في برج الجدي. والآن قد مضى على ذلك أربعون عاماً فلا شك أن الجدي من ذلك الوقت قد صار الآن تيسا وزيادة
</p>
<p>سكن في دار بأجرة، وكان خشب السقف يقرقع كثيرا، فلما جاء صاحب الدار يطالبه بالأجرة قال له: أصْلِحْ هذا السقف فإنه يقرقع، قال: لا بأس عليك فإنه يسبح الله، قال جحا: أخاف أن تدركه خشية فيسجد
</p>
<p>أحست امرأة جحا ببعض الألم فأشارت عليه أن يدعو الطبيب، فنزل لإحضاره، وحينما خرج من البيت أطلّت عليه امرأته من النافذة وقالت له الحمد لله لقد زال الألم فلا لزوم للطبيب. لكنه أسرع إلى الطبيب وقال له: إن زوجتي كانت قد أحست بألم وكلفتني أن أدعوك، لكنها أطلت من النافذة وأخبرتني أنها قد زال ألمها فلا لزوم لأدعوك، ولذلك قد جئت أبلغك حتى لا تتحمل مشقة الحضور
</p><p>جاءته إحدى جاراته وقالت له: أنت تعلم أن ابنتي معتوهة متمردة، فأرجو أن تقرأ لها سورة أو تكتب لها حجابا، فقال له: إن قراءة رجل مسن مثلي لا تفيدها، ولكن ابحثي لها عن شاب في سن الخامسة والعشرين أو الثلاثين، ليكون لها زوجا وشيخا معا، ومتى رزقت أولادا صارت عاقلة طائعة
</p>
<p>سئل يوما: أيهما أكبر، السلطان أم الفلاح؟ فقال: الفلاح أكبر لأنه لو لم يزرع القمح لمات السلطان جوعا
</p>
<p>قيل له يوما: كم ذراعا مساحة الدنيا؟ وفي تلك اللحظة مرت جنازة، فقال لهم: هذا الميت يرد على سؤالكم فاسألوه، لأنه ذرع الدنيا وخرج منها
</p>
<p>كان أمير البلد يزعم أنه يعرف نظم الشعر، فأنشد يوما قصيدة أمام جحا وقال له: أليست بليغة؟ فقال جحا: ليست بها رائحة البلاغة. فغضب الأمير وأمر بحبسه في الإسطبل، فقعد محبوسا مدة شهر ثم أخرجه. وفي يوم آخر نظم الأمير قصيدة وأنشدها لجحا، فقام جحا مسرعا، فسأله الأمير: إلى أين يا جحا؟ فقال: إلى الإسطبل يا سيدي
</p>
<h2 class='postitle'>من طرائف جحا</h2>
<p>قيل أن جحا قام بشراء عشرة حمير فركب واحدا منها وساق أمامه التسعة الباقية، ثم عدّ الحمير ونسى الحمار الذي كان يمتطيه فوجدها تسعة، فسارع بالنزول من ظهر الحمار و عدها ثانيةً فوجدها عشرة، فركب مرة ثانية وعدها فوجدها تسعة، ثم نزل وعدها فوجدها عشرة و بقي يعيد ذلك مراراً و تكراراً ثم قال: أن أمشي وأربح حمارا خير من أن أركب ويذهب مني حمار فمشى خلف الحمير حتى وصل إلى منزله
</p>
<p>كان جحا يركب قطاراً ثم نزل منه و وضع الحقيبة قربه وانتظر حضور الشيال، فجاء لص فسرقها و حملها ومشى فتبعه جحا وهو فرحان، فلما اقترب من منزله أخذ الحقيبة من اللص و قال له: أشكرك يا سيدي فقد حملت لي الحقيبة من غير أجر
</p>
<p>رأى جحا ذات يوم سربا من البط بالقرب من البحيرة فحاول أن يلتقط من هذه الطيور شيئا إلا أنه لم يستطع لأنها أسرعت بالفرار من أمامه وكان معه قطعة من الخبز فراح يغمسها بالماء ويأكلها فمر به أحدهم وقال له: هنيئاً لك ما تأكله فما هذا؟ فأجابه جحا هو حساء البط فإذا فاتك البط فاستفد من مرقه
</p>
<p>سـتعار جحا في يوم ما طنجرة من أحد جيرانه وعندما أعادها أعاد معها طنجرة أخرى صغيرة فسأله جاره عن سبب إرفاق تلك الطنجرة الصغيرة مع تلك التي استعارها فقال جحا ان طنجرتك ولدت في الأمس طنجرة صغيرة وإنها الآن من حقك . وبعد مرور الأيام ذهب جحا إلى جاره مرةً أخرى وطلب منه الطنجرة ثانيةً فأعطاه جاره إياها، وبعد مرور بضعة أيام ذهب جار جحا إلى بيت جحا وطلب منه أن يعيد له طنجرته فقال له جحا وهو باكياً إن طنجرتك قد توفيت بالأمس فقال له جاره متعجباً كيف توفيت الطنجرة فقال جحا أتصدق ان الطنجرة تولد ولا تصدق ان الطنجرة تموت</p>
<p>جاء أحدهم يخبر جحا بأن حماره قد ضاع ففرح جحا فرحاً شديداً وسجد شكراً لله فقيل له : ما لك أيها الأحمق أتفرح و قد ضاع حمارك ؟ فقال له جحا : إني أشكر الله لأني لم أكن راكباً عليه و إلا ضعت معه</p><p>أراد جحا أن يتزوج فبنى داراً كبيرة تتسع له ولأهله وطلب من النجار أن يجعل خشب الأرض على السقوف و خشب السقوف على أرض الحجرات فاندهش النجار و سأله عن السبب في ذلك فقال جحا : أما علمت ياهذا أن المرأة إذا دخلت مكاناً جعلت عاليه واطيه اقلب هذا المكان الآن يعتدل بعدالزواج
</p>
<div class="buttonsBar">
<a href='http://www.ar1web.com/2016/03/add-touch-screen-scroll-effect-to-your-blog.html' target='_blank'><button id="gobackto-ar1web" class="button button--border-thick" data-text="ركب التأثير!"><span>التدوينة</span></button></a>
</div>
</div>
</body>
@font-face{font-family:'Arabic';font-weight:400,700;font-style:normal;src:url(https://c.s-microsoft.com/static/fonts/segoe-ui/arabic/normal/latest.eot);src:url(https://c.s-microsoft.com/static/fonts/segoe-ui/arabic/normal/latest.eot?#iefix) format("embedded-opentype"),url(https://c.s-microsoft.com/static/fonts/segoe-ui/arabic/normal/latest.woff) format("woff"),url(https://c.s-microsoft.com/static/fonts/segoe-ui/arabic/normal/latest.ttf) format("truetype"),url(https://c.s-microsoft.com/static/fonts/segoe-ui/arabic/normal/latest.svg#web) format("svg")}
body {
background-color:#f9f9f9;
font:16px 'Arabic',verdana,tahoma;
direction: rtl;
color:#444; cursor: -webkit-grab;
}
h2.postitle {
text-align: right!important;
color: #333333!important;
}
.post-body h2{
color:#e25633;
text-align:center;
}
.post-body {
max-width:680px;
margin:20px auto;
border:10px solid #f0f0f0;
padding:15px 20px;
background-color:#fff;
color:#444;
}
::-webkit-scrollbar {display: none; }
.buttonsBar{
padding-top: 20px;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-justify-content: center;
justify-content: center;
width:70%;
margin:auto;
}
.button {
cursor: pointer;
font-size: 16px;
font-family: Droid Arabic Naskh,sans-serif;
letter-spacing: 1px;
border-radius: 25px;
float: left;
min-width: 10px;
max-width: 250px;
display: block;
margin: 1em;
margin-left: 8px;
margin-right: 8px;
padding: 1em 0em;
border: none;
background: none;
color: inherit;
vertical-align: middle;
position: relative;
z-index: 1;
-webkit-backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
overflow: hidden;
color: #FFFFFF;
min-width: 210px;
background-color: #2C323C;
font-weight: bold;
}
.redBandButton{
padding: 0;
min-width: 280px;
}
.button.button--inverted {
color: #37474f;
border-color: #37474f;
}
.button::before,
.button::after {
content: attr(data-text);
position: absolute;
width: 100%;
height: 50%;
left: 0;
background: #47cf73;
color: #fff;
overflow: hidden;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
}
.button.button--inverted::before,
.button.button--inverted::after {
background: #fff;
color: #37474f;
}
.button::before {
border-radius: 5px;
top: 0;
padding-top: 1em;
}
.button.redBandButton::before {
content: attr(data-text-1);
padding-top: 7px;
font-family: avenirMed, sans-serif;
font-size: 16px;
}
.button#storyButton::before{
padding-top: 15px;
}
.button::after {
border-radius: 0px 0px 20px 20px;
bottom: 0;
line-height: 0;
}
.button > span {
display: block;
-webkit-transform: scale3d(0.2, 0.2, 1);
transform: scale3d(0.2, 0.2, 1);
opacity: 0;
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
transition: transform 0.3s, opacity 0.3s;
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
}
.button:hover::before {
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0);
}
.button:hover::after {
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
.button:hover > span {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
function TouchScroll() {
var instance = this;
var Event = {
CHANGE: 'change',
COMPLETE: 'complete',
ERROR: 'error',
TOUCH_START: 'touchstart',
TOUCH_MOVE: 'touchmove',
TOUCH_END: 'touchend',
MOUSE_DOWN: 'mousedown',
MOUSE_MOVE: 'mousemove',
MOUSE_UP: 'mouseup'
};
this.options = {
'element': null
};
var drag = false;
var startevent = {};
var startpercentage = {};
var axis = 'y';
var target;
this.load = function(data) {
for (var item in data) {this.options[item] = data[item];}
addListeners();
setupAnimation();
}
function setupAnimation() {
window.requestAnimFrame = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element) {window.setTimeout(callback, 1000 / 60);};
})();
}
function addListeners() {
if (instance.options.element.addEventListener) {
instance.options.element.addEventListener(Event.MOUSE_DOWN, onTouchStart, false);
instance.options.element.addEventListener(Event.MOUSE_MOVE, onTouchMove, false);
instance.options.element.addEventListener(Event.MOUSE_UP, onTouchEnd, false);
instance.options.element.addEventListener(Event.TOUCH_START, onTouchStart, false);
instance.options.element.addEventListener(Event.TOUCH_MOVE, onTouchMove, false);
instance.options.element.addEventListener(Event.TOUCH_END, onTouchEnd, false);
}
}
function onTouchStart(e) {
drag = true;
target = instance.options.element || e.target;
startevent = e;
startpercentage = {x: (e.x/window.innerWidth)*100, y: (e.y/window.innerHeight)*100}
//console.log('onTouchStart', e, target);
e.preventDefault();
}
function onTouchMove(e) {
if (drag == true) {
var diffx = (startevent.pageX-e.pageX);
var diffy = (startevent.pageY-e.pageY);
target.scrollLeft += diffx;
target.scrollTop += diffy;
if (Math.abs(diffx) > 60) {axis = 'x';}
else if (Math.abs(diffy) > 100) {axis = 'y';}
//console.log('onTouchMove', target, diffx, diffy);
e.preventDefault();
}
}
function onTouchEnd(e) {
drag = false;
var endpercentage = {x: (e.x/window.innerWidth)*100, y: (e.y/window.innerHeight)*100}
var diffpercentagex = -(endpercentage.x-startpercentage.x);
var diffpercentagey = -(endpercentage.y-startpercentage.y);
var diffx = (window.innerWidth/100)*diffpercentagex;
var diffy = (window.innerHeight/100)*diffpercentagey;
//console.log('onTouchEnd', e, diffpercentagex, diffpercentagey);
//animate();
scrollAxis(diffx*1.5, diffy*1.5, axis);
e.preventDefault();
}
function animate() {
requestAnimFrame(animate);
console.log('animate');
}
function scrollAxis(diffx, diffy, axis) {
var x = target.scrollLeft;
var y = target.scrollTop;
var start = y;
var stop = start+diffy;
if (axis == 'x') {
start = x;
stop = start+diffx;
}
var distance = stop > start ? stop - start : start - stop;
if (distance < 50) {
if (axis == 'x') { instance.updatePosition(stop, y); }
else { instance.updatePosition(x, stop); }
return;
}
var speedY = Math.round(distance);
if (speedY >= 20) speedY = 20;
var step = Math.round(distance / 30);
var leapY = stop > start ? start + step : start - step;
var timer = 0;
//console.log(axis, distance, target, start, stop);
if (stop > start) {
for ( var i=start; i<stop; i+=step ) {
if (axis == 'x') { setTimeout("touchscroll.updatePosition("+leapY+", 0)", timer*speedY); }
else { setTimeout("touchscroll.updatePosition(0, "+leapY+")", timer*speedY); }
leapY += step;
if (leapY > stop) leapY = stop;
timer++;
}
return;
}
for ( var i=start; i>stop; i-=step ) {
if (axis == 'x') { setTimeout("touchscroll.updatePosition("+leapY+", 0)", timer*speedY); }
else { setTimeout("touchscroll.updatePosition(0, "+leapY+")", timer*speedY); }
leapY -= step;
if (leapY < stop) leapY = stop;
timer++;
}
}
this.updatePosition = function(x, y) {
//console.log('window.scrollTo', x, y);
target.scrollLeft = x;
target.scrollTop = y;
}
}
TouchScroll.prototype = new TouchScroll();
var touchscroll = new TouchScroll();
touchscroll.load({
'element': document.getElementsByTagName('body')[0]
});
Also see: Tab Triggers