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.
<div id="catan-page" class="container">
<main>
<div id="main_content" class="container">
<div class="main_content">
<div class="catan-content-inner">
<div class="catan-content-inner_1">
<div class="catan-content-inner_2">
<div class="catan-content-inner_3">
<div class="catan-content-inner_4">
<div class="catan-table">
<div class="catan-content-inner-cel">
<div class="hexagon no20"><span class="night"></span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image sult"></div></div></div></div></div>
<div class="hexagon no9"><span>5</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image sheep"></div></div></div></div></div>
<div class="hexagon no14"><span>2</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wood"></div></div></div></div></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon no18"><span class="red">8</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image steel"></div></div></div></div></div>
<div class="hexagon no4"><span>10</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wheat"></div></div></div></div></div>
<div class="hexagon no15"><span>9.</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wood"></div></div></div></div></div>
<div class="hexagon no7"><span class="red">6.</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image soil"></div></div></div></div></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon no2"><span>4</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wheat"></div></div></div></div></div>
<div class="hexagon no8"><span>3</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image sheep"></div></div></div></div></div>
<div class="hexagon no6"><span>11</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image soil"></div></div></div></div></div>
<div class="hexagon no10"><span>4</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image sheep"></div></div></div></div></div>
<div class="hexagon no19"><span>3</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image steel"></div></div></div></div></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon no3"><span>11</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wheat"></div></div></div></div></div>
<div class="hexagon no12"><span class="red">6.</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wood"></div></div></div></div></div>
<div class="hexagon no1"><span>5</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wheat"></div></div></div></div></div>
<div class="hexagon no16"><span class="red">8</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image steel"></div></div></div></div></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon no5"><span>11</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image soil"></div></div></div></div></div>
<div class="hexagon no11"><span>9.</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image sheep"></div></div></div></div></div>
<div class="hexagon no13"><span>10</span><div class="hexagon__inner-1"><div class="hexagon__inner-2"><div class="hexagon__inner-3"><div class="hexagon__inner-image wood"></div></div></div></div></div>
</div>
</div>
<div class="catan-back">
<div class="catan-content-inner-cel">
<div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div>
</div>
<div class="catan-content-inner-cel">
<div class="hexagon"></div><div class="hexagon"></div><div class="hexagon"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="catan-content-inner">
</div>
</div>
</div>
</main>
</div>
$white: #ffffff;
$l_gray: #fafafa;
$gray: #e5e5e5;
$d_gray: #666666;
$black: #000000;
/*catan content*/
#catan-page {
.main_content {
position: relative;
overflow: hidden !important;
div[class*="catan-content-inner"] {
display: grid;
position: relative;
z-index: 1;
&:before,
&:after {
content: '';
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
z-index: 0;
}
&:before {
transform: rotate(60deg);
}
&:after {
transform: rotate(-60deg);
}
}
div[class*="catan-content-inner_"] {
display: flex;
display: -ms-flexbox;
flex-wrap: wrap;
-ms-flex-wrap: wrap;
margin: .3vw auto;
-webkit-justify-content: center;
justify-content: center;
-webkit-align-items: center;
align-items: center;
}
.catan-content-inner {
margin: 10vw auto 20vw;
height: 27.64608842vw;
width: 48vw;
transform: perspective(800px) rotateX(60deg) rotateZ(0deg);
animation:4s linear infinite rotation 6s, 10s linear infinite bg1;
&:before, &:after { animation: 10s linear infinite bg1 }
&:last-child {
top: 0;
margin-top: -30%;
margin-bottom: 20%;
animation:4s linear infinite rotation_bg 6s;
position: relative;
z-index: -1;
background-color: rgb(50, 50, 50);
box-shadow: 3vw 0 1.5vw 0px #323232, -3vw 0 1.5vw 0 #323232;
transform: perspective(640px) rotateX(60deg) rotateZ(0deg) scale(.8);
&:before, &:after {
animation: none;
background-color: rgb(50, 50, 50);
box-shadow: 0 0 1.5vw 2.0vw #323232, 0 0 1.5vw 1.5vw #323232;
}
}
}
.catan-content-inner_1 {
height: 27.07012825vw;
width: 47vw;
animation: 10s linear infinite bg2;
&:before, &:after { animation: 10s linear infinite bg2; }
}
.catan-content-inner_2 {
height: 26.49416807vw;
width: 46vw;
animation: 10s linear infinite bg3;
&:before, &:after { animation: 10s linear infinite bg3; }
}
.catan-content-inner_3 {
height: 25.9182079vw;
width: 45vw;
animation: 10s linear infinite bg4;
&:before, &:after { animation: 10s linear infinite bg4; }
}
.catan-content-inner_4 {
height: 25.34224772vw;
width: 44vw;
animation: 10s linear infinite bg5;
&:before, &:after { animation: 10s linear infinite bg5; }
position: relative;
}
.catan-table, .catan-back {
div[class*="catan-content-inner-cel"]{
display: block;
width: 20%;
position: absolute;
&:nth-of-type( 1 ) {
left: 10%; top: 5%;
}
&:nth-of-type( 2 ) {
left: 25%; top: -10%;
}
&:nth-of-type( 3 ) {
left: 40%; top: -25%;
}
&:nth-of-type( 4 ) {
right: 25%; top: -10%;
}
&:nth-of-type( 5 ) {
right: 10%; top: 5%;
}
.hexagon {
position: relative;
width: 100%;
overflow: hidden;
z-index: 1;
span {
animation: 1s linear position 4s;
animation-fill-mode: forwards;
animation-iteration-count: 1;
opacity: 0;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
position: absolute;
z-index: 100;
top: 50%;
left: 50%;
background: white;
width: 50%;
border: .1vw solid white;
border-radius: 50%;
height: 50%;
text-align: center;
font-size: 1.2vw;
line-height: 1.7vw;
box-shadow: 0 -.1vw 0 #fff, .1vw .1vw .1vw #c1c1c1, .2vw .2vw .1vw #BFBEBE, .3vw .3vw .1vw #bdbbbb, .4vw .2vw 3vw rgba(0, 0, 0, 0.6);
text-shadow: 0 -.1vw 0 #fff, .1vw .1vw .1vw #c1c1c1, .2vw .2vw .1vw #BFBEBE, .3vw .3vw .1vw #bdbbbb, .4vw .2vw .3vw rgba(0, 0, 0, 0.6);
-webkit-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
&.night {
background: #333333;
border: .1vw solid #333333;
box-shadow: 0 -.1vw 0 #222222, .1vw .1vw .1vw #1d1d1d, .2vw .2vw .1vw #111111, .3vw .3vw .1vw #0d0d0d, .4vw .2vw 3vw rgba(0, 0, 0, 0.6);
text-shadow: 0 -.1vw 0 #222222, .1vw .1vw .1vw #1d1d1d, .2vw .2vw .1vw #111111, .3vw .3vw .1vw #0d0d0d, .4vw .2vw 3vw rgba(0, 0, 0, 0.6);
}
&.red {
color: rgb(167, 20, 20);
}
}
&:before {
display: block;
padding-top: 86.602540378%;
content: '';
}
.hexagon__inner-1 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
transform: rotate(60deg);
.hexagon__inner-2 {
width: 100%;
height: 100%;
overflow: hidden;
transform: rotate(60deg);
.hexagon__inner-3 {
width: 100%;
height: 100%;
transform: rotate(-120deg);
.hexagon__inner-image {
opacity: 0;
animation: 1s linear position 2s;
animation-fill-mode: forwards;
animation-iteration-count: 1;
width: 100%;
height: 100%;
&.sheep { background: url('https://raw.githubusercontent.com/uemura5683/catan-animation/main/src/css/sheep.png') center / cover no-repeat; }
&.soil { background: url('https://raw.githubusercontent.com/uemura5683/catan-animation/main/src/css/soil.png') center / cover no-repeat;}
&.steel { background: url('https://raw.githubusercontent.com/uemura5683/catan-animation/main/src/css/steel.png') center / cover no-repeat;}
&.sult { background: url('https://raw.githubusercontent.com/uemura5683/catan-animation/main/src/css/sult.png') center / cover no-repeat;}
&.wheat {background: url('https://raw.githubusercontent.com/uemura5683/catan-animation/main/src/css/wheat.png') center / cover no-repeat; }
&.wood { background: url('https://raw.githubusercontent.com/uemura5683/catan-animation/main/src/css/wood.png') center / cover no-repeat;}
}
}
}
}
}
}
}
.catan-table {
z-index: 2;
animation: 1s linear position;
animation-fill-mode: forwards;
animation-iteration-count: 1;
}
.catan-back {
div[class*="catan-content-inner-cel"] {
opacity: 0;
animation: 1s linear position 2s;
animation-fill-mode: forwards;
animation-iteration-count: 1;
.hexagon {
overflow: visible;
margin: 0 auto;
width: 50%;
height: 100%;
display: block;
position: relative;
background: black;
transition: all 0.2s linear;
padding: 86.6% 0 0;
box-shadow: .1vw .1vw .1vw #2e2e2e, .2vw .2vw .1vw #1e1e1e, .3vw .3vw .1vw #0e0e0e, -.1vw .4vw .1vw rgba(0, 0, 0, 0.6);
&:before, &:after {
content: '';
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
background: black;
transition: all 0.2s linear;
z-index: 0;
padding: 0;
}
&:before {
transform: rotate(60deg);
}
&:after {
transform: rotate(-60deg);
box-shadow: .1vw .1vw .1vw #2e2e2e, .2vw .2vw .1vw #1e1e1e, .3vw .3vw .1vw #0e0e0e, -.1vw .4vw .1vw rgba(0, 0, 0, 0.6);
}
}
}
}
}
}
@media screen and (max-width: 979px) {
#catan-page {
.main_content {
transform: scale(1.25);
-webkit-transform: scale(1.25);
.catan-content-inner {
&:last-child {
top: 0;
margin-top: -30%;
margin-bottom: 20%;
}
div[class*="catan-content-inner-cel"] {
.hexagon {
span {
border: .1vw solid white;
text-align: center;
font-size: 0.4vw;
}
}
}
}
}
}
}
@keyframes bg1 {
0% { background:#407bff; }
50% { background: #004eff; }
100% { background: #407bff; } }
@keyframes bg2 {
0% { background: #3573ff; }
50% { background: #0d57ef; }
100% { background: #3573ff; } }
@keyframes bg3 {
0% { background: #1f64ff; }
50% { background: #1f64ff; }
100% { background: #1f64ff; } }
@keyframes bg4 {
0% { background: #0d57ef; }
50% { background: #3573ff; }
100% { background: #0d57ef; } }
@keyframes bg5 {
0% { background: #004eff;}
50% { background: #407bff;}
100% { background: #004eff; } }
@keyframes bg6 {
0% { background: rgb(50, 50, 50); }
50% { background: rgb(50, 50, 50); }
100% { background: rgb(50, 50, 50); } }
@keyframes position {
from { opacity: 0; }
to { opacity: 1; } }
@keyframes rotation{
0% { -webkit-transform: perspective(640px) rotateX(60deg) rotateZ(0deg) scale(1); }
50% { -webkit-transform: perspective(640px) rotateX(60deg) rotateZ(180deg) scale(1); }
100% { -webkit-transform: perspective(640px) rotateX(60deg) rotateZ(360deg) scale(1);} }
@keyframes rotation_bg{
0% { -webkit-transform: perspective(640px) rotateX(60deg) rotateZ(0deg) scale(1); }
50% { -webkit-transform: perspective(640px) rotateX(60deg) rotateZ(180deg) scale(1); }
100% { -webkit-transform: perspective(640px) rotateX(60deg) rotateZ(360deg) scale(1);} }
Also see: Tab Triggers