There a second way (perhaps simpler) to construct lots of diffeomorphisms of the cube to itself, and with it you can probably more easily reconstruct the picture you posted in your question statement.
The basic idea is this:
If $f$ is a smooth function with domain the closed interval $(0,1)$, taking values in $\mathbb{R}$, such that $\lim_{x \to 0^+} f(x) = 0$ and $\lim_{x \to 1^-} f(x) = 1$, and $f' \geq \epsilon > 0$, then $f$ is a diffeomorphism of $(0,1)$ to itself.
The idea is that since $f$ is strictly monotonic, it is a bijection of $(0,1)$ to itself. And since $f' \neq 0$, it is everywhere a local diffeomorphism. Therefore $f$ is in fact a diffeomorphism.
Now, there is an easy way to guarantee that $f$ is a function with limits $\lim_{x\to 0^+} f(x) = 0$ and $\lim_{x\to 1^-} f(x) = 1$ and that $f' \geq \epsilon$: we can suppose that our function
$$ f(x) = x + g(x) $$
where $g(x)$ is any smooth function that vanishes at $x = 0$ and $x = 1$, and such that $|g'(x)| < 1 - \epsilon$.
This can be extended to the higher dimensional case as follows.
Let $\phi$ denote the desired diffeomorphism, and make the assumption that
$$ \phi(x_1, x_2, x_3) = (x_1,x_2,x_3) + (u,v,w) $$
where $u,v,w$ are real functions of $x_1, x_2, x_3$. We require that the three functions are smooth, that they vanish on the boundary of the cube, and that the sum of the gradients
$$ |\nabla u|^2 + |\nabla v|^2 + |\nabla w|^2 < 1 - \epsilon $$
This will guarantee that $\phi$ is a smooth map whose Jacobian derivative is invertible, and also using what is discussed in the first part of this answer that $\phi$ is bijective onto the cube.
Example:
In the two dimensional case, you can let
$$ u(x,y) = \frac{1}{4\pi} \sin(2\pi y) \sin(\pi x) $$
and
$$ v(x,y) = - \frac{1}{4\pi}\sin(2\pi x) \sin(\pi y) $$
and you will get a picture that looks something like what you showed above in the question.
In the cubic case, then you can do something similar by setting, for example,
$$ u(x,y,z) = \frac{1}{7\pi} \sin(\pi x) \sin(2\pi y) \sin(3\pi z) $$
$$ v(x,y,z) = - \frac{1}{7\pi} \sin(3\pi x) \sin(\pi y) \sin(2\pi z) $$
and
$$ w(x,y,z) = \frac{1}{7\pi} \sin(2\pi x) \sin(3\pi y) \sin(\pi z) $$
The crucial thing (which was used to determine the coefficient $\frac{1}{7\pi}$, is that we want the sum of the squares of the gradients of $u$, $v$ and $w$ to be strictly less than 1. A naive estimate using that trigonometric functions are bounded in absolute value by $1$ shows that
$$ |\nabla u|^2 \leq \frac{\pi^2 + (2\pi)^2 + (3\pi)^2}{(7\pi)^2} = \frac{2}{7} $$
and similarly for $|\nabla v|^2$ and $|\nabla w|^2$, so the condition is verified.