Update virtual sample style
This commit is contained in:
parent
e848033c9e
commit
f90a3a8837
2 changed files with 77 additions and 51 deletions
|
|
@ -30,7 +30,8 @@
|
||||||
.btn[disabled] {
|
.btn[disabled] {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background: var(--color-black-10);
|
background: var(--color-black-10);
|
||||||
color: var(--color-black-20);
|
--btn-color: var(--color-black-20) !important;
|
||||||
|
--icon-color: var(--color-black-20) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn.active,
|
.btn.active,
|
||||||
|
|
@ -122,6 +123,7 @@ input[type="checkbox"]:checked + .btn--primary {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background-image: var(--btn-image);
|
background-image: var(--btn-image);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
background-color: #FAF8F7;
|
||||||
width: var(--btn-image-w);
|
width: var(--btn-image-w);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
@ -133,6 +135,10 @@ input[type="checkbox"]:checked + .btn--primary {
|
||||||
--btn-border-color: var(--color-primary-50);
|
--btn-border-color: var(--color-primary-50);
|
||||||
--btn-color: var(--color-primary);
|
--btn-color: var(--color-primary);
|
||||||
}
|
}
|
||||||
|
.btn--image:hover,
|
||||||
|
.btn--image:active {
|
||||||
|
color: var(--color-primary-hover);
|
||||||
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
.btn:hover {
|
.btn:hover {
|
||||||
|
|
|
||||||
|
|
@ -48,47 +48,48 @@
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<div id="container">
|
<div class="track-container">
|
||||||
<figure>
|
<figure>
|
||||||
<img :src="currentFile.url" alt="" />
|
<img :src="currentFile.url" alt="" />
|
||||||
</figure>
|
</figure>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input
|
|
||||||
id="x"
|
|
||||||
type="range"
|
|
||||||
min="0"
|
|
||||||
:max="xMax"
|
|
||||||
:steps="xMax + 1"
|
|
||||||
value="0"
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
id="y"
|
|
||||||
type="range"
|
|
||||||
min="0"
|
|
||||||
:max="yMax"
|
|
||||||
:steps="yMax + 1"
|
|
||||||
orient="vertical"
|
|
||||||
value="0"
|
|
||||||
/>
|
|
||||||
<button
|
<button
|
||||||
|
class="btn btn--icon"
|
||||||
id="y-up"
|
id="y-up"
|
||||||
@click="currentY++"
|
@click="currentY++"
|
||||||
:disabled="currentY === yMax.length"
|
:disabled="currentY === yMax.length"
|
||||||
|
data-icon="chevron-single-left"
|
||||||
|
title="Pivoter vers le haut"
|
||||||
>
|
>
|
||||||
Top
|
<span class="sr-only">Top</span>
|
||||||
</button>
|
|
||||||
<button id="x-down" @click="currentX--" :disabled="currentX === 0">
|
|
||||||
Left
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
id="x-up"
|
class="btn btn--icon"
|
||||||
@click="currentX++"
|
id="x-down"
|
||||||
:disabled="currentX === xMax.length"
|
@click="rotateX('left')"
|
||||||
|
data-icon="chevron-single-left"
|
||||||
|
title="Pivoter vers la gauche"
|
||||||
>
|
>
|
||||||
Right
|
<span class="sr-only">Left</span>
|
||||||
</button>
|
</button>
|
||||||
<button id="y-down" @click="currentY--" :disabled="currentY === 0">
|
<button
|
||||||
Bottom
|
class="btn btn--icon"
|
||||||
|
id="x-up"
|
||||||
|
@click="rotateX('right')"
|
||||||
|
data-icon="chevron-single-left"
|
||||||
|
title="Pivoter vers la droite"
|
||||||
|
>
|
||||||
|
<span class="sr-only">Right</span>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn--icon"
|
||||||
|
id="y-down"
|
||||||
|
@click="currentX === xMax ? xMax : currentX--"
|
||||||
|
:disabled="currentY === 0"
|
||||||
|
data-icon="chevron-single-left"
|
||||||
|
title="Pivoter vers le bas"
|
||||||
|
>
|
||||||
|
<span class="sr-only">Bottom</span>
|
||||||
</button>
|
</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -171,6 +172,15 @@ const currentFile = computed(() =>
|
||||||
// Variables
|
// Variables
|
||||||
const isOpen = ref(true);
|
const isOpen = ref(true);
|
||||||
const isCommentsOpen = ref(false);
|
const isCommentsOpen = ref(false);
|
||||||
|
|
||||||
|
function rotateX(direction) {
|
||||||
|
if (direction == 'left') {
|
||||||
|
currentX.value = currentX.value === 0 ? xMax.value : currentX.value - 1
|
||||||
|
}
|
||||||
|
if (direction == 'right') {
|
||||||
|
currentX.value = currentX.value === xMax.value ? 0 : currentX.value + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
@ -178,76 +188,86 @@ const isCommentsOpen = ref(false);
|
||||||
padding: var(--space-16);
|
padding: var(--space-16);
|
||||||
}
|
}
|
||||||
|
|
||||||
#container {
|
.track-container {
|
||||||
--w: 500px;
|
--w: 100%;
|
||||||
--h: 500px;
|
--h: calc(100% - 74px);
|
||||||
--x-steps: 14;
|
--x-steps: 14;
|
||||||
--y-steps: 5;
|
--y-steps: 5;
|
||||||
width: var(--w);
|
width: var(--w);
|
||||||
height: var(--h);
|
height: var(--h);
|
||||||
background-color: dimgray;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin: var(--space-16) auto;
|
||||||
|
border-radius: var(--rounded-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#container figure {
|
.track-container figure {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
#container img {
|
.track-container img {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
height: inherit;
|
height: inherit;
|
||||||
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
.track-container fieldset {
|
||||||
#container fieldset {
|
--p: 0rem;
|
||||||
--p: 1rem;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: var(--w);
|
width: var(--w);
|
||||||
height: var(--h);
|
height: var(--h);
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
.track-container button,
|
||||||
#container button,
|
.track-container input {
|
||||||
input {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
#x {
|
/* Buttons */
|
||||||
left: 0;
|
.track-container .btn--icon {
|
||||||
bottom: calc(-1 * var(--p));
|
--icon-size: var(--space-24);
|
||||||
right: 0;
|
--icon-color: var(--color-grey-700);
|
||||||
|
width: var(--space-48);
|
||||||
|
height: var(--space-48);
|
||||||
|
max-height: var(--space-48);
|
||||||
|
background: transparent;
|
||||||
|
padding: var(--space-12);
|
||||||
}
|
}
|
||||||
#y {
|
.track-container .btn--icon:hover {
|
||||||
top: 0;
|
background: var(--color-black-10);
|
||||||
bottom: 0;
|
|
||||||
right: calc(-1 * var(--p));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#y-up {
|
#y-up {
|
||||||
top: var(--p);
|
top: var(--p);
|
||||||
}
|
}
|
||||||
|
#y-up::before {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
#y-down {
|
#y-down {
|
||||||
bottom: var(--p);
|
bottom: var(--p);
|
||||||
}
|
}
|
||||||
|
#y-down::before {
|
||||||
|
transform: rotate(-90deg);
|
||||||
|
}
|
||||||
#y-up,
|
#y-up,
|
||||||
#y-down {
|
#y-down {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
#x-down {
|
#x-down {
|
||||||
left: var(--p);
|
left: var(--p);
|
||||||
}
|
}
|
||||||
#x-up {
|
#x-up {
|
||||||
right: var(--p);
|
right: var(--p);
|
||||||
}
|
}
|
||||||
|
#x-up::before {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
#x-down,
|
#x-down,
|
||||||
#x-up {
|
#x-up {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue