Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ 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

Auto Save

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

              
                	<section>
			<ul class='nav-tags'>
				<li class='tag more' id='show-all'>All</li>
				<li class='tag more' id='show-random'>Random</li>
				<li class='tag more' id='show-logos'>Logo</li>
				<li class='tag more' id='show-site'>Webdesign</li>
				<li class='tag more' id='show-articles'>Misc</li>
			</ul>
		</div>
	</section>
	<!-- Grid -->
	<main class='border grid-container-main' id="folioSection">
	</main>

              
            
!

CSS

              
                /* grid homepage portfolio ************************************/
.grid-container-main {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
	background: url(../img/trame-nb-min.svg);
}
.grid-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
}
.border {border: 1px solid black;}
.item,.item-txt,.item-top {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20%;
  border: 1px solid black;
}
/* buttons */
.more {
	-webkit-border-radius: 3;
	border-radius: 3px;
	padding: 6px 12px;
	font-family: Arial;
	color: white;
	background: black;
	user-select: none;
	cursor: pointer;
  text-decoration: none;
}
.more:hover {background: darkviolet;}
.more:visited,.more:active {
	color: white;
}
/* nav tags ***********************************************/
.nav-tags {
	display: flex;
	flex-flow: wrap;
	width: 100%;
	align-content: center;
	align-items: center; /* vertical */
	justify-content: center;
	list-style-type: none;
}
.tag {
	text-align: center;
	margin: 1em 1em 0 1em;
}
.project {color: #666;}
.job {color: #999;}
.padbottom {padding-bottom: 1.5em;}
p {line-height: 1.6em;}
              
            
!

JS

              
                // container section
const folioSection = document.getElementById('folioSection');

let createdArticles = [];
let showClass = createdArticles;

document.getElementById("show-all").onclick = () => { showAll() };
document.getElementById("show-random").onclick = () => { showRandom() };
document.getElementById("show-logos").onclick = () => { showLogos() };
document.getElementById("show-site").onclick = () => { showSite() };
document.getElementById("show-articles").onclick = () => { showArticles() };

function show() {
    for (let i = 0; i < showClass.length; i++) {
        showClass[i].style.display = "grid";
    }
}

function showAll() {
    hide();
    showClass = document.querySelectorAll(".grid-container");
    show();
}

function hide() {
    for (let i = 0; i < showClass.length; i++) {
        showClass[i].style.display = "none";
    }
}

// show classes
function showLogos() {
    hide();
    showClass = document.querySelectorAll(".logo-design");
    show();
}
function showArticles() {
    hide();
    showClass = document.querySelectorAll(".articles");
    show();
}
function showSite() {
    hide();
    showClass = document.querySelectorAll(".webdesign");
    show();
}
function showRandom() {
    hide();
    showClass = document.querySelectorAll(".grid-container");
    let randomClass = Math.floor(Math.random() * showClass.length);
    showClass[randomClass].style.display = "grid";
}
/**************************************************

// Generate HTML ///////////////////////////////////////////////////

*************************************************** */
function createPost(title, subTitle, proj, jobtxt, cat, imgSrc, alt, lien, lienTxt) {
    let article = document.createElement('article');
    article.className = ('grid-container');
    article.classList.add(cat);
    // add div item
    let item = document.createElement('div');
    item.className = ('item');
    article.appendChild(item);
    // add img
    let img = document.createElement('img');
    img.className = ('bitmap');
    img.src = imgSrc;
    img.alt = alt;
    item.appendChild(img);
    // add div itemTxt
    let itemTxt = document.createElement('div');
    itemTxt.className = ('item-txt');
    article.appendChild(itemTxt);
    let divTxt = document.createElement('div');
    itemTxt.appendChild(divTxt);
    let h2 = document.createElement('h2');
    h2.className = ('padbottom');
    h2.innerHTML = title;
    divTxt.appendChild(h2);
    let sub = document.createElement('p');
    sub.innerHTML = subTitle;
    divTxt.appendChild(sub);
    let pProject = document.createElement('p');
    pProject.className = ('padbottom');
    divTxt.appendChild(pProject);
    let project = document.createElement('span');
    project.className = ('project');
    project.innerHTML = proj + "<br />";
    pProject.appendChild(project);
    let job = document.createElement('span');
    job.className = ('job');
    job.innerHTML = jobtxt;
    pProject.appendChild(job);
    // link / button
    let link = document.createElement('a');
    link.className = ('more');
    link.href = lien;
    link.innerHTML = lienTxt;
    link.title = lienTxt;
    // include button if available
    if (!/^[a-z]{1,}$/.test(lien)) {
        divTxt.appendChild(link);
    } else {
        link.style.display = "none";
    }
    // add article to array
    createdArticles.push(article);
    // add array to section
    for(let i = createdArticles.length - 1; i > 0; i--){
        const j = Math.floor(Math.random() * i);
        const temp = createdArticles[i];
        createdArticles[i] = createdArticles[j];
        createdArticles[j] = temp;
        folioSection.appendChild(temp);
    }    
}
// Générer articles

// logo SEA :
createPost(
    // title :
    "Design de logo mobile",
    // subTitle
    "pour une entreprise de jeux video mobiles basée à Singapour",
    // projet
    "Projet : SEA",
    // job
    "Freelance",
    // catégorie
    "logo-design",
    // img
    "http://www.jpg-design.com/img/logos/sea-logo-min.svg",
    // alt
    "logo"
);
// logo smart letterpress :
createPost(
    // title :
    "Logo Letterpress",
    // subTitle
    "pour une imprimerie proposant de l&rsquo;impression typographique",
    // projet
    "Projet : Smart-letterpress",
    // job
    "Rôle : Direction artistique",
    // catégorie
    "logo-design",
    // img
    "http://www.jpg-design.com/img/logos/smart-letterpress-logo-min.svg",
    // alt
    "logo"
);
// logo BSN :
createPost(
    // title :
    "Création de logos corporate",
    // subTitle
    "Relooking des logos de filiales",
    // projet
    "Projet : BSN Consulting",
    // job
    "Rôle : Direction artistique",
    // catégorie
    "logo-design",
    // img
    "http://www.jpg-design.com/img/logos/bsn-logo-min.svg",
    // alt
	"logo BSN utilisant un espace négatif pour écrire le S en blanc sur fond bleu",
	// lien
	"#",
	// texte lien
	"see logos"
);
// logo retraide :
createPost(
    // title h2 :
    "Conception d'un intranet",
    // subTitle
    "Sass UX : Design de l'interface utilisateur",
    // projet
    "Projet : Retraide",
    // job
    "Freelance",
    // catégorie
    "webdesign",
    // img
    "http://www.jpg-design.com/img/logos/intranet-logo-design-min.svg",
    // alt
    "logo BSN utilisant un espace négatif pour écrire le S en blanc sur fond bleu",
    // lien
    "#",
    // texte lien
    "see"
);
// logo ichooser :
createPost(
    // title h2 :
    "Logo e-commerce",
    // subTitle
    "Design collaboratif avec 12 designers",
    // projet
    "Projet : Site Comparateur de prix",
    // job
    "Rôle : Creative team leader",
    // catégorie
    "logo-design",
    // img
    "http://www.jpg-design.com/img/logos/ichooser-logo-min.svg",
    // alt
    "logo",
    // lien
    "#",
    // texte lien
    "see"
);
// pao :
createPost(
    // title h2 :
    "PAO",
    // subTitle
    "Print projects",
    // projet
    "Clients",
    // job
    "Designer",
    // catégorie
    "articles",
    // img
    "http://www.jpg-design.com/img/logos/pao-min.svg",
    // alt
    "pao",
    // lien
    "#",
    // texte lien
    "see"
);
// antinoe :
createPost(
    // title h2 :
    "design du nouveau site d'une librairie",
    // subTitle
    "Actualisation du site & de la boutique",
    // projet
    "Client : Antinoë",
    // job
    "Webdesigner",
    // catégorie
    "webdesign",
    // img
    "http://www.jpg-design.com/img/logos/horus-eye-min.svg",
    // alt
    "design web",
    // lien
    "#",
    // texte lien
    "see"
);

//milliondollart
createPost("Milliondollart logo", "pour une galerie d'art en ligne", "Milliondollart", "Freelance", 'logo-design', 'http://www.jpg-design.com/img/logos/milliondollart-logo-min.svg', "logo");
// IB
createPost("Relooking de site Wordpress", "Simplification de l'arborescence du site", "Projet : Informatique Brest", "Rôle : Développeur Wordpress", 'webdesign', 'http://www.jpg-design.com/img/logos/ib-white-logo-min.svg', "logo");

              
            
!
999px

Console