Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <form id="main" v-cloak>

	<div class="bar">

		<!-- Кнопки для переключения вариантов сетки. -->

		<a class="list-icon" v-bind:class="{ 'active': layout == 'list'}" v-on:click="layout = 'list'"></a>
		<a class="grid-icon" v-bind:class="{ 'active': layout == 'grid'}" v-on:click="layout = 'grid'"></a>
	</div>


	<ul v-if="layout == 'grid'" class="grid">
		<!-- Вариант с большими изображениями и без текста -->
		<li v-for="a in articles">
			<a v-bind:href="a.url" target="_blank"><img v-bind:src="a.image.large" /></a>
		</li>
	</ul>

	<ul v-if="layout == 'list'" class="list">
		<!-- Компактный вариант с фото и подписями -->
		<li v-for="a in articles">
			<a v-bind:href="a.url" target="_blank"><img v-bind:src="a.image.small" /></a>
			<p>{{a.title}}</p>
		</li>
	</ul>

</form>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.5/vue.min.js"></script>
              
            
!

CSS

              
                
[v-cloak] {
  display: none;
}

*{
	margin:0;
	padding:0;
}

body{
	font:15px/1.3 'Open Sans', sans-serif;
	color: #5e5b64;
	text-align:center;
}

a, a:visited {
	outline:none;
	color:#389dc1;
}

a:hover{
	text-decoration:none;
}

section, footer, header, aside, nav{
	display: block;
}

/*-------------------------
	Строка с переключателями
--------------------------*/

.bar{
	background-color:#5c9bb7;

	background-image:-webkit-linear-gradient(top, #5c9bb7, #5392ad);
	background-image:-moz-linear-gradient(top, #5c9bb7, #5392ad);
	background-image:linear-gradient(top, #5c9bb7, #5392ad);

	box-shadow: 0 1px 1px #ccc;
	border-radius: 2px;
	width: 580px;
	padding: 10px;
	margin: 45px auto 25px;
	position:relative;
	text-align:right;
	line-height: 1;
}

.bar a{
	background:#4987a1 center center no-repeat;
	width:32px;
	height:32px;
	display:inline-block;
	text-decoration:none !important;
	margin-right:5px;
	border-radius:2px;
	cursor:pointer;
}

.bar a.active{
	background-color:#c14694;
}

.bar a.list-icon{
	background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZ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-height: 19px;
	padding: 11px 0;

	border-radius: 2px;
	box-shadow: 0 2px 8px #c4c4c4 inset;
	text-align: left;
	font-size: 14px;
	font-family: inherit;
	color: #738289;
	font-weight: bold;
	outline: none;
	text-indent: 40px;
}

/*-------------------------
	Список
--------------------------*/

ul.list{
	list-style: none;
	width: 500px;
	margin: 0 auto;
	text-align: left;
}

ul.list li{
	border-bottom: 1px solid #ddd;
	padding: 10px;
	overflow: hidden;
}

ul.list li img{
	width:120px;
	height:80px;
	float:left;
	border:none;
}

ul.list li p{
	margin-left: 135px;
	font-weight: bold;
	color:#6e7a7f;
}

/*-------------------------
	Сетка
--------------------------*/

ul.grid{
	list-style: none;
	width: 570px;
	margin: 0 auto;
	text-align: left;
}

ul.grid li{
	padding: 2px;
	float:left;
}

ul.grid li img{
	width:280px;
	height:280px;
	object-fit: cover;
	display:block;
	border:none;
}
              
            
!

JS

              
                var demo = new Vue({
	el: '#main',
	data: {
        // Настройка начального варианта разметки, возможные варианты – сетка (grid) и список (list).
		layout: 'grid',

        articles: [{
            "title": "27 сайтов с задачками для оттачивания навыков программирования",
            "url": "https://proglib.io/p/27-puzzle-websites-to-sharpen-your-skills/",
            "image": {
                "large": "https://proglib.io/wp-content/uploads/2016/10/coding-time.jpg",
                "small": "https://proglib.io/wp-content/uploads/2016/10/coding-time-324x160.jpg"
            }
        },
        {
            "title": "Готовимся к собеседованию в Google: 8 месяцев непрерывной работы",
            "url": "https://proglib.io/p/8-month-for-google-interview/",
            "image": {
                "large": "https://proglib.io/wp-content/uploads/2017/01/0_b11a3_8ff3ef7b_XL.jpg",
                "small": "https://proglib.io/wp-content/uploads/2017/01/0_b11a3_8ff3ef7b_XL-324x160.jpg"
            }
        },
        {
            "title": "15 материалов по разработке игр",
            "url": "https://proglib.io/p/gamedev-compilation/",
            "image": {
                "large": "https://proglib.io/wp-content/uploads/2017/05/gamedev.png",
                "small": "https://proglib.io/wp-content/uploads/2017/05/gamedev-324x160.png"
            }
        },
        {
            "title": "Учебный план по осваиванию современного JavaScript",
            "url": "https://proglib.io/p/learning-modern-javascript/",
            "image": {
                "large": "https://proglib.io/wp-content/uploads/2016/12/1raWO3dhM4jMjf9VY-kZzNg.png",
                "small": "https://proglib.io/wp-content/uploads/2016/12/1raWO3dhM4jMjf9VY-kZzNg-324x160.png"
            }
        },
        {
            "title": "10 лучших видеокурсов для изучения Linux",
            "url": "https://proglib.io/p/linux-courses/",
            "image": {
                "large": "https://proglib.io/wp-content/uploads/2017/01/ruqlwta5wqy.jpg",
                "small": "https://proglib.io/wp-content/uploads/2017/01/ruqlwta5wqy-324x160.jpg"
            }
        },
        {
            "title": "Путь веб-разработчика в 2017",
            "url": "https://proglib.io/p/2017-web-developer-path/",
            "image": {
                "large": "https://proglib.io/wp-content/uploads/2017/05/img-web-development-1.jpg",
                "small": "https://proglib.io/wp-content/uploads/2017/05/img-web-development-1-324x160.jpg"
            }
        }]

	}
});
              
            
!
999px

Console