JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/npm/@simonwep/presentr/dist/presentr.min.js"></script>
<div class="presentr">
<div class="progress"></div>
<div class="slides">
<!-- Slide 1 -->
<section class="welcome">
<h1>キーボードの矢印キーで進めます</h1>
</section>
<!-- Slide 2 -->
<section class="features">
<h2>どんどん→キーで進めます</h2>
<div class="list">
<p class="frag">シンプルで</p>
<p class="frag">jQueryなんかも不要</p>
<p class="frag">一切の依存もなく</p>
<p class="frag">扱いも簡単</p>
<p class="frag">とっても軽量です</p>
</div>
</section>
<!-- Slide 3 -->
<section class="setup">
<h2>hogehoge</h2>
<div class="methods">
<div class="frag method">
<h3>huga</h3>
<code>hugahuga</code>
</div>
<div class="frag method">
<h3>piyo</h3>
<code>piyopiyo</code>
</div>
<div class="frag method">
<h3>foo</h3>
<code>fooooooooooooooooo!</code>
</div>
<div class="frag method">
<h3>bar</h3>
<code>baaaaaaaaaaaaaaar!</code>
</div>
</div>
</section>
<!-- Slide 4 -->
<section class="gh">
<h2>詳細は以下</h2>
<a href="https://github.com/Simonwep/presentr">GitHub</a>
</section>
</div>
</div>
CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
}
.presentr {
font-size: 1vw;
}
.presentr .progress {
position: fixed;
background: #ff4446;
top: 0;
left: 0;
width: 0;
height: 0.2vh;
z-index: 1;
transition: all 1s;
}
.presentr .slides {
transition: all 0.6s;
}
.presentr .slides section {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: all 0.3s;
filter: grayscale(100%);
}
.presentr .slides section h2 {
font-family: 'Satisfy';
font-size: 8em;
color: #ff4446;
margin-bottom: 5vh;
}
.presentr .slides section h2,
.presentr .slides section.welcome h1 {
text-shadow: 2px 2px 0 #862224;
}
.presentr .slides section.welcome .keyboard-shortcuts {
text-align: center;
color: rgba(0, 0, 0, 0.75);
font-size: 1.3em;
}
.presentr .slides section.welcome .keyboard-shortcuts p {
transform: translateY(-0.5vh);
opacity: 0;
margin: 0.3em 0;
animation: normalize 0.7s ease forwards;
}
.presentr .slides section.welcome .keyboard-shortcuts p:nth-child(2) {
animation-delay: 0.5s;
}
.presentr .slides section.welcome .keyboard-shortcuts b {
font-weight: 600;
}
.presentr .slides section.welcome h1 {
font-family: 'Satisfy';
font-size: 10em;
color: #ff4446;
}
.presentr .slides section.features .list {
display: flex;
flex-direction: column;
align-items: center;
}
.presentr .slides section.features .list p {
color: rgba(0, 0, 0, 0.85);
display: inline-block;
position: relative;
margin: 0.5em 0;
padding: 0.3em 0.4em 0 0.4em;
font-size: 2em;
text-align: center;
}
.presentr .slides section.features .list p::before {
position: absolute;
content: '';
bottom: -0.2em;
left: 0;
right: 0;
margin: auto;
width: 0;
height: 100%;
background: #ff4446;
transition: all 0.5s;
z-index: -1;
}
.presentr .slides...
JavaScript
// Simple example, see optional options for more configuration.
const presentr = new Presentr({
// Selector for each slide
slides: '.presentr .slides > section'
});