templates/page/home.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}👾 Combattez pour l'humanité{% endblock %}
  3. {% block head_scripts %}<link rel="stylesheet" href="{{ asset('css/pages/home.css') }}">{% endblock %}
  4. {% block body %}
  5.     <section class="bg-one bg-center effect-bg-1">
  6.         <div class="bg-effect"></div>
  7.         <div id="foglayer_01" class="fog">
  8.             <div class="image01"></div>
  9.             <div class="image02"></div>
  10.         </div>
  11.         <div id="foglayer_02" class="fog">
  12.             <div class="image01"></div>
  13.             <div class="image02"></div>
  14.         </div>
  15.         <div id="foglayer_03" class="fog">
  16.             <div class="image01"></div>
  17.             <div class="image02"></div>
  18.         </div>
  19.         <div class="container d-flex flex-column align-items-center justify-content-center h-70vh">
  20.             <div class="text-center">
  21.                 <p class="h4 text-space mb-4">Faites face Ã  tous les dangers</p>
  22.                 <p class="big-title mb-4">Entrez dans<br>la <span class="text-second">b<span id="l1">r</span>u<span id="l2">m</span>e</span></p>
  23.                 <p class="h4 text-space mb-5">Partez re-conquérir notre planète perdue</p>
  24.                 {% if is_granted('ROLE_USER') %}
  25.                     <a href="{{ path('app_station_index') }}" class="btn">Retour Ã  la station</a>
  26.                 {% else %}
  27.                     <a href="{{ path('app_register') }}" class="btn">Nous rejoindre</a>
  28.                 {% endif %}
  29.             </div>
  30.         </div>
  31.     </section>
  32.     <section class="top-line bg-primary py-5">
  33.         <div class="container py-5">
  34.             <div class="row">
  35.                 <div class="col-12 col-md-6 mb-4 mb-md-0">
  36.                     <p class="h3">Jeu navigateur gratuit</p>
  37.                     <p class="h2 mb-4">Rejoignez le projet <span class="text-second">C.L.O.N.E.S.</span> et Ã©voluez sur une <span class="text-second">planète infestée</span></p>
  38.                     <p class="mb-4">Le succès de cette mission ne dépends que de vous. Aurez-vous le courage d'affronter les hordes qui se cachent dans la brume ?</p>
  39.                     <a href="{{ path('app_page_lore') }}" class="btn">En savoir plus</a>
  40.                 </div>
  41.                 <div class="col-12 col-md-5 offset-md-1">
  42.                     <img class="img-path hover-scale" src="{{ asset('images/story/la-brume-vaisseau-amiral.jpg') }}" alt="Vaisseau amiral de la flotte humaine">
  43.                 </div>
  44.             </div>
  45.         </div>
  46.     </section>
  47.     
  48.     <section style="background-color: #000">
  49.         <div class="earth-before"></div>
  50.         <div id='earth' style="height: 500px;overflow: hidden;"></div>
  51.         <p class="mb-0 earth-text h2">Tous les moyens sont bons, pour re-conquérir notre planète.<br><span class="text text-no-transform">Il est temps de chasser ces monstres pour récupérer notre Terre. Le conseil a donné carte blanche. Devenez le meilleur pionnier.</span></p>
  52.         <div class="earth-after"></div>
  53.     </section>
  54.     <section class="bg-two">
  55.         <div class="effect-bg-1 py-5">
  56.             <div class="container py-5">
  57.                 <div class="row">
  58.                     <div class="col-12 col-lg-4 lg-4 mb-lg-0">
  59.                         <div class="card hover-up is-fullheight">
  60.                             <div class="card-body is-fullheight">
  61.                                 <div class="points color-1">
  62.                                     <span></span>
  63.                                     <span></span>
  64.                                     <span></span>
  65.                                 </div>
  66.                                 <p class="h2 underline">Fouillez</p>
  67.                                 <p>Malgré l'état dans laquelle nous retrouvons notre planète, de nombreuses ressources sont encore Ã  dénicher en fouillant un peu.</p>
  68.                                 <p>Que ce soit des ressources de base comme le bois ou le métal, ou des armes comme ce bon vieux Dézingueur, découvrez plus d'une centaine d'objets. Enfin... si vous avez une chance de cocu.</p>
  69.                                 <div class="d-flex">
  70.                                     <img class="me-2" src="{{ asset('images/items/f1_4.png') }}" alt="" width="50" height="50">
  71.                                     <img class="me-2" src="{{ asset('images/items/f2_48.png') }}" alt="" width="50" height="50">
  72.                                     <img class="me-2" src="{{ asset('images/items/f6_82.png') }}" alt="" width="50" height="50">
  73.                                     <img src="{{ asset('images/items/f5_69.png') }}" alt="" width="50" height="50">
  74.                                 </div>
  75.                             </div>
  76.                         </div>
  77.                     </div>
  78.                     <div class="col-12 col-lg-4 lg-4 mb-lg-0">
  79.                         <div class="card hover-up is-fullheight">
  80.                             <div class="card-body is-fullheight">
  81.                                 <div class="points color-2">
  82.                                     <span></span>
  83.                                     <span></span>
  84.                                     <span></span>
  85.                                 </div>
  86.                                 <p class="h2 underline">Fabriquez</p>
  87.                                 <p>Assemblez des objets pour en fabriquer de nouveaux, et utilisez-les pour construire et améliorer votre campement.</p>
  88.                                 <p>Découvrez de nouvelles possibilités, améliorez votre vie sur terre et rendez jaloux tous vos voisins !</p>
  89.                                 <p>Et surtout, pensez Ã  faire la poussière de temps en temps dans votre camps.</p>
  90.                             </div>
  91.                         </div>
  92.                     </div>
  93.                     <div class="col-12 col-lg-4 lg-4 mb-lg-0">
  94.                         <div class="card hover-up is-fullheight">
  95.                             <div class="card-body is-fullheight">
  96.                                 <div class="points color-3">
  97.                                     <span></span>
  98.                                     <span></span>
  99.                                     <span></span>
  100.                                 </div>
  101.                                 <p class="h2 underline">Survivez</p>
  102.                                 <p>Seul, avec des amis ou même des inconnus !</p>
  103.                                 <p>Rejoignez (ou non) un groupe pour profiter ensemble (ou pas) d'une carte interactive de plus de 90 000 zones Ã  découvrir, laissant place Ã  10 biomes uniques avec pour chacun des spécificités.</p>
  104.                                 <p>Massacrez les monstres que vous croisez en chemin, et faites de nouveau prospérer l'humanité !</p>
  105.                             </div>
  106.                         </div>
  107.                     </div>
  108.                 </div>
  109.             </div>
  110.         </div>
  111.     </section>
  112. {% endblock %}
  113. {% block footer_scripts %}
  114. <script>
  115.     let text = ["$", "¤", "&", "R"];
  116.     let text2 = ["@", "%", "?", "M"];
  117.     let inst = setInterval(change, 1000);
  118.     let inst2 = setInterval(change2, 500);
  119.     function getRndInteger(min, max) {
  120.         return Math.floor(Math.random() * (max - min) ) + min;
  121.     }
  122.     function change() {
  123.         document.getElementById("l1").innerHTML = text[getRndInteger(0, 4)];
  124.     }
  125.     function change2() {
  126.         document.getElementById("l2").innerHTML = text2[getRndInteger(0, 4)];
  127.     }
  128. </script>
  129.     <script type="text/javascript" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/68727/three.min.js"></script>
  130.     <script type="text/javascript" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/68727/extras.js"></script>
  131.     <script>
  132.         "use strict";
  133.         var Earth = function (el, data) {
  134.             let camera, scene, renderer, composer, w, h;
  135.             let points = [],
  136.                 rotation = {
  137.                     x: Math.PI * 1.9,
  138.                     y: Math.PI / 6
  139.                 },
  140.                 target = {
  141.                     x: Math.PI * 1.9,
  142.                     y: Math.PI / 6
  143.                 };
  144.             const center = new THREE.Vector3(0, 0, 0),
  145.                 clock = new THREE.Clock(),
  146.                 distance = 350,
  147.                 PI_HALF = Math.PI / 2,
  148.                 pointRadius = 152,
  149.                 radius = 150;
  150.             // Shaders
  151.             // https://github.com/dataarts/webgl-globe
  152.             const shaders = {
  153.                 atmosphere: {
  154.                     uniforms: {},
  155.                     vertexShader: [
  156.                         "varying vec3 vNormal;",
  157.                         "void main() {",
  158.                         "vNormal = normalize( normalMatrix * normal );",
  159.                         "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  160.                         "}"
  161.                     ].join("\n"),
  162.                     fragmentShader: [
  163.                         "varying vec3 vNormal;",
  164.                         "void main() {",
  165.                         "float intensity = pow( 0.8 - dot( vNormal, vec3( 0, 0, 1.0 ) ), 3.0 );",
  166.                         "gl_FragColor = vec4( 0.3, 0.4, 0.6, 0.075 ) * intensity;",
  167.                         "}"
  168.                     ].join("\n")
  169.                 }
  170.             };
  171.             // -------------------------------------
  172.             //   Init
  173.             // -------------------------------------
  174.             function init() {
  175.                 w = window.innerWidth;
  176.                 h = window.innerHeight;
  177.                 camera = new THREE.PerspectiveCamera(distance / 5, w / h, 1, distance * 2);
  178.                 scene = new THREE.Scene();
  179.                 scene.add(camera);
  180.                 // Stars
  181.                 // http://gielberkers.com/evenly-distribute-particles-shape-sphere-threejs/
  182.                 let starGeometry = new THREE.Geometry();
  183.                 for (let i = 0; i < 1000; i++) {
  184.                     let x = -1 + Math.random() * 2;
  185.                     let y = -1 + Math.random() * 2;
  186.                     let z = -1 + Math.random() * 2;
  187.                     const d = 1 / Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2));
  188.                     x *= d;
  189.                     y *= d;
  190.                     z *= d;
  191.                     const vertex = new THREE.Vector3(
  192.                         x * distance,
  193.                         y * distance,
  194.                         z * distance
  195.                     );
  196.                     starGeometry.vertices.push(vertex);
  197.                 }
  198.                 const stars = new THREE.Points(
  199.                     starGeometry,
  200.                     new THREE.PointsMaterial({
  201.                         color: "#555555",
  202.                         size: 3
  203.                     })
  204.                 );
  205.                 scene.add(stars);
  206.                 // Light
  207.                 let light = new THREE.PointLight("#ffffff", 0.5);
  208.                 camera.add(light);
  209.                 light.position.set(distance / 2, distance / 2, 0);
  210.                 light.target = camera;
  211.                 // Earth
  212.                 THREE.ImageUtils.crossOrigin = "";
  213.                 var earthLights = THREE.ImageUtils.loadTexture(
  214.                     "{{ asset('images/background/earth-lights.jpg') }}"
  215.                 );
  216.                 var earthBump = THREE.ImageUtils.loadTexture(
  217.                     "{{ asset('images/background/earth-bump.jpg') }}"
  218.                 );
  219.                 earthLights.minFilter = THREE.LinearFilter;
  220.                 earthBump.minFilter = THREE.LinearFilter;
  221.                 var earthGeometry = new THREE.SphereGeometry(radius, 50, 30);
  222.                 var earthMaterial = new THREE.MeshPhongMaterial({
  223.                     bumpMap: earthBump,
  224.                     bumpScale: 4,
  225.                     emissiveMap: earthBump,
  226.                     emissive: "#333333",
  227.                     map: earthBump,
  228.                     specular: "#010101"
  229.                 });
  230.                 const earth = new THREE.Mesh(earthGeometry, earthMaterial);
  231.                 scene.add(earth);
  232.                 // Atmosphere
  233.                 const atmosphereMaterial = new THREE.ShaderMaterial({
  234.                     vertexShader: shaders["atmosphere"].vertexShader,
  235.                     fragmentShader: shaders["atmosphere"].fragmentShader,
  236.                     side: THREE.BackSide,
  237.                     blending: THREE.AdditiveBlending,
  238.                     transparent: true
  239.                 });
  240.                 const atmosphere = new THREE.Mesh(earthGeometry, atmosphereMaterial);
  241.                 atmosphere.scale.set(1.3, 1.3, 1.3);
  242.                 scene.add(atmosphere);
  243.                 // Points
  244.                 for (let i = 0; i < data.length; i++) {
  245.                     points.push(new point(data[i].lat, data[i].long, data[i].r, i));
  246.                     let newLine = drawCurve(points[0].position, points[i].position);
  247.                     new TWEEN.Tween(newLine)
  248.                         .to({
  249.                             currentPoint: 200
  250.                         }, 2000)
  251.                         .delay(i * 350 + 1500)
  252.                         .easing(TWEEN.Easing.Cubic.Out)
  253.                         .onUpdate(function() {
  254.                             newLine.geometry.setDrawRange(0, newLine.currentPoint);
  255.                         })
  256.                         .start();
  257.                 }
  258.                 // Renderer
  259.                 renderer = new THREE.WebGLRenderer({
  260.                     alpha: true,
  261.                     antialias: true
  262.                 });
  263.                 renderer.autoClear = false;
  264.                 renderer.setPixelRatio(window.devicePixelRatio);
  265.                 renderer.setSize(w, h);
  266.                 // Composer
  267.                 composer = new THREE.EffectComposer(renderer);
  268.                 composer.addPass(new THREE.RenderPass(scene, camera));
  269.                 const effectBloom = new THREE.BloomPass(1.75);
  270.                 const effectFilm = new THREE.FilmPass(0.25, 0.5, 2048, 0);
  271.                 const effectShift = new THREE.ShaderPass(THREE.RGBShiftShader);
  272.                 effectShift.uniforms["amount"].value = 0.003;
  273.                 effectShift.renderToScreen = true;
  274.                 composer.addPass(effectBloom);
  275.                 composer.addPass(effectFilm);
  276.                 composer.addPass(effectShift);
  277.                 // Events
  278.                 window.addEventListener("resize", onWindowResize, false);
  279.                 // DOM
  280.                 el.appendChild(renderer.domElement);
  281.             }
  282.             // -------------------------------------
  283.             //   Lat + Long to Vector
  284.             // -------------------------------------
  285.             function latLongToVector3(lat, lon, r) {
  286.                 // http://www.smartjava.org/content/render-open-data-3d-world-globe-threejs
  287.                 const phi = (lat * Math.PI) / 180;
  288.                 const theta = ((lon - 287) * Math.PI) / 180;
  289.                 const x = -r * Math.cos(phi) * Math.cos(theta);
  290.                 const y = r * Math.sin(phi);
  291.                 const z = r * Math.cos(phi) * Math.sin(theta);
  292.                 return new THREE.Vector3(x, y, z);
  293.             }
  294.             // -------------------------------------
  295.             //   Interactivity
  296.             // -------------------------------------
  297.             function onWindowResize(event) {
  298.                 camera.aspect = window.innerWidth / window.innerHeight;
  299.                 camera.updateProjectionMatrix();
  300.                 renderer.setSize(window.innerWidth, window.innerHeight);
  301.             }
  302.             // -------------------------------------
  303.             //   Animate
  304.             // -------------------------------------
  305.             function animate(time) {
  306.                 render();
  307.                 TWEEN.update(time);
  308.                 requestAnimationFrame(animate);
  309.             }
  310.             // -------------------------------------
  311.             //   Render
  312.             // -------------------------------------
  313.             function render() {
  314.                 if (el.style.cursor != 'move') target.x += 0.00010;
  315.                 rotation.x += (target.x - rotation.x) * 0.1;
  316.                 rotation.y += (target.y - rotation.y) * 0.1;
  317.                 camera.position.x = distance * Math.sin(rotation.x) * Math.cos(rotation.y);
  318.                 camera.position.y = distance * Math.sin(rotation.y);
  319.                 camera.position.z = distance * Math.cos(rotation.x) * Math.cos(rotation.y);
  320.                 camera.lookAt(center);
  321.                 renderer.render(scene, camera);
  322.                 composer.render();
  323.             }
  324.             // -------------------------------------
  325.             //   Point
  326.             // -------------------------------------
  327.             function point(lat, lng, r, i) {
  328.                 const position = latLongToVector3(lat, lng, radius);
  329.                 const pointGeometry = new THREE.SphereGeometry(r, 32, 32);
  330.                 const pointMaterial = new THREE.MeshBasicMaterial({
  331.                     color: '#ff3600',
  332.                     opacity: 0.2,
  333.                     side: THREE.DoubleSide,
  334.                     transparent: true
  335.                 });
  336.                 let point = new THREE.Mesh(pointGeometry, pointMaterial);
  337.                 point.position.set(position.x, position.y, position.z);
  338.                 point.scale.set(0.01, 0.01, 0.01);
  339.                 point.lookAt(center);
  340.                 scene.add(point);
  341.                 new TWEEN.Tween(point.scale)
  342.                     .to({
  343.                         x: 1,
  344.                         y: 1,
  345.                         z: 1
  346.                     }, 1000)
  347.                     .delay(i * 350 + 1500)
  348.                     .easing(TWEEN.Easing.Cubic.Out)
  349.                     .start();
  350.                 const pointRingGeometry = new THREE.RingGeometry(r + 0.5, r + 1.5, 32);
  351.                 const pointRingMaterial = new THREE.MeshBasicMaterial({
  352.                     color: '#ff3600',
  353.                     opacity: 0.2,
  354.                     side: THREE.DoubleSide,
  355.                     transparent: true
  356.                 });
  357.                 let pointRing = new THREE.Mesh(pointRingGeometry, pointRingMaterial);
  358.                 pointRing.position.set(position.x, position.y, position.z);
  359.                 pointRing.scale.set(0.01, 0.01, 0.01);
  360.                 pointRing.lookAt(center);
  361.                 scene.add(pointRing);
  362.                 new TWEEN.Tween(pointRing.scale)
  363.                     .to({
  364.                         x: 1,
  365.                         y: 1,
  366.                         z: 1
  367.                     }, 1500)
  368.                     .delay(i * 350 + 1500)
  369.                     .easing(TWEEN.Easing.Cubic.Out)
  370.                     .start();
  371.                 return point;
  372.             }
  373.             // http://armsglobe.chromeexperiments.com/js/visualize_lines.js
  374.             function drawCurve(a, b, i) {
  375.                 const distance = a.clone().sub(b).length();
  376.                 let mid = a.clone().lerp(b, 0.5);
  377.                 const midLength = mid.length();
  378.                 mid.normalize();
  379.                 mid.multiplyScalar(midLength + distance * 0.25);
  380.                 let normal = (new THREE.Vector3()).subVectors(a, b);
  381.                 normal.normalize();
  382.                 const midStart = mid.clone().add(normal.clone().multiplyScalar(distance * 0.25));
  383.                 const midEnd = mid.clone().add(normal.clone().multiplyScalar(distance * -0.25));
  384.                 let splineCurveA = new THREE.CubicBezierCurve3(a, a, midStart, mid);
  385.                 let splineCurveB = new THREE.CubicBezierCurve3(mid, midEnd, b, b);
  386.                 let points = splineCurveA.getPoints(100);
  387.                 points = points.splice(0, points.length - 1);
  388.                 points = points.concat(splineCurveB.getPoints(100));
  389.                 points.push(center);
  390.                 let lineGeometry = new THREE.BufferGeometry();
  391.                 let positions = new Float32Array(points.length * 3);
  392.                 for (let ii = 0; ii < points.length; ii++) {
  393.                     positions[ii * 3 + 0] = points[ii].x;
  394.                     positions[ii * 3 + 1] = points[ii].y;
  395.                     positions[ii * 3 + 2] = points[ii].z;
  396.                 }
  397.                 lineGeometry.addAttribute('position', new THREE.BufferAttribute(positions, 3));
  398.                 lineGeometry.setDrawRange(0, 0);
  399.                 var lineMaterial = new THREE.LineBasicMaterial({
  400.                     color: new THREE.Color(0xffffff),
  401.                     linewidth: 3,
  402.                     opacity: 0.25,
  403.                     transparent: true
  404.                 });
  405.                 let line = new THREE.Line(lineGeometry, lineMaterial);
  406.                 line.currentPoint = 0;
  407.                 scene.add(line);
  408.                 return line;
  409.             }
  410.             // -------------------------------------
  411.             //   Start
  412.             // -------------------------------------
  413.             init();
  414.             animate();
  415.             this.animate = animate;
  416.             return this;
  417.         };
  418.         var data = [
  419.             {
  420.                 long: 15,
  421.                 lat: 52,
  422.                 r: 8
  423.             }, {
  424.                 long: -0.128,
  425.                 lat: 51.507,
  426.                 r: 2
  427.             }, {
  428.                 long: -0.5,
  429.                 lat: 46,
  430.                 r: 2
  431.             }, {
  432.                 long: 3,
  433.                 lat: 47.5,
  434.                 r: 4
  435.             }, {
  436.                 long: 5,
  437.                 lat: 49,
  438.                 r: 3
  439.             }, {
  440.                 long: 10,
  441.                 lat: 48,
  442.                 r: 5
  443.             }, {
  444.                 long: -1,
  445.                 lat: 35,
  446.                 r: 3
  447.             }, {
  448.                 long: -3,
  449.                 lat: 40,
  450.                 r: 6
  451.             }, {
  452.                 long: -8,
  453.                 lat: 44,
  454.                 r: 3
  455.             }, {
  456.                 long: 14,
  457.                 lat: 60,
  458.                 r: 3
  459.             }, {
  460.                 long: 11,
  461.                 lat: 35,
  462.                 r: 3
  463.             }, {
  464.                 long: 15,
  465.                 lat: 38,
  466.                 r: 3
  467.             }, {
  468.                 long: 11.8,
  469.                 lat: 43.9,
  470.                 r: 3
  471.             }, {
  472.                 long: 15.4,
  473.                 lat: 50,
  474.                 r: 5
  475.             }, {
  476.                 long: 31.4,
  477.                 lat: 50.4,
  478.                 r: 6
  479.             }, {
  480.                 long: 24.4,
  481.                 lat: 44.16,
  482.                 r: 7
  483.             }, {
  484.                 long: 25.462,
  485.                 lat: 36.393,
  486.                 r: 2
  487.             }
  488.         ];
  489.         var container = document.getElementById("earth");
  490.         var planet = new Earth(container, data);
  491.     </script>
  492. {% endblock %}